-
Notifications
You must be signed in to change notification settings - Fork 0
/
sequencer_megababy_nandy_mod
4469 lines (4173 loc) · 153 KB
/
sequencer_megababy_nandy_mod
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/* Quick Guide
If you want drum maps for Battery 3 or Battery 4, they are included here:
http://stash.reaper.fm/v/18598/sequencer_baby_v2_jnif.zip
- Right click/drag: Audition existing note or empty location.
Sets velocity for new notes if existing note is auditioned.
- Left click/drag: Freehand draw or erase notes in piano mode.
- Left click/drag: Draw or erase notes on the same row in drum mode.
- Shift + Ctrl + Alt + Left click/drag: Freehand draw or erase notes in drum mode.
- Ctrl + Left click/drag: Edit velocity of notes.
Drag over multiple notes on the same row to create velocity curves.
- Ctrl + Alt + Left click/drag: Adjust velocity of all notes on the same row.
- Shift + Left click/drag left/right: Adjust note start offset.
- Shift + Alt + Left click/drag: Adjust note start offset of all notes on the same row.
- Alt + Left click: Tie/untie notes.
- Alt + Left drag: Tie/untie multiple notes in a row.
- Shift + Right click drag up/down: Subdivide note.
- Left click drag up/down note names in Drum map mode: Transpose note row.
- Left click drag up/down MIDI channel number in Drum map mode: Change MIDI channel of note row.
- Shift + Left click piano keys / note names: Duplicate sequence. Sequence length is doubled.
- Ctrl + Left click piano keys / note names: Halve steps per beat, slow down
- Ctrl + Right click piano keys / note names: Double steps per beat, speed up
- Ctrl + Alt + Left click piano keys / note names: Halve steps per beat, preserve note positions. Sequence length is halved.
- Ctrl + Alt + Right click piano keys / note names: Double steps per beat, preserve note positions. Sequence length is doubled.
- Left click drag green area on toolbar pianokeys: Change base note of the grid.
- Right click drag green area on toolbar pianokeys: Change number of notes in the grid.
- Left click drag red area on toolbar pianokeys: Change MIDI trigger notes for pattern triggering.
- Left click pattern button: Change pattern.
- Ctrl + Left click pattern button: Copy the active pattern to clicked pattern and change to the clicked pattern.
- Ctrl + Right click pattern button: Clear pattern.
- Alt + Left click pattern button: Set pattern chain end (Alt + Left Click Pattern 1/Last Pattern to clear)
- Left click Mode button (PR=Piano Roll, DM=Drum Map): Change mode.
- Left click "Play before start" button: Enable/Disable playback before start beat position.
">|>" = play everywhere
" |>" = play only after start beat position
- Left click "Start beat position" value: Set start beat position to current play cursor position.
- Left click "End beat position" value: Set end beat position to current play cursor position. "---" = play infinitely.
- Right click "Start beat position" value: Set start beat position to default value, "0.000".
- Right click "End beat position" value: Set end beat position to default value, "---".
- Left click/drag "Note length" slider: Set/adjust note length for all notes. 100% equals full step length.
- Left click/drag Swing slider: Set/adjust swing.
- Right Click sliders to step through common values.
- Left/Right Click color scheme name to change colors.
- Left/Right Click midi mode to change.
- Move function:
- Left / Right Click Move Button - Move Left / Right .
- Add SHIFT - Move Up, Down.
- Add CTRL for single step per click.
- Add ALT to Left / Right move to lock CC's.
- Left click/drag on envelope lane: Draw/adjust envelope of the active envelope type.
- Right click/drag on envelope lane: Erase envelope of the active envelope type.
- Left click drag up/down envelope MIDI channel (in Drum map mode): Change MIDI channel of envelope.
- Left click drag up/down envelope type names/numbers: Change envelope type.
Types:
MIDI CC 0-127.
On first envelope (the blue one) type 127 has a special meaning.
It controls probability of note playback on each sequence step.
Only notes on same channel as the envelope will be affected.
Under 'settings' dropdown you can select 96 pattern, 64 step mode or 48 pattern, 128 step mode. THIS CLEARS ALL CURRENT PATTERNS. Save First if you have done any work!
*/
desc:sequencer megababy - awesome sequencer v3/jnif - nandy's mod
slider1:0<0,95,1{1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96}>--Pattern
slider2:36<0,127,1>--Note start
slider3:16<1,128,1>--Sequence length
slider4:25<1,49,1>--Number of notes
slider5:1<0.125,4.0,.125>--Rate
slider6:100<1,100,1>--Note length
slider7:0<0,1,1{Piano roll,Drum map}>--Mode
slider8:0<0,100,1>--Swing
slider9:4<1,16,1>--Steps per beat
slider10:0<0,6,1{Midi Off,Pattern Change,Pattern Change + Transpose,Pattern Change + Resync,Pattern change + Transpose + Resync,Pattern Change + Resync Quantized,Pattern Change + Transpose + Resync Quantized)}>--MIDI Trigger
slider11:96<0,127,1>--Trigger note start
slider12:0<0,23,1{off,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23}>--Chain
slider13:0.15<0.0,1.0,0.001>--Lane height percent
slider14:0<0,3,1>--CC to adjust (active for editing)
slider15:/seqbaby_data:_Default Kit.txt:Drum Map note names
slider20:1<0,127,1>--Controller0 type
slider21:7<0,127,1>--Controller1 type
slider22:10<0,127,1>--Controller2 type
slider23:11<0,127,1>--Controller3 type
slider30:0<0,15,0>--Controller0 channel
slider31:0<0,15,0>--Controller1 channel
slider32:0<0,15,0>--Controller2 channel
slider33:0<0,15,0>--Controller3 channel
slider40:0<-99,9999,1>--Start beat position
slider41:1<0,1,1>--Play before start
slider42:-99<-99,9999,1>--End beat position
slider43:5<1,9,1>--Colorscheme
slider44:0<0,1,1>--PatShift
slider45:0<0,1,1>--PatternMode
slider46:0<0,1,1>--XtraPatts
slider47:48<48,96,48>--NumberOfPatts
in_pin:none
out_pin:none
@init
//////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////
octave_offset=-1; // Set this value as you prefer.
// It works the same way as "MIDI octave name display offset" in Reaper's preferences
// 1 : MIDI note 60 = C5
// 0 : MIDI note 60 = C4
// -1 : MIDI note 60 = C3 ...
//////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////
function setcolor(r,g,b,a) (gfx_r=r/255; gfx_g=g/255; gfx_b=b/255; gfx_a=a/255;);
function color(n) (
n == 4 ? (setcolor(255,255,255,255);); // button txt white
n == 7 ? (setcolor(0,0,0,255);); // black
n == 8 ? (setcolor(41,41,41,255);); // drum mode white key background
n == 11 ? (setcolor(255,0,0,205);); // dm midi xpose, red
n == 12 ? (setcolor(63,127,63,255);); // green keyzone 1
n == 13 ? (setcolor(127,63,63,255);); // red keyzone 1
n == 14 ? (setcolor(127,255,127,255);); // green keyzone 2
n == 15 ? (setcolor(255,127,127,255);); // red keyzone 2
colorscheme <5 ? (
n == 1 ? (setcolor(179,179,179,255);); // button bg colour
n == 2 ? (setcolor(51,102,255,102);); // button hilite
n == 3 ? (setcolor(153,229,153,255);); // button chain ptn
n == 5 ? (setcolor(77,77,77,255);); // button txt pttn used
n == 6 ? (setcolor(141,141,141,255);); // button txt pttn empty
n == 9 ? (setcolor(255,255,255,153);); // dm midi ch num txt, see thru white
n == 10 ? (setcolor(0,0,127,255);); // dm midi ch num bg, blue
n == 16 ? (setcolor(0,0,0,180);); // see thru black
n == 17 ? (setcolor(255,0,0,120);); // see thru red
n == 18 ? (setcolor(41,61,104,255);); // octave line
n == 19 ? (setcolor(51,76,127,255);); // barline
n == 22 ? (setcolor(204,204,204,255);); // time position selected
n == 23 ? (setcolor(102,102,102,255);); // time position not sel
n == 26 ? (setcolor(127,127,127,255);); // text for vel/shift - light
n == 31 ? (setcolor(0,0,0,255);); // BG
n == 32 ? (setcolor(154,154,174,255);); // Divider Top
n == 33 ? (setcolor(129,129,149,255);); // Divider Center
n == 34 ? (setcolor(77,77,97,255);); // Divider Bottom (hehe...bottom...! :)
n == 35 ? (setcolor(255,255,255,255);); // Env Label
n == 36 ? (setcolor(255,255,255,153);); // velobar, see thru white
n == 37 ? (setcolor(77,77,77,255);); // button txt labels dark
n == 38 ? (setcolor(220,220,220,255);); // button txt labels light
colorscheme <3 ? (
colorscheme == 1 ? (
colorschemename="Original";
n == 27 ? (setcolor(51,76,255,255);); // Env 1
n == 28 ? (setcolor(51,152,51,255);); // Env 2
n == 29 ? (setcolor(255,127,0,255);); // Env 3
n == 30 ? (setcolor(152,51,152,255);); // Env 4
);
colorscheme == 2 ? (
colorschemename="Redshift";
n == 20 ? (setcolor(152,51,51,255);); // selected first beat
n == 21 ? (setcolor(51,51,152,255);); // selected other beats
n == 24 ? (setcolor(84,28,28,255);); // grid squares fist beat
n == 25 ? (setcolor(28,28,84,255);); // grid squares other beats
n == 27 || n == 29 ? (setcolor(162,28,28,255);); // Env 1,3
n == 28 || n == 30? (setcolor(28,28,162,255);); // Env 2,4
);
);
colorscheme == 3 ? (
colorschemename="Half Life";
n == 20 ? (setcolor(152,51,152,255);); // selected first beat
n == 21 ? (setcolor(51,152,152,255);); // selected other beats
n == 24 ? (setcolor(84,28,84,255);); // grid squares fist beat
n == 25 ? (setcolor(28,84,84,255);); // grid squares other beats
n == 27 || n == 29 ? (setcolor(162,28,162,255);); // Env 1,3
n == 28 || n == 30? (setcolor(28,162,162,255);); // Env 2,4
);
colorscheme == 4 ? (
colorschemename="Dark Daze";
n == 20 ? (setcolor(51,51,102,255);); // selected first beat
n == 21 ? (setcolor(51,102,51,255);); // selected other beats
n == 24 ? (setcolor(28,28,56,255);); // grid squares fist beat
n == 25 ? (setcolor(28,56,28,255);); // grid squares other beats
n == 27 || n == 29 ? (setcolor(28,28,162,255);); // Env 1,3
n == 28 || n == 30? (setcolor(28,108,28,255);); // Env 2,4
);
);
colorscheme == 5 || colorscheme == 6 ? (
n == 5 ? (setcolor(0,0,0,255);); // button txt pttn used, labels
n == 6 ? (setcolor(75,95,123,255);); // button txt pttn empty
n == 6 ? (setcolor(95,95,113,255);); // button txt pttn empty
n == 8 ? (setcolor(41,41,41,255);); // drum mode white key background
n == 9 ? (setcolor(220,220,220,127);); // dm midi ch num txt, see thru black
n == 10 ? (setcolor(37,37,37,255);); // dm midi ch num bg
n == 11 ? (setcolor(255,0,0,205);); // dm midi xpose, red
n == 16 ? (setcolor(0,0,0,180);); // see thru black
n == 17 ? (setcolor(255,0,0,120);); // see thru red
n == 18 ? (setcolor(100,100,100,127);); // octave line
n == 19 ? (setcolor(100,100,100,255);); // barline
n == 31 ? (setcolor(84,84,84,255);); // BG
n == 35 ? (setcolor(255,255,255,255);); // Env Label
n == 36 ? (setcolor(0,0,0,127);); // velobar, see thru black
n == 37 ? (setcolor(80,80,80,255);); // button txt labels dark
n == 38 ? (setcolor(210,210,210,255);); // button txt labels light
colorscheme == 5 ? (
colorschemename="BlueMeanie";
n == 1 ? (setcolor(130,145,170,255 );); // button bg colour
n == 2 ? (setcolor(150,195,255,102);); // button hilite
n == 3 ? (setcolor(157,177,206,255);); // button chain ptn
n == 20 ? (setcolor(100,130,184,255);); // selected first beat
n == 21 ? (setcolor(130,160,214,255);); // selected other beats
n == 22 ? (setcolor(209,224,239,255);); // time position selected
n == 23 ? (setcolor(115,130,155,255);); // time position not sel
n == 24 ? (setcolor(82,87,93,255);); // grid squares first beat
n == 25 ? (setcolor(111,114,120,255);); // grid squares other beats
n == 26 ? (setcolor(195,195,195,255);); // text for vel/shift
n > 26 && n < 31 ? (setcolor(100,130,220,255);); // Env 1-4
n == 32 ? (setcolor(164,174,185,255);); // Divider Top
n == 33 ? (setcolor(139,149,160,255);); // Divider Center
n == 34 ? (setcolor(87,97,105,255);); // Divider Bottom
) : (
colorschemename="Subzero";
n == 1 ? (setcolor(110,138,166,255);); // button bg colour
n == 2 ? (setcolor(146,195,246,102);); // button hilite
n == 3 ? (setcolor(146,195,246,255);); // button chain ptn
n == 20 ? (setcolor(179,194,209,255);); // selected first beat
n == 21 ? (setcolor(209,224,239,255);); // selected other beats
n == 22 ? (setcolor(229,244,255,255);); // time position selected
n == 23 ? (setcolor(110,138,166,255);); // time position not sel
n == 24 ? (setcolor(91,97,103,255);); // grid squares first beat
n == 25 ? (setcolor(121,127,133,255);); // grid squares other beats
n == 26 ? (setcolor(165,165,165,255);); // text for vel/shift
n == 27 ? (setcolor(100,130,184,255);); // Env 1
n == 28 ? (setcolor(100,130,194,255);); // Env 2
n == 29 ? (setcolor(100,130,204,255);); // Env 3
n == 30 ? (setcolor(100,130,214,255);); // Env 4
n == 32 ? (setcolor(174,184,195,255);); // Divider Top
n == 33 ? (setcolor(149,159,170,255);); // Divider Center
n == 34 ? (setcolor(97,107,115,255);); // Divider Bottom
);
);
colorscheme == 7 || colorscheme == 8 ? (
n == 5 ? (setcolor(0,0,0,255);); // button txt pttn used, labels
n == 6 ? (setcolor(140,140,140,255);); // button txt pttn empty
n == 8 ? (setcolor(41,41,41,255);); // drum mode white key background
n == 9 ? (setcolor(220,220,220,127);); // dm midi ch num txt, see thru black
n == 11 ? (setcolor(255,0,0,205);); // dm midi xpose, red
n == 16 ? (setcolor(0,0,0,180);); // see thru black
n == 17 ? (setcolor(255,0,0,120);); // see thru red
n == 18 ? (setcolor(100,100,100,127);); // octave line
n == 19 ? (setcolor(100,100,100,255);); // barline
n == 23 ? (setcolor(130,130,130,255);); // time position not sel
n == 24 ? (setcolor(80,80,80,255);); // grid squares first beat
n == 25 ? (setcolor(105,105,105,255);); // grid squares other beats
n == 31 ? (setcolor(40,40,40,255);); // BG
n == 32 ? (setcolor(122,122,122,255);); // Divider Top
n == 33 ? (setcolor(100,100,100,255);); // Divider Center
n == 34 ? (setcolor(68,68,68,255);); // Divider Bottom
n == 35 ? (setcolor(255,255,255,255);); // Env Label
n == 36 ? (setcolor(0,0,0,127);); // velobar, see thru black
n == 37 ? (setcolor(160,160,160,255);); // button txt labels dark
n == 38 ? (setcolor(160,160,160,255);); // button txt labels light
colorscheme == 7 ? (
colorschemename="Bloody Hell";
n == 1 ? (setcolor(110,20,20,255);); // button bg colour
n == 2 ? (setcolor(150,25,25,102);); // button hilite
n == 3 ? (setcolor(175,0,0,255);); // button chain ptn
n == 5 ? (setcolor(180,180,180,255);); // button txt pttn used, labels
n == 6 ? (setcolor(90,95,95,255);); // button txt pttn empty
n == 10 ? (setcolor(120,16,16,255);); // dm midi ch num bg
n == 20 ? (setcolor(200,55,55,127);); // selected first beat
n == 21 ? (setcolor(255,55,55,127);); // selected other beats
n == 22 ? (setcolor(255,0,0,200);); // time position selected
n == 26 ? (setcolor(190,190,190,255);); // text for vel/shift
n >26 && n<31 ?(setcolor(150,50,50,255);); // Env 1-4
) : (
colorschemename="Spacebar";
//n == 1 ? (setcolor(77,77,77,255);); // button bg colour
n == 1 ? (setcolor(99,99,99,255);); // button bg colour
n == 2 ? (setcolor(147,147,147,102);); // button hilite
n == 3 ? (setcolor(160,160,160,255);); // button chain ptn
n == 5 ? (setcolor(0,0,0,255);); // button txt pttn used, labels
n == 6 ? (setcolor(140,140,140,255);); // button txt pttn empty
n == 10 ? (setcolor(37,37,37,255);); // dm midi ch num bg
n == 20 ? (setcolor(160,160,160,255);); // selected first beat
n == 21 ? (setcolor(190,190,190,255);); // selected other beats
n == 22 ? (setcolor(255,255,255,255);); // time position selected
n == 26 ? (setcolor(150,150,150,255);); // text for vel/shift
n >26 && n<31 ? (setcolor(180,180,180,255);); // Env 1-4
);
);
colorscheme == 9? (
colorschemename="Cyan-ide";
n == 1 ? (setcolor(209,224,239,255);); // button bg colour
n == 2 ? (setcolor(146,195,246,102);); // button hilite
n == 3 ? (setcolor(179,194,209,255);); // button chain ptn
n == 5 ? (setcolor(120,120,120,255);); // button txt pttn used, labels
n == 6 ? (setcolor(160,160,160,255);); // button txt pttn empty
n == 8 ? (setcolor(41,41,41,255);); // drum mode white key background
n == 9 ? (setcolor(220,220,220,127);); // dm midi ch num txt, see thru black
n == 10 ? (setcolor(37,37,37,255);); // dm midi ch num bg
n == 11 ? (setcolor(255,0,0,205);); // dm midi xpose, red
n == 16 ? (setcolor(0,0,0,180);); // see thru black
n == 17 ? (setcolor(255,0,0,120);); // see thru red
n == 18 ? (setcolor(100,100,100,127);); // octave line
n == 19 ? (setcolor(100,100,100,255);); // barline
n == 20 ? (setcolor(110,145,175,255);); // selected first beat
n == 21 ? (setcolor(80,112,134,255);); // selected other beats
n == 22 ? (setcolor(55,73,88,255);); // time position selected
n == 23 ? (setcolor(177,209,246,255);); // time position not sel
n == 24 ? (setcolor(229,244,255,255);); // grid squares first beat
n == 25 ? (setcolor(209,224,239,255);); // grid squares other beats
n == 26 ? (setcolor(150,150,150,255);); // text for vel/shift - mid
n >26 && n < 31 ? (setcolor(80,112,134,255);); // Env 1
n == 31 ? (setcolor(255,255,255,255);); // BG
n == 32 ? (setcolor(209,224,239,255);); // Divider Top
n == 33 ? (setcolor(189,204,219,255);); // Divider Center
n == 34 ? (setcolor(169,184,199,255);); // Divider Bottom
n == 35 ? (setcolor(255,255,255,255);); // Env Label
n == 36 ? (setcolor(255,255,255,200);); // velobar, see thru white
n == 37 || n == 38 ? (setcolor(120,120,120,255);); // button txt labels dark
);
);
npatterns=48; // no of patterns - 48 for startup in either mode
patternmode=0; // 0 = 96 patterns, 64 steps; 1 = 48 patterns, 128 steps;
xtrapatts=0; // flag to show when extra 48 patterns have been initialized
max_numnotes=49; // \
max_seqlength=64; // max nos
max_steps_per_beat=16; // /
numnotes=25; // \
listlength=16; // start nos
steps_per_beat=4; // /
ncolorschemes=9; // no of color schemes
numccs=4;
lbeatpos=-1;
ltickpos=-1;
p=-1; //Current pattern (use -1 here to force call to change_pattern right after init)
prev_p=p;
////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////// Memory Allocation ///////
notelist_base = 0; // 024576
velolist_base = notelist_base + 024576; // 301056
new_velolist_base = velolist_base + 301056; // 301056
notetie_base = new_velolist_base + 301056; // 024576
sparebuf3 = notetie_base + 024576; // max_subdivs (8); for subdivision move
sparebuf = sparebuf3 + 000128; // 100000 for copying notes
sparebuf2 = sparebuf + 100000; // 301056 for copying velocities
sparebuf_tie = sparebuf2 + 301056; // 050000 for copying note ties
sparebuf_cc = sparebuf_tie + 050000; // 050000 for copying CCs
cclist_base = sparebuf_cc + 050000; // 024576
sdlist = cclist_base + 024576; // 2408448
buf_offset = sdlist + 2408448;// 1024
buf_msg1 = buf_offset + 001024; // 1024
buf_msg23 = buf_msg1 + 001024; // 1024
start_adj_orig_list = buf_msg23 + 001024; // 1024
nn = start_adj_orig_list + 001024; // 96
notenames = nn + 000128; // 011520
has_notes = notenames + 011520; // npatterns; flags for patterns with notes.
notetranspose = has_notes + 000128; // max_numnotes
notrans = notetranspose + 000128; // max_numnotes
listlength_pat = notrans + 000128; // npatterns
rowchannel = listlength_pat + 000128; // npatterns;
zerochan = rowchannel + 000128; // max_numnotes;
steps_per_beat_pat = zerochan + 000128; // max_numnotes;
cc_type = steps_per_beat_pat + 000128; // npatterns; // numccs
cc_chan = cc_type + 000128; // numccs; // numccs
sd_playstate = cc_chan + 000128; // 1024
// sd_playstate = state of subdivided notes on each playing note row
// (2 subsequent values per row: sdnum and sdena)
runl_flags = sd_playstate + 001024;
savedata = runl_flags + 1000000;
savedata2 = savedata + 1000000;
nextslot1 = savedata2 + 1000000;
// last used address 6603392 // 1785215 remaining
////////////////////////////////////////////////////////// Memory Allocation ///////
////////////////////////////////////////////////////////////////////////////////////
// Mouse state encodings
mstate=0; // OFF
ms_grid=2^8; // note grid area
ms_noteerase=ms_grid+0;
ms_notedraw=ms_grid+1;
ms_veloedit=ms_grid+2;
ms_veloeditrow=ms_grid+3;
ms_notetie=ms_grid+4;
ms_startoffsetedit=ms_grid+5;
ms_startoffseteditrow=ms_grid+6;
ms_subdivnum=ms_grid+7;
ms_pk=2^9; //piano key area
ms_duplseq=ms_pk+0;
ms_rowtranpose=ms_pk+1;
ms_doublespbpreservepos=ms_pk+2; // double steps per beat, preserve note positions
ms_halvespbpreservepos=ms_pk+3; // halve steps per beat, preserve note positions
ms_doublespb=ms_pk+4;
ms_halvespb=ms_pk+5;
ms_tb=2^10; // toolbar area
ms_tb_r1=2^5; // toolbar row 1
ms_tb_pianokey_base=ms_tb+ms_tb_r1+0;
ms_tb_pianokey_trig=ms_tb+ms_tb_r1+1;
ms_tb_pianokey_numnotes=ms_tb+ms_tb_r1+2;
ms_tb_r2=2^6; // toolbar row 2
ms_tb_r3=2^7; // toolbar row 3
ms_tb_patchange=ms_tb+ms_tb_r2+0;
ms_tb_patcopy=ms_tb+ms_tb_r2+1;
ms_tb_chain=ms_tb+ms_tb_r2+2;
ms_tb_colorbutt=ms_tb+ms_tb_r2+3;
ms_tb_r4=2^13; // toolbar row 4
ms_tb_patshift=ms_tb+ms_tb_r4+1;
ms_tb_button_noundo=ms_tb+ms_tb_r4+2;
ms_tb_button=ms_tb+ms_tb_r4+3;
ms_tb_swing=ms_tb+ms_tb_r4+4;
ms_tb_rate=ms_tb+ms_tb_r4+5;
ms_tb_midimode=ms_tb+ms_tb_r4+7;
ms_tb_r5=2^14; // toolbar row 5
ms_tb_button=ms_tb+ms_tb_r5+0;
ms_tb_panic=ms_tb+ms_tb_r5+1;
ms_tb_notelen=ms_tb+ms_tb_r5+3;
ms_tb_patternlen=ms_tb+ms_tb_r5+4;
ms_tb_numbeats=ms_tb+ms_tb_r5+5;
ms_tb_move=ms_tb+ms_tb_r5+6;
ms_tb_settings=ms_tb+ms_tb_r5+7;
ms_tb_velo=ms_tb+ms_tb_r5+8;
ms_tb_r6=2^15; // toolbar row 6
ms_tb_pattmode=ms_tb+ms_tb_r6+0;
ms_el=2^11; // envelope lane area
ms_el_divider=ms_el+0;
ms_el_envdraw=ms_el+1;
ms_el_enverase=ms_el+2;
ms_el_ctrlchange=ms_el+3;
ms_preview=2^12; // preview note or piano key
ms_sub_drawfreehand=0; // substate for ms_noteerase and ms_notedraw. 0=off, 1=on
ms_sub_channelchange=0; // substate for ms_rowtranpose and ms_el_ctrlchange
// Toolbar element highlight states
hl_state=0;
hl_pattern=16; // Lowest 4 bits indicate the pattern number to highlight
hl_mode=113;
hl_playbeforestart=114;
hl_startpos=115;
hl_endpos=116;
hl_notelen=117;
hl_swing=118;
hl_patshift=119;
hl_panic=120;
hl_patternlen=121;
hl_numbeats=122;
hl_colorbutt=123;
hl_rate=124;
hl_move=125;
hl_velo=126;
hl_midimode=127;
hl_settings=128;
hl_pattmode=129;
last_hl_state=0;
lastpreviewsel=-1;
gfx_clear=-1;
ext_noinit=1;
noteonstate=0;
want_preview=-1;
last_preview=-1;
want_preview_nt=-1;
last_preview_nt=-1;
want_previewoff=0;
defaultvelo=100;
lastvelo=defaultvelo;
velobarwidth = 3;
ticks = 0;
tpb = 128; // ticks per beat
pianow=3*8+8;
chw = 0; //MIDI channel column width
pkw = pianow+chw; // piano key area width (pianokeys or note_names + MIDI channel column )
tbrh = 18; // toolbar row height
tbh = 5*tbrh+1; // toolbar height
el_divh = 6; // envelope lane divider height
recalc_elh = 1; // recalculate envelope lane height
lbasenote = -1;
lnumnotes = -1;
rateadj = 1;
lrateadj = -1;
lhl = 0;
lmode = -1;
settingsopen=0;
cc_to_adjust=0; // Currently highlighted envelope active for editing
refresh_cc_controls=1; // force refresh at init
want_noteoff_nt = 0;
ldraglen = -1;
start_beatpos = 0;
end_beatpos = -99; // if end_beatpos <= start_beatpos, then play infinitely
recmask = 0xFFFFFFFF;
notelen_p = 100;
defnotelen = tpb;
swing_p = 0;
swing = 0;
rate = 1.0;
notetie=notetie_base;
ltiestate=0;
refresh_tb=1;
busp=24; //toolbar button spacing (pixels)
mouse_on_button=0;
midi_trigger=0;
trig_note_start=96;
pat_trigger_pending=0;
pat_trigger_note=0;
pattrans_trigger_pending=0;
pattrans_trigger_note=0;
chain_beats=listlength/steps_per_beat;
ts_num_l=4;
ts_denom_l=4;
pat_shift=0;
cclist=cclist_base;
nn[0] = strcpy(500, "C");
nn[1] = strcpy(501, "C");
nn[2] = strcpy(502, "D");
nn[3] = strcpy(503, "D");
nn[4] = strcpy(504, "E");
nn[5] = strcpy(505, "F");
nn[6] = strcpy(506, "F");
nn[7] = strcpy(507, "G");
nn[8] = strcpy(508, "G");
nn[9] = strcpy(509, "A");
nn[10] = strcpy(510, "A");
nn[11] = strcpy(511, "B");
#name_str="";
notename_digit=0;
nn_filename=1000; // string slot for notename file name
lnotenames_file=-1;
max_notename_length=4; //Number of characters in note name. This controls the notename field width in GUI.
max_subdivs=8;
sdlist_p=0; // sdlist location of current pattern
tb_pianokey_end=10*(7*4+5*3+2)+5*4+3*3+1;
//initialize all patterns to same length,steps per beat, midi channels
memset(listlength_pat, listlength, npatterns);
memset(steps_per_beat_pat, steps_per_beat, npatterns);
memset(rowchannel, 0, max_numnotes);
listlength_all=listlength*npatterns;
// Set note velocity value to bits (7:0)
function setVelo(note, velo)
(
velolist[note] &= 0xFFFFFF80; //clear old
velolist[note] += velo; //set new
);
// Get note velocity value from bits (7:0)
function getVelo(note)
(
velolist[note] & 0x7F;
);
// Set note start offset to bits (15:8)
function setStart(note, start)
(
velolist[note] &= 0xFFFF00FF; //clear old
velolist[note] += (start << 8); //set new
);
// Get note start value from bits (15:8)
function getStart(note)
(
(velolist[note] & 0x0000FF00) >> 8;
);
// Set number of subdivs to bits (19:16)
function setSubdivNum(note, num)
(
velolist[note] &= 0xFFF0FFFF; //clear old
velolist[note] += (num << 16); //set new
);
// Get number of subdivs from bits (19:16)
function getSubdivNum(note)
(
(velolist[note] & 0x000F0000) >> 16;
);
function setSubdivVelo(row, step, sd_pos, velo)
(
sdlist[sdlist_p+row*max_seqlength*max_subdivs+step*max_subdivs+sd_pos] &= 0xFFFFFF80; //clear old
sdlist[sdlist_p+row*max_seqlength*max_subdivs+step*max_subdivs+sd_pos] += velo;
);
function getSubdivVelo(row, step, sd_pos)
(
sdlist[sdlist_p+row*max_seqlength*max_subdivs+step*max_subdivs+sd_pos] & 0x7F;
);
// Set subdiv notelist indicating which subdiv steps are enabled
function setSubdivNotelist(row, step, notes)
(
sdlist[sdlist_p+row*max_seqlength*max_subdivs+step*max_subdivs] &= 0xFF00FFFF; //clear old
sdlist[sdlist_p+row*max_seqlength*max_subdivs+step*max_subdivs] += (notes << 16); //set new
);
// Get subdiv notelist indicating which subdiv steps are enabled
function getSubdivNotelist(row, step)
(
(sdlist[sdlist_p+row*max_seqlength*max_subdivs+step*max_subdivs] & 0x00FF0000) >> 16;
);
// Get CC value from source's bit field indicated by ccpos
function getCc(source, ccpos) local(val)
(
val = 0;
ccpos == 0 ? val = source & 0xFF;
ccpos == 1 ? val = (source & 0x0000FF00) >> 8;
ccpos == 2 ? val = (source & 0x00FF0000) >> 16;
ccpos == 3 ? (
source & 0x80000000 ? ( // bit 31 = 1
val = ((source & 0x7F000000) >> 24) + 0x80;
) : (
val = (source & 0x7F000000) >> 24;
);
);
val;
);
// Set CC value val to target's bit field indicated by ccpos
function setCc(target, ccpos, val)
(
ccpos == 0 ? (target &= 0xFFFFFF00; target += val;);
ccpos == 1 ? (target &= 0xFFFF00FF; target += val * 2^8;);
ccpos == 2 ? (target &= 0xFF00FFFF; target += val * 2^16;);
ccpos == 3 ? (target &= 0x00FFFFFF; target += val * 2^24;);
target;
);
// Is the value within valid MIDI value range (7bit)?
function is_midi_val(value)
(
valid = 0;
value >= 0 && value < 128 ? valid = 1;
valid;
);
// Truncate to valid MIDI value range (7bit).
function trunc_midi_val(value)
(
value < 0 ? (
value = 0;
) : (
value > 127 ? value = 127;
);
value;
);
function scale_velobarwidth(seqlen) local(width, gfx_w_l)
(
width = 2;
gfx_w == 0 ? gfx_w_l=400+pkw : gfx_w_l=gfx_w;
seqlen/(gfx_w_l/(400+pkw)) > 65 ? width = 1;
seqlen/(gfx_w_l/(400+pkw)) < 42 ? width = 3;
width; // return scaled width
);
// Update flags indicating patterns that are not empty
function update_has_notes() local(p, step, note_found, notelist, cclist)
(
//has_notes=0;
notelist=notelist_base;
cclist=cclist_base;
p=0;
loop(npatterns,
note_found=0;
step=0;
while(step < listlength_pat[p] && !note_found ? (
notelist[step] != 0 ? note_found=1;
cclist[step] != 0 ? note_found=1;
step+=1;
);
);
note_found ? (has_notes[p]=1;):(has_notes[p]=0;);
notelist+=listlength_pat[p];
cclist+=listlength_pat[p];
p+=1;
);
);
// Change pattern
function change_pattern(new_p) local(i)
(
new_p<0 ? new_p=0 : new_p>=npatterns ? new_p=npatterns-1;
p=new_p;
notelist=0;
velolist=velolist_base;
i=0;
loop(p,
notelist+=listlength_pat[i];
velolist+=max_numnotes*listlength_pat[i];
i+=1;
);
notetie=notetie_base+notelist;
cclist=cclist_base+notelist;
notelist=notelist_base+notelist;
listlength=listlength_pat[p];
velobarwidth = scale_velobarwidth(listlength);
steps_per_beat = steps_per_beat_pat[p];
rateadj = steps_per_beat * rate;
update_has_notes();
refresh_tb=1;
ltiestate = 0; // clear all note ties
sdlist_p=p*max_numnotes*max_seqlength*max_subdivs;
);
// Update chain beats
function update_chain_beats() local(i_pat)
(
chain_beats=listlength_pat[0]/steps_per_beat_pat[0];
i_pat=1;
loop(chain,
chain_beats+=listlength_pat[i_pat]/steps_per_beat_pat[i_pat];
i_pat+=1;
);
);
// Change sequence length
function change_seqlen(newsz) local(ip, y, pstart, pstartv, pstart_n, pstartv_n, new_listlength_all)
(
newsz >= 1 && listlength_pat[p] != newsz ? (
new_listlength_all=listlength_all-listlength_pat[p]+newsz;
newsz < listlength_pat[p] ? ( // decrease size
pstart=0; // old pattern start offset for notes
pstartv=0; // old pattern start offset for velocities
pstart_n=0; // new pattern start offset for notes
pstartv_n=0; // new pattern start offset for velocities
ip=0; // loop index iterating over patterns
loop(npatterns,
memcpy(sparebuf + ip*1024, pstart, listlength_pat[ip]); // save a copy of the full quality notelist
memcpy(sparebuf_tie + ip*1024, notetie_base+pstart, listlength_pat[ip]); // save a copy of the full quality notetielist
memcpy(sparebuf_cc + ip*1024, cclist_base+pstart, listlength_pat[ip]); // save a copy of the full quality notetielist
y=0;
loop(max_numnotes,
memcpy(sparebuf2 + ip*max_numnotes*max_seqlength+y*max_seqlength, velolist_base+pstartv+y*listlength_pat[ip], listlength_pat[ip]); // save a copy of the full quality
y+=1;
);
ip < p ? (
memcpy(new_velolist_base+pstartv_n, velolist_base+pstartv, max_numnotes*listlength_pat[ip]);
pstart_n+=listlength_pat[ip];
pstartv_n+=max_numnotes*listlength_pat[ip];
) : ip == p ? (
memcpy(pstart_n, pstart, newsz);
memcpy(notetie_base+pstart_n, notetie_base+pstart, newsz);
memcpy(cclist_base+pstart_n, cclist_base+pstart, newsz);
y=0;
loop(max_numnotes,
memcpy(new_velolist_base+pstartv_n+y*newsz, velolist_base+pstartv+y*listlength_pat[ip], newsz);
y+=1;
);
pstart_n+=newsz;
pstartv_n+=max_numnotes*newsz;
) : (
memcpy(pstart_n, pstart, listlength_pat[ip]);
memcpy(notetie_base+pstart_n, notetie_base+pstart, listlength_pat[ip]);
memcpy(cclist_base+pstart_n, cclist_base+pstart, listlength_pat[ip]);
memcpy(new_velolist_base+pstartv_n, velolist_base+pstartv, max_numnotes*listlength_pat[ip]);
pstart_n+=listlength_pat[ip];
pstartv_n+=max_numnotes*listlength_pat[ip];
);
pstart+=listlength_pat[ip];
pstartv+=max_numnotes*listlength_pat[ip];
ip+=1;
);
) : ( // increase size
pstart=listlength_all; // old pattern start offset for notes
pstartv=max_numnotes*listlength_all; // old pattern start offset for velocities
pstart_n=new_listlength_all; // new pattern start offset for notes
pstartv_n=max_numnotes*new_listlength_all; // new pattern start offset for velocities
ip=npatterns-1; // loop index iterating over patterns in reverse order
loop(npatterns,
pstart-=listlength_pat[ip];
pstartv-=max_numnotes*listlength_pat[ip];
ip < p ? (
pstart_n-=listlength_pat[ip];
pstartv_n-=max_numnotes*listlength_pat[ip];
memcpy(new_velolist_base+pstartv_n, velolist_base+pstartv, max_numnotes*listlength_pat[ip]);
) : ip == p ? (
pstart_n-=newsz;
pstartv_n-=max_numnotes*newsz;
y=0;
loop(max_numnotes,
memcpy(new_velolist_base+pstartv_n+y*newsz, velolist_base+pstartv+y*listlength_pat[ip], listlength_pat[ip]);
memcpy(new_velolist_base+pstartv_n+y*newsz+listlength_pat[ip], sparebuf2+ip*max_numnotes*max_seqlength+y*max_seqlength+listlength_pat[ip], newsz-listlength_pat[ip]);
y+=1;
);
memcpy(cclist_base+pstart_n, cclist_base+pstart, listlength_pat[ip]);
memcpy(cclist_base+pstart_n+listlength_pat[ip], sparebuf_cc+ip*1024+listlength_pat[ip], newsz-listlength_pat[ip]);
memcpy(notetie_base+pstart_n, notetie_base+pstart, listlength_pat[ip]);
memcpy(notetie_base+pstart_n+listlength_pat[ip], sparebuf_tie+ip*1024+listlength_pat[ip], newsz-listlength_pat[ip]);
memcpy(pstart_n, pstart, listlength_pat[ip]);
memcpy(pstart_n+listlength_pat[ip], sparebuf+ip*1024+listlength_pat[ip], newsz-listlength_pat[ip]);
) : (
pstart_n-=listlength_pat[ip];
pstartv_n-=max_numnotes*listlength_pat[ip];
memcpy(new_velolist_base+pstartv_n, velolist_base+pstartv, max_numnotes*listlength_pat[ip]);
memcpy(cclist_base+pstart_n, cclist_base+pstart, listlength_pat[ip]);
memcpy(notetie_base+pstart_n, notetie_base+pstart, listlength_pat[ip]);
memcpy(pstart_n, pstart, listlength_pat[ip]);
);
ip-=1;
);
);
listlength_pat[p] = newsz;
temp = new_velolist_base;
new_velolist_base = velolist_base;
velolist_base = temp;
listlength = newsz; // Update current sequence length
listlength_all = new_listlength_all;
//change_pattern(p);
velolist=velolist_base;
ip=0;
loop(p,
velolist+=max_numnotes*listlength_pat[ip];
ip+=1;
);
velobarwidth = scale_velobarwidth(listlength);
p <= chain ? update_chain_beats();
);
);
function moveUpDown(dir) // 1 Up // 0 Down //
(
step=0; endrowused=0;
loop(listlength,
dir?(notelist[step]>281474976710655 ? endrowused+=1;):(endrowused+=notelist[step]&1;);
step+=1;
);
endrowused==0? (
step=0;
loop(listlength,
notelist[step]=dir?(notelist[step]*2;):(notelist[step]/2;);
notetie[step]= dir?(notetie[step]*2;):(notetie[step]/2;);
dir?(row=max_numnotes;):(row=0;);
loop(max_numnotes,
sd_pos=0;
loop(max_subdivs,
sdlist[sdlist_p+row*max_seqlength*max_subdivs+step*max_subdivs+sd_pos] = sdlist[sdlist_p+
((dir?(row-1):(row+1);)*max_seqlength*max_subdivs)+step*max_subdivs+sd_pos];
sd_pos+=1;
);
velolist[step+(row*listlength)] = velolist[step+((dir?(row-1):(row+1);)*listlength)];
dir?(row-=1;):(row+=1;);
);
step+=1;
);
);
dir?(memset(velolist, 0, listlength););
);
function moveRightLeft(dir,ccs) // 1 Right // 0 Left //
(
y=dir?(-1):(1);
z=dir?(listlength-1):(0);
x=dir?(0):(listlength-1);
sparebuf[0] = notelist[z];
sparebuf_tie[0] = notetie[z];
ccs ? sparebuf_cc[0] = cclist[z];
step=z;
loop(listlength-dir,
notelist[step] = notelist[step+y];
notetie[step] = notetie[step+y];
ccs ? cclist[step] = cclist[step+y];
dir?(step-=1;):(step+=1;);
);
notelist[x] = sparebuf[0];
notetie[x] = sparebuf_tie[0];
ccs ? cclist[x] = sparebuf_cc[0];
row=0;
loop(max_numnotes,
step=z;
sparebuf2[0]=velolist[dir?((row+1)*listlength-1):(row*listlength);];
sd_pos=0;
loop(max_subdivs,
sparebuf3[sd_pos]=sdlist[sdlist_p+row*max_seqlength*max_subdivs+step*max_subdivs+sd_pos];
sd_pos+=1;
);
loop(listlength-1,
sd_pos=0;
loop(max_subdivs,
sdlist[sdlist_p+row*max_seqlength*max_subdivs+step*max_subdivs+sd_pos] = sdlist[sdlist_p+row*max_seqlength*max_subdivs+(step+y)*max_subdivs+sd_pos];
sd_pos+=1;
);
velolist[step+(row*listlength)] = velolist[step+(row*listlength)+y];
step+=y;
);
velolist[dir?(row*listlength):(((row+1)*listlength)-1);]=sparebuf2[0];
sd_pos=0;
loop(max_subdivs,
sdlist[sdlist_p+row*max_seqlength*max_subdivs+x*max_subdivs+sd_pos] = sparebuf3[sd_pos];
sd_pos+=1;
);
row+=1;
);
);
function initialize48(pm)
(
//change number of patterns: initialize 48 patts ONLY, set max_seqlength
patternmode=pm; max_seqlength = pm==0?(64):(128);
listlength = 16; steps_per_beat=4; npatterns = 48;
p=0; pat_shift=0; xtrapatts=0; chain=0;
sliderchange(slider1=p);
sliderchange(slider3=listlength);
sliderchange(slider9=steps_per_beat);
sliderchange(slider44=pat_shift);
sliderchange(slider46=xtrapatts);
sliderchange(slider12=chain);
sliderchange(slider47=npatterns);
memset(sparebuf, 0, npatterns*1024);
memset(sparebuf_tie, 0, npatterns*1024);
memset(sparebuf_cc, 0, npatterns*1024);
memset(notelist_base, 0, npatterns*max_seqlength);
memset(notetie_base, 0, npatterns*max_seqlength);
memset(cclist_base, 0, npatterns*max_seqlength);
memset(sparebuf2, 0, npatterns*max_seqlength*max_numnotes);
memset(velolist_base, 0, npatterns*max_seqlength*max_numnotes);
memset(sdlist, 0, npatterns*max_seqlength*max_numnotes*max_subdivs);
memset(rowchannel, 0, max_numnotes);
memset(notetranspose, 0, max_numnotes);
memset(listlength_pat, listlength, npatterns);
memset(steps_per_beat_pat, steps_per_beat, npatterns);
listlength_all=listlength*npatterns;
change_pattern(p);
update_has_notes();
refresh_tb=1;
);
@slider
new_p=slider1|0;
new_p!=p ? change_pattern(new_p);
basenote=slider2|0;
numnotes=slider4|0;
rate=slider5;
notelen_p = slider6|0;
defnotelen = (tpb*(notelen_p/100))|0;
mode = slider7|0; //0= piano roll, 1 = drum map
mode == 0 ? (
chw=0;
pianow=3*8+8;
) : (
chw = 2*8+8;
pianow=max_notename_length*8+8;
);
pkw=chw+pianow;
swing_p = slider8|0;
swing = ((tpb/2)*(swing_p/100))|0;
midi_trigger=slider10|0;
prev_p==p ? ( // not changing pattern
newsz=slider3|0;
change_seqlen(newsz);
steps_per_beat=slider9|0;
steps_per_beat_pat[p]=steps_per_beat;
rateadj = steps_per_beat * rate;
p <= chain ? update_chain_beats();
);
trig_note_start=slider11|0;
chain=slider12|0;
elh_percent=slider13;
notenames_file=slider15|0;
cc_to_adjust=slider14|0;
cc_type[0]=slider20|0;
cc_type[1]=slider21|0;
cc_type[2]=slider22|0;
cc_type[3]=slider23|0;
cc_chan[0]=slider30|0;
cc_chan[1]=slider31|0;
cc_chan[2]=slider32|0;
cc_chan[3]=slider33|0;
start_beatpos=slider40;
play_before_start=slider41|0;