It is currently December 12th, 2018, 4:05 am

AudioLevel

Share your custom plugins and applications to enhance Rainmeter.
rxtd
Posts: 65
Joined: April 30th, 2017, 11:51 am

Re: AudioLevel

rxtd » November 20th, 2018, 3:02 am

What "Attack" and "Decay" options actually mean?
I created skin that shows peak, rms and fft (for one band at certain frequency) values in a Line meter.
I tested it with tone generator, using sin wave. Here is the picture that I got:
2018-11-20_08-59-40+.png
Cyan line is fft, yellow is rms, and green is peak.
All attack/decay options are set to 500, peak and rms gains are adjusted so that rms and peak match fft after all three are stabilized.
Skin updates every 17 ms, so 500 ms should roughly match 30 pixels of image. Red lines show two intervals of 30 pixels.

Since the sound produced by my computer can be described as "silence, sine wave, silence", all three studied values should be "zero, maximum, zero" (without filtering). If I set all attack/decay options to 1, I see exactly that.
What I expected to get:
• Lines for all values roughly match.
• Transition from zero to max and back is either linear or forms exponential growth.
• All transitions take 500 ms.
What I actually got (shown in the picture above):
• Lines have quite different values during the transition.
• Rms and peak grow exponentially (with different constants though), but fft is exponential in the attack time and is linear in the decay time.
• Attack time is roughly 500 ms, but decay time is not only longer than 500 ms, but also is different for rms, peak and fft.

Soooo. Is it normal? And if it is, then how do I interpret attack and decay time for this plugin?
I have already looked into source code of the plugin in the Rainmeter github, and I don't understand why there is a difference. Well, rms is filtered in square form, and then rooted, this can explain the difference between rms and peak. But why are peak and fft values differ? Why attack and decay times differ? Why is fft linear in the decay time?!

Code of my test skin:

Code: Select all

[Metadata]
Author=rxtd
Name=test
License=Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International

[Rainmeter]
AccurateText=1
Update=17

[Measure001_Parent]
Measure=Plugin
RMSAttack=500
RMSDecay=500
PeakAttack=500
PeakDecay=500
FFTAttack=500
FFTDecay=500
RMSGain=6.1
PeakGain=6.8
Bands=1
FreqMin=990
FreqMax=1010
FFTSize=4096
Plugin=AudioLevel

[Measure002_rms]
Measure=Plugin
Parent=Measure001_Parent
Channel=FL
Type=RMS
Plugin=AudioLevel

[Measure003_peak]
Measure=Plugin
Parent=Measure001_Parent
Channel=FL
Type=Peak
Plugin=AudioLevel

[Measure004_band]
Measure=Plugin
Parent=Measure001_Parent
Channel=FL
Type=Band
Plugin=AudioLevel

[Meter001_background]
Meter=Shape
UpdateDivider=-1
Shape=Rectangle 0.0,0.0,600.0,100.0,|Fill Color 100,100,100,255|StrokeWidth 0
Shape2=Rectangle 0.0,0.0,600.0,100.0,|Fill Color 255,255,255,180|StrokeWidth 0
Shape3=Combine Shape|Exclude Shape2
Shape4=Combine Shape2

[Meter000]
Meter=Line
AntiAlias=1
MeasureName=Measure002_rms
LineColor=255,255,0,255
LineCount=3
MeasureName2=Measure003_peak
LineColor2=0,255,0,255
MeasureName3=Measure004_band
LineColor3=0,255,255,255
SolidColor=0,0,0,255
X=0
Y=0
W=600
H=100

You do not have the required permissions to view the files attached to this post.