Move a source forward -3 cells- on the next beat

148 views
Skip to first unread message

Mathieu

unread,
Mar 9, 2013, 10:26:02 AM3/9/13
to ligh...@googlegroups.com
Now that you know how to make a source moves forward on each beat, what if instead of moving one cell at a time, you want it to moves 3 cells at a time?

The formula is:

xtopercent(3 * counter(0, grid.lastx / 3, onbeat(midi.note(1,41))))

The counter counts from 0 to the number of cells divided by 3 (grid.lastx / 3). Then we multiply the counter result by 3 so that each time the counter is incremented by one, the x position is incremented by 3. If you want the source to move 2 cells at a time, the formula becomes:

xtopercent(2 * counter(0, grid.lastx / 2, onbeat(midi.note(1,41))))

A bonus trick: if you want the source to slide instead of jump, you just add a fade in function:

fadein.linear(0.5, xtopercent(3 * counter(0, grid.lastx / 3, onbeat(midi.note(1,41)))))

If you add a fade out function, then the source will slide from the last grid's cell to the first when the counter wraps.

Cheers!
Reply all
Reply to author
Forward
0 new messages