how to adjust 'to range' of mathCHOP based on keyframe index

This is a fairly simple problem I’m sure, but I can’t figure out exactly what it is I need.

I’m driving the speed of a movieinTOP with the audio spectrum of a sound file. I want to be able to control the range of the speed with a slider or expression or curve or even the keyframe index.

So far this is what I have driving the moviefilein speed: audiofileinCHOP>audiospectrumCHOP > selectCHOP:chan1 > analyzeCHOP > mathCHOP:from range 0 to 0.01:to range 0 to 1 > null

Pretty standard.
Ideally I would be able to adjust the bottom of the MathCHOP “to range” value and take it into the negatives the further along the movie plays. This would change the effect the silences have on the speed from no speed to negative speed (reverse), which is what I’m after.

I should also add that the audio file I’m using has sporadic gaps of silence in the beginning which is why I’d like to vary the back-and-forth speed effect based on the keyframe index.

I’d be very grateful for any suggestions or clues on how to achieve this. Thank you!

1 Like

You can use an info CHOP to extract the fractional position of the movie file - you might invert this range then do some other math to the value before exporting it to your math CHOP. I think this will get you close to what you’re after.

base_math.tox (710 Bytes)

raganmd thank you for the reply! I used your example and yielded some interesting results. I ended up using the length parameter of the movieinTOP and multiplying that with the output of the audiofilespectrum which I remapped between 0 and 1. I changed the moviein playmode from ‘sequential’ to ‘specify index’ and used the output from the multiplication as the specific index, which gave me the result I was looking for. This way the movie always returns to frame one.