-
Randomize, hold value, then randomize again
I’m working on a project in which most of the expressions in my comp refer back to amplitude keyframes from Sound Keys. (intense bass shakes the screen, a snare drum creates a flash, etc) At one point, I need the tint to change to a random value each time a chord is struck, and remain the same color for the duration of the chord. Each chord is held about 3 seconds.
I have tried writing expressions using seedRandom() that quickly cycle through a bunch of random tints while the chord is silent, and then stops on one random tint while the chord sounds, before returning to a rapid random cycle after the chord decays. I haven’t been able to get that to work without using while() statements, but the duration of the comp is long enough so that while() statements aren’t an option because they bog down the render speed or crash AE.
Any help pointing me in the right direction would be greatly appreciated. I’m still pretty new to expressions, so pardon me if I’m overlooking a very simple solution.
Thanks!