Step sequencer formulas

154 views
Skip to first unread message

Trym

unread,
Oct 29, 2020, 4:33:47 PM10/29/20
to Lightjams

So I am using this formula for my step sequencer to trigger other effect grids:
xtopercent(counter(0, grid.lastx, onbeat(music.2.low.beat)))
The problem is that LightJams quite often double-trigger the beats, especially if there is songs without clearly defined low-end beats.
Is there any way to implement time() or trigger() or something to get the formula above to ONLY trigger after a delay of 0,5seconds after the last time it triggered? (Then it will work for music of 120bpm or above!)

I am also looking to create a step sequencer with a random jump.
I tried using the rand(0, onbeat(music.2.low.beat)) with only partial success, since it then generates random pulses on beat, but goes straight back to 0 again. I need it to hold the value until the next beat.

Mathieu

unread,
Oct 29, 2020, 8:35:16 PM10/29/20
to Lightjams
Hi,

The trigger function is what you need! The formula should look like:

xtopercent(counter(0,grid.lastx,onbeat(trigger(music.2.low.beat,0.1,10,30,0.2))))

With the trigger function, you can precisely control when it fires and then fires again. The 0.2 value is the time in seconds between the retrigger. You can use it with the onbeat function to make sure the source will move forward only once per trigger.

For a way to randomly jump, here's a formula:

xtopercent(latch(onbeat(trigger(music.2.low.beat,0.1,10,30,0.2)), rand(0,grid.lastx)))

The latch function is used to remember the last randomly picked position. When there's a beat, the latch function is updated with a random value.

Another nice one is:

if(onbeat(trigger(music.2.low.beat,0.1,10,30,0.2)), xtopercent(randint(0,grid.lastx)), last)

It's even more interesting since the randInt function picks a new value each time (making sure it's different than the last time), so the source will actually move at each beat. This only works since we're using the if function which evaluates either the true or false parameter based on the condition. This way, the randInt function is only called when there's a beat and then we can be sure to get a different value than the previous beat.

Reply all
Reply to author
Forward
0 new messages