It is currently May 28th, 2024, 7:57 pm

excuting a bang 'x' number of times

Get help with creating, editing & fixing problems with skins
User avatar
Mr.Sadistic
Posts: 65
Joined: January 31st, 2013, 5:28 pm

excuting a bang 'x' number of times

Post by Mr.Sadistic »

First of all,
Hello all, first post here.....relatively new to Rainmeter...have modded some skins, and made a couple of simple ones, as I have started the process of learning Rainmeter......and it has been quite interesting.....

Currently working on a clock that chimes <think grandfarther clock, or mantle clock>....

I have got it to chime on <just before> the hour, the quarter, half, and three quarter hour....great....

Now the next part is ringing off the number of the hour....

IE: just before the hour, you get nice chime melody, then on the hour you get a bell equal to the number of the hour <1 = 1 ring, 11= equals 11 rings>

And that brings us to my problem.....
I know how to 'read' the hour...Measure=Time Format=%I, but how do I get "PLAY /mychime.wav" to play %I number of times??

Been racking my brain here, been over the manual, searched the forum....looked for any similar skins.....and I can not see any method for it.....PLEASE HELP....

I know I could cheat and create a series of .wav files, 1 bell = =1.wav, 2 bells = 2.wav....and call on them in that fashion....but that is cheating, takes to long, and can not be easily switched to a different sound scheme....like chimes instead of bells....would like to solve this on the code side.....

<Idea inspired by a desktop in my house running a Steampunk clock in Yahoo widgets...and while it is fine, widgets eat a boat load of cpu power.... O.O >
User avatar
smurfier
Moderator
Posts: 1931
Joined: January 29th, 2010, 1:43 am
Location: Willmar, MN

Re: excuting a bang 'x' number of times

Post by smurfier »

Try this. You must be running the most current 2.5 beta.

Code: Select all

[Hour]
Measure=Time
Format=%I
OnChangeAction=!EnableMeasure Chimes

[Chimes]
Measure=Calc
Formula=Chimes+1
OnUpdateAction=PLAY mychime.wav
IfEqualValue=[Hour]
IfEqualAction=!DisableMeasure #CURRENTSECTION#
DynamicVariables=1
Disabled=1
GitHub | DeviantArt | Tumblr
This is the song that never ends. It just goes on and on my friends. Some people started singing it not knowing what it was, and they'll continue singing it forever just because . . .
User avatar
Mr.Sadistic
Posts: 65
Joined: January 31st, 2013, 5:28 pm

Re: excuting a bang 'x' number of times

Post by Mr.Sadistic »

smurfier wrote:Try this. You must be running the most current 2.5 beta.

Code: Select all

[Hour]
Measure=Time
Format=%I
OnChangeAction=!EnableMeasure Chimes

[Chimes]
Measure=Calc
Formula=Chimes+1
OnUpdateAction=PLAY mychime.wav
IfEqualValue=[Hour]
IfEqualAction=!DisableMeasure #CURRENTSECTION#
DynamicVariables=1
Disabled=1
Ok, I see what you did there, and it makes sense....BUT....
I am running 2.4...<I understand it is easy to upgrade, sure, howver I would love to stay with the majority>....is there a method for 2.4???

<If I am following this it is the "OnUpdate" that makes this 2.5....correct?>

<and thanks for a speedy response>
User avatar
smurfier
Moderator
Posts: 1931
Joined: January 29th, 2010, 1:43 am
Location: Willmar, MN

Re: excuting a bang 'x' number of times

Post by smurfier »

It's the OnUpdateAction and the OnChangeAction. I highly recommend you update to 2.5. It's what all the fun people are using.
GitHub | DeviantArt | Tumblr
This is the song that never ends. It just goes on and on my friends. Some people started singing it not knowing what it was, and they'll continue singing it forever just because . . .
User avatar
Mr.Sadistic
Posts: 65
Joined: January 31st, 2013, 5:28 pm

Re: excuting a bang 'x' number of times

Post by Mr.Sadistic »

Ok so I upgraded to 2.5....no problem....

Added your code...and...

