Previous topicNext topic

"Pausing" rotation during a song

Questions, comments, feedback, etc.
Post Reply
khilts
Posts: 2
Joined: Wed Jun 02, 2021 7:13 pm

"Pausing" rotation during a song

Post by khilts »

Hi all, first post. I have gone through the tutorials and searched the forums, but couldn't find the easy answer I must be missing...

I'm using a slow-speed Sine Osc modifier on a RotateAxis block to get smooth rotation, but I'd like to pause (not reset to zero) the rotation during certain parts of a song and then resume the rotation.

I've figured out how to use Internals | Playback Time and a switch statement to return a certain value depending on the point in time
(conditionals are in seconds and the return value could indicate '1' for rotate and '0' for pause rotation):

*** EXAMPLE ***
switch
{
case (x > 35) and (x < 68) : 1;
case (x > 101) and (x < 134) : 1;
case (x > 168) : 1;
default : 0;
}
*** end EXAMPLE ***

How can I use that return value to pause rotation? Using 'Bypass' on the RotateAxis block would force a discontinuous '0' rotation when the block is bypassed.

Thanks in advance for any help,
khilts
Sadler
Posts: 1139
Joined: Sat Aug 02, 2014 7:10 pm
Location: London, UK

Re: "Pausing" rotation during a song

Post by Sadler »

After your expression use a Ramp modifier set to 0. The output of your switch then becomes the rotation speed. It is quite satisfying to use a dollop of smoothing after the expression to give a soft start to the rotation.
khilts
Posts: 2
Joined: Wed Jun 02, 2021 7:13 pm

Re: "Pausing" rotation during a song

Post by khilts »

Thanks for the reply, Sadler. I did eventually come up with a similar (but more clunky) solution:
a global named OscSpeed with the switch statement originally mentioned,
and a global named OscGlobal that defines the osc type (sine osc in my case), uses OscSpeed and an average function for smoothing the rotation speed change.
RotateAxis in my main process then refers to OscGlobal.
Post Reply