strawberryshortcake wrote: ↑October 18th, 2020, 8:34 am
Incredible work as usual. Your username fits you well. You're like a superstar coding genius.
Yeah, me and Bill are buddies, LMAO. Bill Gates, of course, not Bill Clinton.
A: Well, it's not much to wrap your head around, really. The syntax and the examples are there in the manual, and the specifics always depend on context, there's not a fixed "formula" for it. Generally, assuming you have the appropriate options set to the variables controlling the animation in your other measures/meters and the update variable (i.e. #U#
) or bangs sequence is correctly updating and redrawing things, simultaneously is just about adding the change of the variable (i.e. !SetVariable) controlling the other animation(s) to your main repeating sequence in the AT measure along the already existing one(s), and sequentially is about adding the other actions after the |
delimiter, in the desired action list(s). Otherwise, if the animations are not connected in any way, it's about replicating the existing AT measure to a new one and modifying it according to your needs.
B: Not sure you understood this properly. I'm not changing any sound file duration anywhere - Rainmeter can't do that. I'm just playing the same sound file for a limited number of times (or cycles), that's all.
C: Sure, it's more suited as a bin size indicator - I never disagreed with that. The only reason why I did this for the raindrops and not the bin size is because - again - I do NOT use the bin at all, so it never gets to more than 0 Bytes for me (although I had to enable it to be able to test the previous versions of the code), therefore it was much easier for me to test with the raindrops than by finding the files needed to make the recycle bin of a certain size. That being said, although I like to work on this and such, the main purpose of the thread is hopefully to make YOU understand and be able to do more by yourself. The only way one can do this is by experimenting yourself, and by this I don't mean copy pasting stuff, but actually modifying things on your own and try to find the best solutions to achieve something, in practice. For example, although the code you posted earlier was messy and had redundant parts, I actually liked the fact that you managed to make it functional in the sense of having the expected behavior - that's the way to go. It's not only about being creative from an artistic point of view, it's about being creative from a coding point of view as well. More compact solutions will come, in time - you can't expect this to happen overnight. I'll tell you a "secret": it's not a coincidence that people trying to help here prefer to post simple examples built from the ground up (i.e. from 0) when demonstrating ahievement of a certain goal: the code is much cleaner this way and makes the job easier for the coder, as he doesn't have to manipulate entirely different parts taken from somewhere, that may or may not have conflicting behaviors, variables, or generally requiring some effort to integrate everything into a functional and logical whole.
Anyway, back to the code:
Code: Select all
U=[!UpdateMeasure MeasurePlay][!UpdateMeasure MeasureSlider][!UpdateMeasure MeasureSpheresAngle][!UpdateMeter MeterRaindrops][!UpdateMeterGroup SpheresGroup][!Redraw]
Action1=[!SetVariable Cycle 0][!ShowMeter MeterBinIconEmpty][!HideMeter MeterBinIconFull][!HideMeter MeterBinCount][!HideMeter MeterSphereGreen][!HideMeter MeterSphereWhite][!HideMeter MeterSphereBlue][!CommandMeasure MeasureSlider "Stop 1"][!CommandMeasure MeasureSlider "Stop 2"][!CommandMeasure MeasureSlider "Execute 1"]
Action2=[!SetVariable Cycle 0][!HideMeter MeterBinIconEmpty][!ShowMeter MeterBinIconFull][!ShowMeter MeterBinCount][!ShowMeter MeterSphereGreen][!ShowMeter MeterSphereWhite][!ShowMeter MeterSphereBlue][!CommandMeasure MeasureSlider "Stop 1"][!CommandMeasure MeasureSlider "Stop 2"][!CommandMeasure MeasureSlider "Execute 2"]
IfCondition=(#Frame#%12=8) && (#Cycle#<3)
IfTrueAction=[!SetVariable Cycle (#Cycle#+1)][Play "#@#WaterDrop.wav"]
ActionList1=Reset | Wait #Speed# | Repeat Slide,#Speed#,#FrameCount# | Wait #Speed#
ActionList2=Repeat Slide,#Speed#,#FrameCount# | Wait #Speed# | Rerun | Wait #Speed#
Reset=[!SetVariable Frame 0]#U#
Slide=[!SetVariable Frame ((#Frame#+1)%#FrameCount#)][!SetVariable SpheresAngle ((#SpheresAngle#+#SpheresAngleIncrement#)%360)]#U#
Rerun=[!CommandMeasure MeasureSlider "Stop 1"][!CommandMeasure MeasureSlider "Stop 2"][!CommandMeasure MeasureSlider "Execute 2"]
OnUpdateAction=[!SetVariable OrbIndex (Sgn([MeasureBinSize:])*Clamp((Ceil(Ln([MeasureBinSize:])/Ln(2))-27),1,6))][!UpdateMeter MeterStartButton]
MouseOverAction=[!SetVariable TriggerSlide 1][!ShowMeter MeterBinSize][Play "#@#WaterDrip.wav"][!UpdateMeasure MeasureAction]
MouseLeaveAction=[!SetVariable TriggerSlide 0][!HideMeter MeterBinSize][!Redraw]
LeftMouseUpAction=[Play "#@#WaterFlush.wav"][!CommandMeasure MeasureBinCount "OpenBin"]
RightMouseUpAction=[Play "#@#WaterFlush.wav"][!CommandMeasure MeasureBinCount "EmptyBin"][!UpdateMeasureGroup RecycleGroup][!UpdateMeasure MeasureAction]
The changes made were minor - that's the advantage of having a good base to build on: an OrbIndex, more OrbTints, removing updating the orb from #U# as it served no purpose since it wasn't about raindrops anymore, setting the #OrbIndex# and updating [MeterStartButton] in the update action of [MeasureBinSize] and using the said index in the ImageTint option of [MeterStartButton] instead of the old #Cycle# variable.
I didn't follow exactly the sizes you mentioned: the biggest two are 2 GB and 4 GB instead of 1.5 GB and 2 GB, because it suited the formula as they're powers of 2. In the formula, considering that you can use "only" natural logarithm (i.e. base e
) and base 10 logarithm in Rainmeter and I needed base 2 logarithm to find out to which power should 2 be raised to get [MeasureBinSize:], I used the logarithm property which says that the base-2 logarithm is equal to the natural logarithm divided by ln 2, the natural logarithm of 2
(basically getting base 2 logarithm from the other two logarithms, base e
and base 10). It's not as complicated as it seems: 2^28 = 268 435 456 = 256 (MB)
, so I needed more or less to find the difference between the power that 2 needed to be raised to get to [MeasureBinSize:] (i.e. the measure value's base 2 logarithm) and 28, and that was, again more or less, going to be the needed index. More or less because due to the particularity of these values and the required result, I needed to aply some tweaks, e.g. 27 instead of 28, Ceil(), Clamp() and Sgn()
If you want those >MIN and <=MAX intervals to be adjustable, you'll have to use either IfConditions (like in your previous attempt regarding those colors), or conditionals inside the formula
. That will be your job, if you really want to, as they're not complicated, just much longer. I like short ones, where possible, hence the chosen approach.