Hello,
I am trying to make the static waveform that is used on Soundcloud in After Effects at the moment and I have run into an error. I was hoping you all would be able to help me debug (with my limited programming knowledge). I used a method from a website, which can be found here: CreativeCOW
(There is a syntax error which he points out later in the thread which I have fixed)
Here is the code that is causing troubles if you don't want to read the forum page:
lines = 100;
maxAmp = 18;
target = thisComp.layer("Audio Amplitude");
amp = target.effect("Both Channels")("Slider");
smpl = amp.numKeys / lines;
smplT = framesToTime((index - target.index) * smpl - (smpl / 2));
avg = amp.smooth(framesToTime(smpl)/2, smpl, smplT)
s = Math.min(100,linear(avg,0,maxAmp,0,100));
[100,s]
I get the error: "Bad method arguments: numSamples argument to smooth must be between 1 and 100 inclusive" Error at line 7.
Also, how do I find the maxAmplitude using "Both Channels" in the keyframe?
Any help is greatly appreciated! Let me know if you need any more info.