Oleg,
Thank you so much for this in depth solution and explanation, I’ve learned a lot this afternoon from what you’ve provided! And yes, it works immaculately! I didn’t know about Math.max, that’s a great little tool for niche applications like this…
So the last thing I’m trying to accomplish is a slider that takes and holds the Boom value upon delta until the next delta. I have it working except for the hold; it doesn’t seem to want to reference it’s own value from (-1) frames ago. I have this on a slider called CurrentBoom:
boom = effect(“Boom”)(“Slider”);
dcBoom = effect(“DC Boom”)(“Slider”);
thisSlider = effect(“CurrentBoom”)(“Slider”);//Self-referential.
if(dcBoom.valueAtTime(time) > dcBoom.valueAtTime(time-framesToTime(1))){//Check to see if dcBoom just went up to 1.
boom//Make this slider the boom value.
}else{//Otherwise…
thisSlider.valueAtTime(time-framesToTime(1))//Make this slider the value it was last frame.
};
So I get the boom value on delta, but then then it goes to zero the next frame until the next delta. Are these types of self-referential calls possible?
Thanks again so much for your help! Already you’ve gotten my head spinning with nerdy options I didn’t know I had….. :O
boom = effect("Boom")("Slider");
dcBoom = effect("DC Boom")("Slider");
thisSlider = effect("CurrentBoom")("Slider");//Self-referential.
if(dcBoom.valueAtTime(time) > dcBoom.valueAtTime(time-framesToTime(1))){//Check to see if dcBoom just went up to 1.
boom//Make this slider the boom value.
}else{//Otherwise...
thisSlider.valueAtTime(time-framesToTime(1))//Make this slider the value it was last frame.
};