It is currently August 31st, 2024, 11:59 pm
Peak on a ballistic trajectory sticks at the top of the meter
-
- Posts: 217
- Joined: May 16th, 2012, 5:38 am
Re: Peak on a ballistic trajectory sticks at the top of the meter
May I try to explain my formula? I believe it's quite simple, but I could have a poor perspective on the formula
moshi wrote:there are many Rainmeter skins that aren't really useful, so let's add another one.
jsmorley wrote:I have good news and bad news.
First the bad news. [...] We would be happy to have this happen and would love to work with anyone who is feeling ambitious.
Now the good news.
I lied, there isn't any good news...
-
- Rainmeter Sage
- Posts: 5495
- Joined: April 12th, 2012, 9:40 pm
- Location: Cedar Point, Ohio, USA
Re: Peak on a ballistic trajectory sticks at the top of the meter
Yes, your thoughts on developing a formula are welcomed.
In use, I don't think there is an issue with your acceleration formula; I believe the "ballistic" reaction is due to how it is applied.
You add the acceleration to your audiolevel to get the initial value, but then on the next update, if the audiolevel is still higher, you take that sum (accleration AND audiolevel) and add acceleration and audiolevel again, effectively doubling the result. I think that is why we was seeing values up to 15 to 20 times the actual audiolevel.
There are several ways to get a slowly diminishing peak bar, and I would like to see you succeed in this idea.![Thumbs Up :thumbup:](./images/smilies/ay.gif)
In use, I don't think there is an issue with your acceleration formula; I believe the "ballistic" reaction is due to how it is applied.
You add the acceleration to your audiolevel to get the initial value, but then on the next update, if the audiolevel is still higher, you take that sum (accleration AND audiolevel) and add acceleration and audiolevel again, effectively doubling the result. I think that is why we was seeing values up to 15 to 20 times the actual audiolevel.
There are several ways to get a slowly diminishing peak bar, and I would like to see you succeed in this idea.
![Thumbs Up :thumbup:](./images/smilies/ay.gif)
:: My DA Gallery :: Rainmeter DA Gallery :: Rainmeter Workshops :: Rainmeter Documentation :: BBCode Guide ::
-
- Posts: 217
- Joined: May 16th, 2012, 5:38 am
Re: Peak on a ballistic trajectory sticks at the top of the meter
The formula basically compares the current audio level (MeasureL) with the previous peak level (MeasureL_Peak) and adjusts the acceleration (MeasureL_Accel) accordingly. If the current audio level is higher than the previous peak level plus some threshold, then the formula sets the acceleration to be equal to the difference between them. If the current audio level is lower than that threshold, then the formula subtracts a constant gravity value from the acceleration. I've made a google doc simulator of this function to maybe help understand how it functions. You can edit the values in the MeasureL column to see its response. https://docs.google.com/spreadsheets/d/1vX-LFLPIm7NqsGekEeooVlopRXKG63XuhTuAd5pn6qQ/edit?usp=sharing
moshi wrote:there are many Rainmeter skins that aren't really useful, so let's add another one.
jsmorley wrote:I have good news and bad news.
First the bad news. [...] We would be happy to have this happen and would love to work with anyone who is feeling ambitious.
Now the good news.
I lied, there isn't any good news...
-
- Rainmeter Sage
- Posts: 5495
- Joined: April 12th, 2012, 9:40 pm
- Location: Cedar Point, Ohio, USA
Re: Peak on a ballistic trajectory sticks at the top of the meter
Sorry for the delay getting back here...
I had a chance to look at this and as far as I can tell, the cause for the "ballistic" reaction is due to your conditional statement nesting confusing Rainmeter.
If I bracket your nested tests with parenthesis, then the acceleration behaves as expected.
I changed the Formula for acceleration (this is for left) to:
I did added a Clamp on [MeasureL_Peak] to prevent it from going negative, which would allow the peak bar to go below the current audio level.
This eliminates pinning the peak (unless you increase the RMSGain), but it may also not show enough of a reaction for your desired effect.
Full code
I had a chance to look at this and as far as I can tell, the cause for the "ballistic" reaction is due to your conditional statement nesting confusing Rainmeter.
If I bracket your nested tests with parenthesis, then the acceleration behaves as expected.
I changed the Formula for acceleration (this is for left) to:
Code: Select all
[MeasureL_Accel]
Measure = Calc
Formula = (1.0 <= MeasureL_Peak ? 0 - #Gravity# : (MeasureL >= MeasureL_Peak + ( MeasureL >= MeasureL_Peak ? MeasureL - MeasureL_Peak : MeasureL_Accel - #Gravity# ) ? MeasureL - MeasureL_Peak : MeasureL_Accel - #Gravity#))
[MeasureL_Peak]
Measure = Calc
Formula = Clamp(MeasureL_Accel + MeasureL_Peak,0,1)
This eliminates pinning the peak (unless you increase the RMSGain), but it may also not show enough of a reaction for your desired effect.
Full code
You do not have the required permissions to view the files attached to this post.
:: My DA Gallery :: Rainmeter DA Gallery :: Rainmeter Workshops :: Rainmeter Documentation :: BBCode Guide ::
-
- Posts: 217
- Joined: May 16th, 2012, 5:38 am
Re: Peak on a ballistic trajectory sticks at the top of the meter
That change works perfectly for the peak pinning. Thank you so much for your help Eclectic. I'll have to keep in mind the parentheses are required in nested conditionals. For reference, here's my peak with your fixes applied, and I think it works great! that first peak hit doesn't pin any more, and I went through the entire song and didn't get any peaks pinned to the top.
I've had a think about how to address the perceived unresponsiveness of the meter, and one thing I've noticed is that the AudioLevel meter doesn't always update every frame. My google doc simulation is influenced by small reductions in MeasureL, I think this is a result of some error in the threshold to determine if the peak is going to clip the Measure. I'm not sure what to do about AudioLevel or the apparent bug in my math, so I doubled the update time, doubled gravity, and it looks like this
I've had a think about how to address the perceived unresponsiveness of the meter, and one thing I've noticed is that the AudioLevel meter doesn't always update every frame. My google doc simulation is influenced by small reductions in MeasureL, I think this is a result of some error in the threshold to determine if the peak is going to clip the Measure. I'm not sure what to do about AudioLevel or the apparent bug in my math, so I doubled the update time, doubled gravity, and it looks like this
You do not have the required permissions to view the files attached to this post.
moshi wrote:there are many Rainmeter skins that aren't really useful, so let's add another one.
jsmorley wrote:I have good news and bad news.
First the bad news. [...] We would be happy to have this happen and would love to work with anyone who is feeling ambitious.
Now the good news.
I lied, there isn't any good news...
-
- Rainmeter Sage
- Posts: 5495
- Joined: April 12th, 2012, 9:40 pm
- Location: Cedar Point, Ohio, USA
Re: Peak on a ballistic trajectory sticks at the top of the meter
That looks much better to me!
I really like the motion you achieve with this acceleration/gravity method.
Tweaking the acceleration formula and skin variables should get you closer to the animation effect you are looking for...
I'll probably play with those to see if a better response can be achieved, but you have it working pretty well.![Great :great:](./images/smilies/dn.gif)
![Big Grin :D](./images/smilies/ag.gif)
![Thumbs Up :thumbup:](./images/smilies/ay.gif)
Tweaking the acceleration formula and skin variables should get you closer to the animation effect you are looking for...
I'll probably play with those to see if a better response can be achieved, but you have it working pretty well.
![Great :great:](./images/smilies/dn.gif)
:: My DA Gallery :: Rainmeter DA Gallery :: Rainmeter Workshops :: Rainmeter Documentation :: BBCode Guide ::
-
- Posts: 217
- Joined: May 16th, 2012, 5:38 am
Re: Peak on a ballistic trajectory sticks at the top of the meter
I made some changes to the formula to give it more of the effect that I wanted, especially where it was getting pinned at the top it behaves more realistically now. Let me know what you think. The meter on the left is the new one, meter on the right is the original
You do not have the required permissions to view the files attached to this post.
moshi wrote:there are many Rainmeter skins that aren't really useful, so let's add another one.
jsmorley wrote:I have good news and bad news.
First the bad news. [...] We would be happy to have this happen and would love to work with anyone who is feeling ambitious.
Now the good news.
I lied, there isn't any good news...
-
- Rainmeter Sage
- Posts: 5495
- Joined: April 12th, 2012, 9:40 pm
- Location: Cedar Point, Ohio, USA
Re: Peak on a ballistic trajectory sticks at the top of the meter
The left looks a bit more responsive.Bekarfel wrote: ↑March 3rd, 2023, 1:45 am I made some changes to the formula to give it more of the effect that I wanted, especially where it was getting pinned at the top it behaves more realistically now. Let me know what you think. The meter on the left is the new one, meter on the right is the original {clip Image}
![Great :great:](./images/smilies/dn.gif)
![Whistle :Whistle](./images/smilies/whistling.gif)
:: My DA Gallery :: Rainmeter DA Gallery :: Rainmeter Workshops :: Rainmeter Documentation :: BBCode Guide ::
-
- Posts: 217
- Joined: May 16th, 2012, 5:38 am
Re: Peak on a ballistic trajectory sticks at the top of the meter
Well, ya see, the first thing I did was to hard lock Rainmeter, as is tradition.
Next I remembered, aha! parentheses! and rewrote the -MeasureL_Accel * 0.75 which crashes Rainmeter as (0 - MeasureL_Accel) * 0.75. This went into the sections that define the peak range limits: where 1.0 <= MeasureL_Peak, and where MeasureL_Peak <= MeasureL.
Formula = (1.0 <= MeasureL_Peak ? (0 - MeasureL_Accel) * 0.75 : (MeasureL >= MeasureL_Peak + ( MeasureL >= MeasureL_Peak ? MeasureL - MeasureL_Peak : MeasureL_Accel - #Gravity# ) ? Max(MeasureL - MeasureL_Peak,(0 - MeasureL_Accel) * 0.75) : MeasureL_Accel - #Gravity#))
![Bow :bow:](./images/smilies/Dziekuje.gif)
Formula = (1.0 <= MeasureL_Peak ? (0 - MeasureL_Accel) * 0.75 : (MeasureL >= MeasureL_Peak + ( MeasureL >= MeasureL_Peak ? MeasureL - MeasureL_Peak : MeasureL_Accel - #Gravity# ) ? Max(MeasureL - MeasureL_Peak,(0 - MeasureL_Accel) * 0.75) : MeasureL_Accel - #Gravity#))
moshi wrote:there are many Rainmeter skins that aren't really useful, so let's add another one.
jsmorley wrote:I have good news and bad news.
First the bad news. [...] We would be happy to have this happen and would love to work with anyone who is feeling ambitious.
Now the good news.
I lied, there isn't any good news...
-
- Rainmeter Sage
- Posts: 5495
- Joined: April 12th, 2012, 9:40 pm
- Location: Cedar Point, Ohio, USA