1> Does not allow the wav to play out and/or overlap....
the file is just a few ms under 2 secs....the execution is on the sec every second.... :(

2> It does not stop....once the hour hits...it repeats ad infinitum.... :confused:

Bed time now....I will work with it tomorrow...and see if I can not beat it into submission....

<again ty for the help>
<as a side question unrelated to this problem....is there a "cheat sheet"/"reference" of EVERY meter/measure/option/command/valid entry/etc for rainmeter, running around?? (the manual is quite useful, but rather spread out) >
User avatar
smurfier
Moderator
Posts: 1931
Joined: January 29th, 2010, 1:43 am
Location: Willmar, MN

Re: excuting a bang 'x' number of times

Post by smurfier »

If you can provide your sound clip for testing I may be able to figure out the problem. For me using OnUpdateAction=!Log Update it works as expected.

There is no cheat sheet at this time as the current manual is actually kind of new.
GitHub | DeviantArt | Tumblr
This is the song that never ends. It just goes on and on my friends. Some people started singing it not knowing what it was, and they'll continue singing it forever just because . . .
User avatar
Virginityrocks
Posts: 478
Joined: February 26th, 2011, 10:22 pm

Re: excuting a bang 'x' number of times

Post by Virginityrocks »

Dont worry about not being part of the majority of users. All Rainmeter users will be on 2.5 soon. And it isn't hard for anyone who isn't to upgrade. Just put a minimum version number requirement when compiling the RMSKIN, and it will inform installers that they need to upgrade for the skin to work.
Droptop Four
Dropdown menu bar & app launcher for Windows & Rainmeter
User avatar
Mr.Sadistic
Posts: 65
Joined: January 31st, 2013, 5:28 pm

Re: excuting a bang 'x' number of times

Post by Mr.Sadistic »

Ok, problem #2 solved...it was a syntax error of my part from where I merged your code snippet into the my .ini....

Problem #1 on the other hand...not so easy....

to recap, "hourchime.wav" is longer than a second....this one is around 5.4 secs. and as your code was, it would execute the "Play" on the sec, every second, thus causing the second .wav, to 'chop' off the first.....

So, I thought, no problem....just delay the cycle...thus the "UpdateDivider=5" added to your code....well it kinda solved the problem, as they still chop each other off, but it does not sound so harsh to thr ear anymore.....but it created a whole new one.....

So far in testing...about half the time it works as intended, the other half it waits for 5 secs before executing....{ie: half the time it is HH:00:00, the other it is HH:00:05}.....any explanation?? or way the make it more reliable??

The other chimes, 1/4hour, 1/2hour, 3/4hour and even the long hour chime, are all worked with MM:SS....and are actually set to go off slightly before the target time as they all have a "clunk and gear whir" lead in....I have provide part of my code to give you and idea of what is going on....<it repeats the MeasureNchime 2 more times for 1/2 and 3/4>

the main update is set to "1000"....

Code: Select all

[MeasureCOUNThour]
Measure=TIME
Format=%I
OnChangeAction=!EnableMeasure Chimes

[Chimes]
UpdateDivider=5
Measure=Calc
Formula=Chimes+1
OnUpdateAction=PLAY #@#\Sounds\hourchime.wav
IfEqualValue=[MeasureCOUNThour]
IfEqualAction=!DisableMeasure #CURRENTSECTION#
DynamicVariables=1
Disabled=1

[color=#008000][Measure4HRchime]
Measure=Time
Format=%M%S
IfEqualValue=5940
IfEqualAction=Play #@#\Sounds\NICEfullchimeFADED.wav
;goal for HRchime for HOUR is 5939

[Measure15MNchime]
Measure=Time
Format=%M%S
IfEqualValue=1457
;1457
IfEqualAction=Play #@#\Sounds\NICEquartchimeSPACE.wav
Ty you all.....

<I will remember the bit about version if I ever package it, and put it out on the net >
User avatar
smurfier
Moderator
Posts: 1931
Joined: January 29th, 2010, 1:43 am
Location: Willmar, MN

Re: excuting a bang 'x' number of times

Post by smurfier »

It would be whole lot easier to test and figure out problems if you package your skin up and post it.
GitHub | DeviantArt | Tumblr
This is the song that never ends. It just goes on and on my friends. Some people started singing it not knowing what it was, and they'll continue singing it forever just because . . .
User avatar
Mr.Sadistic
Posts: 65
Joined: January 31st, 2013, 5:28 pm

Re: excuting a bang 'x' number of times

Post by Mr.Sadistic »

Here it is...such as it is....

<Sorry for the 3 files...forum would not let me post .rmskin of that size>
<the 4 .wavs go into "skin"/@resources/sounds {but most of you could likely figure that out :D }
You do not have the required permissions to view the files attached to this post.