ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Trigger sound effects

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Marcelo Cabral
Trigger sound effects
on Oct 3, 2017 at 3:15:45 pm

Hi. I found an expression in one of the Dan posts and it works perfectly if I use the sound layer marks. But I don't know how to make it work with the "PLAY" layer marks.




Thank you in advance.

len = thisLayer.source.duration;
if(marker.numKeys > 0){
m = marker.nearestKey(time).index;
if(marker.key(m).time > time) m--;
if(m > 0){
mt = marker.key(m).time;
if(time &lt; mt+len){
linear(time, mt, mt+len, 0, len);
}else 0
}else 0
} else value;


Return to posts index

Dan Ebberts
Re: Trigger sound effects
on Oct 3, 2017 at 4:36:12 pm

This should work:


len = thisLayer.source.duration;
m = thisComp.layer("PLAY").marker;
val = value;
if(m.numKeys > 0){
val = 0;
n = m.nearestKey(time).index;
if(m.key(n).time > time) n--;
if(n > 0){
mt = m.key(n).time;
if(time < mt+len){
val = linear(time, mt, mt+len, 0, len);
}
}
}
val



Dan



Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]