Move a source forward on the next beat (or 2, 3, 4...)

296 views
Skip to first unread message

Mathieu

unread,
Mar 8, 2013, 10:37:26 AM3/8/13
to ligh...@googlegroups.com
Let's say you're using a source to activate scenes (or cues). Each time the source moves forward, it activates another scene. How can you make it go forward each 4 beats? 

The super formula to put in the source's X slider is:

xtopercent(counter(0, grid.lastx, onbeat(trigger(music.1.low.beat, 0.07, 10, 15, 0.15), 4)))

Some explanations.

trigger(music.1.low.beat, 0.07, 10, 15, 0.15): this is the automatically generated formula when tracking beats on the low music frequencies. You can replace this by any input you want like a MIDI note or a OSC value, a DMX value...

onbeat(..., 4): this is where we specify a beat multiple, in this case 4. This means "pulse on each 4th beat".

counter(0, grid.lastx, ...): a counter that will go from 0 to the last cell index. It is incremented when the onbeat function pulses.

xtopercent(...): the counter returns the position from 0 to the last cell index, but since we're controlling the X slider, we need to return a percent value. So the xToPercent function just converts the x position to a percent value for us. It's a shortcut to avoid writing "counter(...) / grid.lastX * 100" 

And in case you're wondering about the grid.lastX variable and why to use it instead of just putting the number (for example 10 if your grid has a width of 10), it's just to avoid needing to change anything when you resize your grid or want to use the same formula in multiple grids. 

Cheers!
Reply all
Reply to author
Forward
0 new messages