expanding the MLR scene to 4 rows… we can re-use the above but need to make some modifications. first, we need 4 rows of buttons instead of 1. just change the last number in G.BTX from 1 to 4:
G.BTX 0 0 0 1 1 0 0 2 16 4
script 1 will now use a loop:
L 0 3: A I; SCRIPT 3
and the actual work to advance a step will happen in script 3:
G.REC 0 A 16 1 0 0
PN 0 A % + 1 PN 0 A 16
G.LED PN 0 A A 15
a couple of changes here - instead of clearing all LEDs with G.CLR we just clear the row A, and we replace P 0 0 with P 0 A so that we update the playhead that corresponds to A as we now have 4 of them.
script 2 also needs to be updated to:
Y / G.BTNI 16; X % G.BTNI 16
IF G.BTNV: PN 0 Y % + X 15 16
we determine the position of the last pressed button (X and Y) based on the button id - when you create a group of buttons they are arranged row by row (i’m planning to add dedicated ops to get position for specified button which will simplify this kind of thing). then we update the position for playhead Y to position previous to X.
now you should have 4 rows with individual position, all advancing by one step whenever trigger 1 is received. one thing we could add is have a clock divider per row. let’s store them in pattern bank 1, and use bank 2 for counters. add to I script:
L 0 3: PN 1 I 1
that sets the initial dividers to 1. change script 3 to:
PN 2 A + 1 PN 2 A
IF LT PN 2 A PN 1 A: BREAK
PN 2 A 0; G.REC 0 A 16 1 0 0
CV + 1 A N PN 9 A
PN 0 A % + 1 PN 0 A 16
G.LED PN 0 A A 15
this will increment the counter, and only advance once it reaches our divider value. could also use EVERY instead but then you’d have less control over reset.
and, of course, we might as well use the grid to control the dividers! and the 4 bottom rows are free… add to I:
G.FDX 0 0 4 16 1 0 0 4 1 4
and set script 4 to:
I % PN 2 G.FDRI + 1 G.FDRN
PN 2 G.FDRI I
PN 1 G.FDRI + 1 G.FDRN
now the 4 bottom rows will have faders that will set the corresponding track divider to 1…16. finally, a reset would be handy. we could use trigger 8 for that:
L 0 3: PN 0 I 15
that’s it!
edit: fixed errors