Quantcast
Channel: Rainmeter Forums
Viewing all articles
Browse latest Browse all 1719

Sound, Music and Visualizers • Re: Peak hold

$
0
0
Alright... I cleaned up the code and optimized it. :thumbup:
Was able to squeeze all the logic into a single Measure per band in place of the previous two.

I don't see more places where I can optimize it further. Perhaps one of you wizzes would like to take a crack at it.
I think you can't really go better than a single measure per feature, whatever the feature might be - excellent job! :thumbup:
I did it in a single measure too, just used formula conditionals instead of IfConditions to further shorten the code. Basically, your:

Code:

[MeasureCounter]Measure=CalcFormula=Counter

Code:

[MeasurePeakSet1]Measure=CalcFormula=([MeasureCounter]+#DecayHold#)IfCondition=(MeasureAudio1 > #Bar1Value#)IfTrueAction=[!SetVariable Bar1Value [MeasureAudio1]][!SetVariable Bar1Time [MeasurePeakSet1]]IfCondition2=([MeasureCounter] > #Bar1Time#)IfTrueAction2=[!SetVariable Bar1Value (#Bar1Value#*#DecaySpeed#)]DynamicVariables=1IfConditionMode=1
is this in mine:

Code:

[Hold1]Measure=CalcFormula=(Band1>Hold1-#FallS#*(#Time1#>#TimeM#?1:0)?Band1:(#Time1#>#TimeM#?Hold1-#FallS#:Hold1))OnUpdateAction=[!SetVariable Time1 ([Hold1]=[Band1]?0:#Time1#+#Update#)]DynamicVariables=1
So about 726 bytes vs 426 bytes of UTF-16 encoding per measure in terms of code length, if one really wants to be precise. Not much of a difference considering the shorter names I used and the fact that your implementation might be easier to understand, so again, great job! ;)

Statistics: Posted by Yincognito — Yesterday, 11:14 pm



Viewing all articles
Browse latest Browse all 1719

Trending Articles