Hi Choudry,
you can place my expressions on a different layer as well, that doesn’t really matter, just need to change some of the references.
Raising the Audio amplitude to a power remains the best option to increase the effect the audio modulation has, just multiplying or adding a value to it doesn’t really work IMO.
If you don’t use the sum of all audio amplitudes in calculate the modulation, then you’ll always run into some trouble, either too much or not all of the video’s running time will be used in the final result. So are you just going to ask the user of your templates to experiment with a scaling slider until the video doesn’t run out ?
If you want the only user interaction to be that they manually have to create the Audio Amplitude layer (no way around that I guess, or you could bundle a script with the template maybe ?), then I propose this:
A second null layer with:
A slider to control the depth/punch of the audio (this would be the power the audio gets raised to) -> this is the only thing that needs to be visible for user interaction
(so these next controls that are just there for calculation can be on a shy layer:)
A Point Control (Power value) that “copies” the values of the audio amplitudes and adds a power function. (Point Control values don’t get clipped to 1,000,000.0 !)
a=thisComp.layer("Audio Amplitude").effect("Left Channel")("Slider");
p=effect("Power")("Slider");
if (p<0) p=0;
[Math.pow(a,p),0]
A last point control that calculates the running sum of the audio amplitudes, using the posterizeTime(0) trick so it only needs to calculate once, not every frame:
posterizeTime(0);
total=0
for (t=0; t<thiscomp.duration; t+="thisComp.frameDuration)" {<br=""> total+=effect("Power value")("Point").valueAtTime(t)[0]
}
[total,0]</thiscomp.duration;>
Finally, the actual expression for timeremapping stays the same as before (once you change the references to the new positions of the data, don’t forget we only need [0] of the point controls values)