-
Triggering Animation with SoundKeys
There’s probably info out there on this, but I’m too stressed to find it!!
The idea is to trigger timeRemap when a certain threshold is passed.
I figure I could use Dan Ebberts “Triggering Expression With Audio” or Beat Counter; Say that layer 5 plays once the Threshold has been passed the 5th time…
Tried that but the layer gets animated every time the threshold is passed..
I just want it to be played once and then animate on various layers..
See if I can get my head around the beatcounter and mix the two ideas together!!
But this.. is above my current skillset ..Thankful for any replies!!
threshold = 20.0;
audioLev = thisComp.layer(“soundKeys Average”).effect(“Sound Keys”)(“Output 1”);
above = false;
frame = Math.round(time / thisComp.frameDuration);
while (true){
t = frame * thisComp.frameDuration;
if (above){
if (audioLev.valueAtTime(t) < threshold){
frame++;
break;
}
}else if (audioLev.valueAtTime(t) >= threshold){
above = true;
}
if (frame == 0){
break;
}
frame–
}
if (! above){
t = 0;
}else{
t = time – frame * thisComp.frameDuration;
}value + t