Skip to main content
Participant
October 13, 2023
Answered

Replicating a VU Meter with analog decay

  • October 13, 2023
  • 2 replies
  • 677 views

Dear Community,

 

I'm trying to replicate an analog VU-meter in After effects by using expressions.
( example : https://www.youtube.com/watch?v=hDRQsyd9_K8 )

So far I archieved to create an audioreactive peakmeter by using the waveform keyframe values to model the peaks. After the value is reached the peakmeter immediately drops to the next keyframe value. In analog systems there is usually a decay time of 300ms (see here https://www.youtube.com/watch?v=qDElTDFHVYw)

Any tips how to include the decay time into the rotation property of my animated needle?

Thanks in advance.
 

This topic has been closed for replies.
Correct answer Dan Ebberts

Probably something like this:

decay = .3; // 300 ms
a = thisComp.layer("Audio Amplitude").effect("Both Channels")("Slider");
maxVal = a.value;
t = thisComp.frameDuration;
while (t < decay){
	temp = a.valueAtTime(time - t);
	maxVal = Math.max(maxVal, easeOut(t,0,decay,temp,0));
	t += thisComp.frameDuration;
}
maxVal

2 replies

Dan Ebberts
Community Expert
Dan EbbertsCommunity ExpertCorrect answer
Community Expert
October 13, 2023

Probably something like this:

decay = .3; // 300 ms
a = thisComp.layer("Audio Amplitude").effect("Both Channels")("Slider");
maxVal = a.value;
t = thisComp.frameDuration;
while (t < decay){
	temp = a.valueAtTime(time - t);
	maxVal = Math.max(maxVal, easeOut(t,0,decay,temp,0));
	t += thisComp.frameDuration;
}
maxVal
Participant
October 16, 2023

Thank you for your help. Worked out pretty well. 

Mylenium
Legend
October 13, 2023

https://www.motionscript.com/articles/bounce-and-overshoot.html

 

https://www.motionscript.com/design-guide/audio-trigger.html

 

Check these for inspiration and explanations, then create your own modified code as needed.

 

Mylenium