Page 1 of 1

video "scratching" effect

Posted: August 6th, 2005, 5:31 am
by trioptic
I realize this is so incredibly simple, but it works well, with many diff techniques:

Code: Select all

maxAmp = 30;
minAmp = 1;
spanAmp = maxAmp - minAmp;
incAmp = sqrt(spanAmp);

if(varAmp < spanAmp/2){
  (varAmp / incAmp) - incAmp;
} else {
  (varAmp / incAmp) + incAmp;
}
basically maxAmp is the highest amplitude you want the code to react to. anything higher than maxAmp will be treated the same as maxAmp. varAmp (which is not assigned by the code) is your INPUT. so that would be audio1.level or whatever.

inAmp divides everything up evenly, so in case your amp is higher than 30, the code will adjust accordingly.

put this code in your time-remap layer. (some playing with would probably be required for a special look).

.. more comin soon

AF rejects expression

Posted: February 3rd, 2007, 11:41 am
by afaj
When trying to use this expression text I get the message:

"Function sqrt is undefined. Expression disabled."

Any ideas? Thanks.

Posted: February 3rd, 2007, 1:56 pm
by Colin Braley
Try this instead:

Code: Select all

maxAmp = 30;
minAmp = 1;
spanAmp = maxAmp - minAmp;
incAmp = Math.sqrt(spanAmp);

if(varAmp < spanAmp/2){
  (varAmp / incAmp) - incAmp;
} else {
  (varAmp / incAmp) + incAmp;
}

Posted: February 3rd, 2007, 2:15 pm
by afaj
Colin,

This time I get the error message: "Class 'Layer has no property or method named 'varAmp'. (error occured at line six).