Advertisement
theAlexus

Untitled

Dec 6th, 2016
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. threshold = 20;
  2. footageComp = comp("FOOTAGES");
  3. audioLev = thisComp.layer("Audio Amplitude").effect("Both Channels")("Slider");
  4. above = null;
  5.  
  6. for(var t=0;
  7. t<=time;
  8. t+=thisComp.frameDuration)
  9. if(audioLev.valueAtTime(t)>threshold)
  10. {
  11.     above = t;
  12.     t+= 4;
  13. }
  14.  
  15. seedRandom(timeToFrames(above),true);
  16.  
  17. n = random(1,footageComp.numLayers+1);
  18. playStartTime = footageComp.layer(n).inPoint;
  19. playEndTime =  footageComp.layer(n).outPoint-thisComp.frameDuration;
  20. playDuration = playEndTime - playStartTime;
  21.  
  22. if(above)
  23.     linear(time, above, above+playDuration, playStartTime, playEndTime);
  24. else
  25.     0;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement