-
-
Notifications
You must be signed in to change notification settings - Fork 53
/
control_draw.gml
2335 lines (2267 loc) · 111 KB
/
control_draw.gml
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
function control_draw() {
// control_draw()
var a, b, c, d, e, f, g, p, l, s, exist, str, str2, m, xx, x1, y1, x2, y2, iconcolor, showmenu, totalcols, totalrows, compx, prev, colr, note_offset;
var targetspeed = 1000000 / room_speed
currspeed = targetspeed / delta_time
rw = floor(window_width * (1 / window_scale))
rh = floor(window_height * (1 / window_scale))
// Update window scale
if (window_scale != prev_scale) {
camera_set_view_size(cam_window, rw, rh)
msgx = rw
msgy = rh * 0.8
}
prev_scale = window_scale
if (channelstoggle) channels = 32768
else channels = 256
audio_channel_num(channels)
if (icon_display) {
if (window_icon) window_set_icon_raw(window_handle(), buffer_get_address(icon_buffer), buffer_get_address(icon_size_buffer))
else window_reset_icon_raw(window_handle())
}
if (!mouseover) curs = cr_default
showmenu = 0
cursmarker = 0
compx = 160
window_set_caption(condstr((filename = "" || filename = "-player") && (midiname = "" || !isplayer), condstr(language != 1, "Unsaved song", "新文件")) + condstr(filename != "-player", filename_name(filename)) + condstr((filename = "" || filename = "-player") && midiname != "" && isplayer, midiname) + condstr(changed && filename != "" && filename != "-player", "*") + " - Minecraft Note Block Studio" + condstr(isplayer, " - Player Mode"))
// Performance indicator: "(" + string_format(currspeed * 100, 1, 0) + "%) "
draw_set_alpha(1)
draw_theme_color()
draw_theme_font(font_main)
editline += 1
if refreshrate = 1 game_set_speed(60,gamespeed_fps)
if refreshrate = 2 game_set_speed(120,gamespeed_fps)
if refreshrate = 3 game_set_speed(144,gamespeed_fps)
if refreshrate = 4 game_set_speed(240,gamespeed_fps)
if (editline > 60) editline = 0
if (delay > 0) delay -= 1 / (room_speed / 20)
if (delay < 0) delay = 0
if (!isplayer) {
work_mins += 1 / (room_speed * 60)
}
file_dnd_set_files("*.nbs;*.mid;*.midi;*.nbp", 1, 0, 0)
dndfile = file_dnd_get_files()
remove_emitters()
if (selected = 0) {
if (block_outside = 0 && block_custom = 0) {
if ((tempo = 10 || tempo = 5 || tempo = 2.5) && block_pitched = 0) compatible = 1
else compatible = 2
} else compatible = 0
}
sela = -1
selb = -1
selbx = -1
selby = -1
if (window = 0) {
if (mouse_check_button_pressed(mb_left)) {
if (!isplayer) work_left += 1
key_edit = -1
}
if (mouse_check_button_pressed(mb_right)) {
if (!isplayer) work_right += 1
}
}
if (key_edit > -1) {
if (!show_keyboard) key_edit = -1
if (keyboard_check_pressed(vk_enter) || keyboard_check_pressed(vk_space) || keyboard_check_pressed(vk_escape)) {
piano_key[key_edit] = 0
key_edit = -1
save_settings()
} else if (keyboard_check_pressed(vk_anykey)) {
piano_key[key_edit] = keyboard_lastkey
key_edit = -1
save_settings()
}
}
if (!isplayer) {
// Autosave
if (autosave && filename_ext(filename) = ".nbs") {
tonextsave -= 1 / room_speed / 60
if (tonextsave <= 0 && playing == 0) save_song(filename)
}
// Auto-recovery
if (totalblocks > 0) {
tonextbackup -= 1 / room_speed / 60
if (tonextbackup <= 0 && playing == 0) {
save_song(backup_file, true)
tonextbackup = backupmins
}
}
// Toggle blackout mode
if (keyboard_check_pressed(vk_f10)) {
blackout = !blackout
if (language != 1) {
if (blackout) set_msg("Blackout mode => ON")
else set_msg("Blackout mode => OFF")
} else {
if (blackout) set_msg("全黑模式 => 开启")
else set_msg("全黑模式 => 关闭")
}
}
// Toggle fullscreen
if (keyboard_check_pressed(vk_f11)) {
fullscreen = !fullscreen
if (language != 1) {
if (fullscreen) set_msg("Fullscreen => ON")
else set_msg("Fullscreen => OFF")
} else {
if (fullscreen) set_msg("全屏模式 => 开启")
else set_msg("全屏模式 => 关闭")
}
}
}
if (theme = 0) window_background = 15790320
if (theme = 1) window_background = 13160660
if (theme = 2) window_background = c_dark
// if (theme = 3) window_background = c_white
if (theme = 3) window_background = 15987699
if (theme = 3 && fdark) window_background = 2105376
draw_clear(window_background)
if (theme = 3 && acrylic && wpaperexist && can_draw_mica) draw_sprite_tiled_ext(wpaperblur, 0,
0 - window_get_x() * (1 / window_scale) - (sprite_get_width(wpaper) * (display_height / sprite_get_height(wpaper)) - display_width) * (1 / window_scale) * (wpaperside) / 2,
0 - window_get_y() * (1 / window_scale) - (sprite_get_height(wpaper) * (display_width / sprite_get_width(wpaper)) - display_height) * (1 / window_scale) * (!wpaperside) / 2,
(1 / window_scale) * (display_width / sprite_get_width(wpaper)) * (!wpaperside) + (1 / window_scale) * (display_height / sprite_get_height(wpaper)) * (wpaperside),
(1 / window_scale) * (display_width / sprite_get_width(wpaper)) * (!wpaperside) + (1 / window_scale) * (display_height / sprite_get_height(wpaper)) * (wpaperside), -1, 1)
if (isplayer) {
draw_set_color(15790320)
if (theme = 1) draw_set_color(13160660)
if (theme = 2) draw_set_color(c_dark)
if (theme = 3) draw_set_color(15987699)
if (theme = 3 && acrylic && wpaperexist && can_draw_mica) draw_set_color(15198183)
if (theme = 3 && fdark) draw_set_color(2105376)
if (theme = 3 && fdark && acrylic && wpaperexist && can_draw_mica) draw_set_color(1315860)
if (theme = 3 && acrylic && wpaperexist && can_draw_mica) draw_set_alpha(0.875)
draw_rectangle(0, 0, rw, rh, 0)
draw_set_alpha(1)
}
iconcolor = c_black
if (theme = 2 || (theme = 3)) iconcolor = c_white
// Calculate area
if (!fullscreen && show_layers) {
totalcols = floor((rw - 8 - 270) / 32)
} else if (dropmode) {
totalcols = floor(rh / 32) + 1
} else {
totalcols = floor(rw / 32) + 1
}
rhval = 270
if (!show_piano) {
rhval = 130
}
if (fullscreen) {
rhval = 32
}
totalrows = floor((rh - rhval) / 32)
if (fullscreen) totalrows += 1
if (min(keysmax, floor((rw - 32) / 39)) != keysshow) {
if (!isplayer) startkey = 27 - floor(min(keysmax, floor((rw - 32) / 39)) / 2)
else startkey = 0
sharpkeys = 0
for (a = 0; a < startkey; a += 1) {
b = a mod 7
if (b != 1 && b != 4) sharpkeys += 1
}
}
keysshow = min(keysmax, floor((rw - 32) / 39))
x1 = -2
if (!fullscreen && show_layers) {
x1 = 264
}
if (fullscreen) {
y1 = -2
} else {
y1 = 52
}
if ((window = 0 || select > 0) && playing = 0 && !isplayer) {
if (mouse_rectangle(x1 + 2, y1 + 34, totalcols * 32, totalrows * 32) || select > 0) {
sela = floor((mouse_x - (x1 + 2)) / 32)
selb = floor((mouse_y - (y1 + 34)) / 32)
curs = cr_handpoint
}
if (mouse_rectangle(x1 + 2 + floor(marker_pos * 32 - starta * 32) - 8, y1, 16, totalrows * 32 + 32) && mouse_rectangle(x1 + 2, y1 + 2, totalcols * 32, totalrows * 32 + 64) && select = 0 && window = 0) {
cursmarker = 1
curs = cr_size_we
if (mouse_check_button(mb_left)) {
window = w_dragmarker
}
}
if (section_exists) {
if (mouse_rectangle(x1 + 2 + floor(section_start * 32 - starta * 32) - 8, y1, 16, totalrows * 32 + 32) && select = 0 && window = 0 && cursmarker = 0) {
cursmarker = 1
curs = cr_size_we
if (mouse_check_button(mb_left)) {
window = w_dragsection_start
}
}
if (mouse_rectangle(x1 + 2 + floor(section_end * 32 - starta * 32) - 8, y1, 16, totalrows * 32 + 32) && select = 0 && window = 0 && cursmarker = 0) {
cursmarker = 1
curs = cr_size_we
if (mouse_check_button(mb_left)) {
window = w_dragsection_end
}
}
}
if (mouse_rectangle(x1 + 2, y1 + 2, totalcols * 32, 32) && window = 0) {
if (select = 0 && playing = 0 && mouse_check_button_pressed(mb_right)) {
if (language != 1) show_menu_ext("section", mouse_x, mouse_y, inactive(!section_exists) + "Remove section|"+
inactive(!section_exists || section_start > enda) + "Jump to beginning of section|"+
inactive(!section_exists || section_end > enda) + "Jump to ending of section|-|"+
inactive(!section_exists) + "Select all blocks in section|-|"+
check(marker_start) + "Start playing in section|"+
check(marker_end) + "Stop playing after section")
else show_menu_ext("section", mouse_x, mouse_y, inactive(!section_exists) + "移除区间|"+
inactive(!section_exists || section_start > enda) + "跳到区间开始|"+
inactive(!section_exists || section_end > enda) + "跳到区间结束|-|"+
inactive(!section_exists) + "选中区间内方块|-|"+
check(marker_start) + "从区间开始播放|"+
check(marker_end) + "区间后结束播放")
}
if (mouse_check_button_pressed(mb_left)) {
timeline_pressa = starta + floor((mouse_x - (x1 + 2)) / 32)
}
if (mouse_check_button_released(mb_left) && aa = 0) {
marker_pos = starta + (mouse_x - (x1 + 2)) / 32
}
if (mouse_check_button(mb_left)) {
if (starta + floor((mouse_x - (x1 + 2)) / 32)<>timeline_pressa && timeline_pressa > -1) {
window = w_dragsection_end
section_exists = 1
section_end = starta + floor((mouse_x - (x1 + 2)) / 32)
section_start = timeline_pressa
timeline_pressa = -1
}
}
}
}
exist = 0
if (((sela > -1 && selb > -1) || select > 0) && !isplayer) {
if (mouse_check_button_pressed(mb_left) || mouse_check_button_pressed(mb_right) || mouse_check_button_pressed(mb_middle)) clickinarea = 1
selbx = starta + sela
selby = startb + selb
if (select = 0 && selected = 0 && selbx < arraylength && selby < arrayheight) {
exist = song_exists[selbx, selby]
if (exist && cursmarker = 0) {
if (changepitch && (mouse_wheel_up() || mouse_wheel_down())) {
var diff = mouse_wheel_up() - mouse_wheel_down()
// If shift is not pressed, do increments of a single key or 10 steps at once.
if (!keyboard_check(vk_shift) && (editmode != m_key)) {
diff *= 10
}
// If shift is pressed, do increments of a whole octave or fine-tune increments to one step
if (keyboard_check(vk_shift) && (editmode = m_key)) {
diff *= 12
}
var key = song_key[selbx, selby]
var vel = song_vel[selbx, selby]
var pan = song_pan[selbx, selby]
var pit = song_pit[selbx, selby]
if (editmode = m_key) {
key = median(0, key + diff, 87)
} else if (editmode = m_vel) {
vel = median(0, vel + diff, 100)
} else if (editmode = m_pan) {
pan = median(0, pan + diff, 200)
} else if (editmode = m_pit) {
if (instrument_list[| ds_list_find_index(instrument_list, song_ins[selbx, selby])].name != "Tempo Changer") pit = median(-1200, pit + diff, 1200)
else pit += diff
}
change_block_manual(selbx, selby, song_ins[selbx, selby], key, vel, pan, pit)
}
}
}
}
if (mousewheel = 1 && window = 0 && (exist = 0 || changepitch = 0) && !isplayer && !volume_scroll) {
var insindex = ds_list_find_index(instrument_list, instrument)
if (mouse_wheel_down() && insindex > 0) {
insindex--
instrument = instrument_list[| insindex]
selected_vel = 100
selected_pan = 100
selected_pit = 0
play_sound(instrument, selected_key, 100 ,100, 0)
}
if (mouse_wheel_up() && insindex < ds_list_size(instrument_list) - 1) {
insindex++
instrument = instrument_list[| insindex]
selected_vel = 100
selected_pan = 100
selected_pit = 0
play_sound(instrument, selected_key, 100 ,100, 0)
}
}
if (mousewheel = 2 && window = 0 && (exist = 0 || changepitch = 0) && !isplayer && !volume_scroll) {
if (mouse_wheel_down() && selected_key > 0) {
selected_key -= 1
selected_vel = 100
selected_pan = 100
selected_pit = 0
play_sound(instrument, selected_key, 100 ,100, 0)
}
if (mouse_wheel_up() && selected_key < 87) {
selected_key += 1
selected_vel = 100
selected_pan = 100
selected_pit = 0
play_sound(instrument, selected_key, 100 ,100, 0)
}
}
// Draw note blocks
draw_set_halign(fa_center)
for (b = 0; b <= totalrows; b += 1) {
lockedlayer[startb + b] = 0
if (solostr != "") {
if (string_count("|" + string(startb + b) + "|", solostr) = 0) {
lockedlayer[startb + b] = 1
} else if (layerlock[startb + b] = 1) {
lockedlayer[startb + b] = 1
}
} else if (startb + b < endb2) {
if (layerlock[startb + b] = 1) {
lockedlayer[startb + b] = 1
}
}
}
if (!isplayer) {
if (blackout) {
draw_set_color(c_black)
draw_rectangle(x1 + 2, y1 + 34, x1 + 2 + 32 * totalcols, y1 + 34 + 32 * totalrows, false)
}
if (theme = 3 && !blackout) {
draw_set_color(16382457)
if (fdark) draw_set_color(2565927)
draw_rectangle(x1 + 2, y1 + 34, x1 + 2 + 32 * totalcols, y1 + 34 + 32 * totalrows, false)
}
}
note_offset = floor(((marker_pos - floor(marker_pos + 0.5 * !isplayer)) * 32) + 0.5) * ((playing && marker_follow && marker_pagebypage = 2 && (marker_pos - floor(totalcols / 2 + 0.5) < enda + 1 && marker_pos - floor(totalcols / 2 + 0.5) > 0)) || isplayer)
if (!isplayer) {
for (a = 0; a < totalcols; a += 1) {
if (!blackout) {
if ((starta + a) mod (timesignature * 4) == 0) {
draw_set_alpha(0.3)
if (window_scale < 1) draw_set_alpha(0.5) //Issue #254, make the lines more obvious when scaled down
if (playing && marker_pagebypage = 2 && window_scale < 1) draw_line(x1 + 2 + 32 * a - note_offset, y1 + 34, (x1 + 2 + 32 * a) - note_offset, y1 + 34 + totalrows * 32)
else draw_rectangle(x1 + 2 + 32 * a - note_offset, y1 + 34, (x1 + 2 + 32 * a) + 1 - note_offset, y1 + 34 + totalrows * 32, false)
} else {
draw_set_alpha(0.1)
if ((starta + a) mod 4 == 0) draw_set_alpha(0.25)
draw_line(x1 + 2 + 32 * a - note_offset, y1 + 34, x1 + 2 + 32 * a - note_offset, y1 + 34 + totalrows * 32)
}
}
for (b = 0; b < totalrows; b += 1) {
if (starta + a <= enda) {
if (startb + b <= endb) {
if (colamount[starta + a] > 0) {
if (startb + b >= colfirst[starta + a] && startb + b <= collast[starta + a]) {
if (song_exists[starta + a, startb + b]) {
s = 0 // Selected
if (fade=0) c = 0.5 * (song_vel[starta + a, startb + b] / 100) + 0.25
else c = 1
if (lockedlayer[startb + b] = 0) c += 0.5 * (1 - (min(1000, current_time - song_played[starta + a, startb + b]) / 1000))
if (playing = 0) {
if (select = 1 && lockedlayer[startb + b] = 0) {
s = (starta + a >= min(select_pressa, selbx) && starta + a <= max(select_pressa, selbx) && startb + b >= min(select_pressb, selby) && startb + b <= max(select_pressb, selby))
}
if (fade=0) c += ((selbx = starta + a && selby = startb + b && select = 0 && window = 0 && cursmarker = 0) || s) * 0.5
}
draw_block(x1 + 2 + 32 * a - note_offset, y1 + 34 + 32 * b, song_ins[starta + a, startb + b], song_key[starta + a, startb + b], song_pan[starta + a, startb + b], song_vel[starta + a, startb + b], song_pit[starta + a, startb + b], c, s * 0.8)
}
}
} else {
break
}
} else {
break
}
} else {
break
}
}
draw_theme_color()
}
} else if (dropmode) {
for (a = 0; a < totalcols; a += 1) {
for (b = 0; b <= endb; b += 1) {
if (floor(starta) + a <= enda) {
if (startb + b <= endb) {
if (colamount[starta + a] > 0) {
if (startb + b >= colfirst[starta + a] && startb + b <= collast[starta + a]) {
if (song_exists[starta + a, startb + b]) {
s = 0 // Selected
if (fade=0) c = 0.5 * (song_vel[starta + a, startb + b] / 100) + 0.25
else c = 1
//if (lockedlayer[startb + b] = 0) c += 0.5 * (1 - (min(1000, current_time - song_played[starta + a, startb + b]) / 1000))
if (playing = 0) {
//if (select = 1 && lockedlayer[startb + b] = 0) {
// s = (starta + a >= min(select_pressa, selbx) && starta + a <= max(select_pressa, selbx) && startb + b >= min(select_pressb, selby) && startb + b <= max(select_pressb, selby))
//}
if (fade=0) c += ((selbx = starta + a && selby = startb + b && select = 0 && window = 0 && cursmarker = 0) || s) * 0.5
}
realkey = song_key[starta + a, startb + b] + song_pit[starta + a, startb + b] / 100
draw_block(floor(rw / 2 - (52 * 39) / 2) + floor(19.5 * (realkey + floor(realkey / 12) * 2 + (realkey mod 12 >= 8) + (realkey mod 12 >= 3))) + 4, rh - 154 - a * 32 - 32 + note_offset, song_ins[starta + a, startb + b], song_key[starta + a, startb + b], song_pan[starta + a, startb + b], song_vel[starta + a, startb + b] * (layervol[b] / 100), song_pit[starta + a, startb + b], c, s * 0.8)
}
}
} else {
break
}
} else {
break
}
} else {
break
}
}
draw_theme_color()
}
}
draw_set_alpha(1)
draw_set_halign(fa_left)
// Play column
if (floor(marker_pos) != floor(marker_prevpos) && floor(marker_pos) <= enda && (floor(marker_pos) != section_end || window = w_dragmarker || forward<>0 || marker_end = 0 || marker_prevpos >= section_end)) {
var diff = floor(marker_pos) - floor(marker_prevpos)
var start
if (diff < 0 || diff > 3) {
start = floor(marker_pos)
} else {
start = floor(marker_prevpos) + 1
}
for (i = start; i <= floor(marker_pos); i++) {
xx = i
if (colamount[xx] > 0) {
for (b = colfirst[xx]; b <= collast[xx]; b += 1) {
if (song_exists[xx, b]) {
a = 1
c = 1
d = 0
e = 0
if (b < endb2) {
c = (layervol[b] /100) * song_vel[xx, b]
if layerstereo[b] = 100 {
d = song_pan[xx, b]
} else {
d = (layerstereo[b] + song_pan[xx, b]) / 2
}
e = song_pit[xx, b]
}
if (solostr != "") {
if (string_count("|" + string(b) + "|", solostr) = 0) {
a = 0
} else if (layerlock[b] = 1) {
a = 0
}
} else if (b < endb2) {
if (layerlock[b] = 1) {
a = 0
}
}
if (record = 1 && playing = 1) {
if (current_time - song_added[xx, b] < 1000) a = 0
}
if (a) {
if (song_ins[xx, b].loaded) play_sound(song_ins[xx, b], song_key[xx, b], c , d, e)
if (instrument_list[| ds_list_find_index(instrument_list, song_ins[xx, b])].name = "Tempo Changer") tempo = floor(abs(e)) / 15
if (instrument_list[| ds_list_find_index(instrument_list, song_ins[xx, b])].name = "Toggle Rainbow") {rainbowtoggle = !rainbowtoggle draw_accent_init()}
if (song_ins[xx, b].press || isplayer) key_played[song_key[xx, b]] = current_time
song_played[xx, b] = current_time
}
}
}
}
}
}
if (window = w_dragselection) {
selection_x = starta + floor((mouse_x - (x1 + 2)) / 32) - select_pressa
selection_y = startb + floor((mouse_y - (y1 + 34)) / 32) - select_pressb
curs = cr_size_all
}
// Draw selection
if (selected > 0) selection_draw(x1 + 2 - note_offset, y1 + 34, totalcols, totalrows)
marker_prevpos = marker_pos
if (window = w_dragselection) {
if (!mouse_check_button(mb_left)) {
selection_x = max(0, selection_x)
selection_y = max(0, selection_y)
history_set(h_selectmove, selection_x, selection_y, selection_sx, selection_sy)
window = w_releasemouse
}
}
if (!isplayer) {
// Draw locked layers
for (b = 0; b < totalrows; b += 1) {
if (lockedlayer[startb + b]) draw_sprite_ext(spr_lock, 0, x1 + 2, y1 + 34 + b * 32, totalcols, 1, 0, -1, 0.25)
}
// Controls
if (sela > -1 && selb > -1 && window = 0 && cursmarker = 0 && clickinarea = 1) {
if (mouse_check_button_pressed(mb_left) || mouse_check_button_pressed(mb_right)) {
if (mouse_check_button_pressed(mb_left) && !keyboard_check(vk_control) && selected > 0) {
selection_place(0)
dontplace = 1
}
if (mouse_check_button_pressed(mb_left) && keyboard_check(vk_control)) {selection_add(starta + sela, startb + selb, starta + sela, startb + selb, 0, 0)}
select_pressx = mouse_x
select_pressy = mouse_y
select_pressa = starta + sela
select_pressb = startb + selb
}
if (mouse_check_button(mb_left)) {
if ((starta + sela != select_pressa || startb + selb != select_pressb) && select_pressx != -1) {
select = 1
}
}
if (mouse_check_button_released(mb_left)) {
if (selected = 0) {
if (dontplace = 0) {
if (exist = 1) {
change_block_manual(selbx, selby, instrument, selected_key, selected_vel, selected_pan, selected_pit)
} else {
add_block_manual(starta + sela, startb + selb, instrument, selected_key, selected_vel, selected_pan, selected_pit)
draw_set_halign(fa_center)
draw_block(x1 + 2 + 32 * sela, y1 + 34 + 32 * selb, instrument, selected_key, selected_vel, selected_pan, selected_pit, 0.5, 0)
draw_theme_color()
draw_set_halign(fa_left)
draw_set_alpha(1)
}
}
} else {
if (select = 0 && !keyboard_check(vk_control)) selection_place(0)
}
dontplace = 0
}
if (mouse_check_button_pressed(mb_middle)) {
if (exist = 1) {
selected_key = song_key[selbx, selby]
instrument = song_ins[selbx, selby]
if (keyboard_check(vk_control)) {
selected_vel = song_vel[selbx, selby]
selected_pan = song_pan[selbx, selby]
selected_pit = song_pit[selbx, selby]
} else {
selected_vel = 100
selected_pan = 100
selected_pit = 0
}
play_sound(instrument, selected_key, selected_vel, selected_pan, selected_pit)
}
}
if (mouse_check_button_pressed(mb_right) && keyboard_check(vk_control)) {selection_remove(starta + sela, startb + selb, starta + sela, startb + selb, 0, 0)}
if (mouse_check_button(mb_right) && !keyboard_check(vk_control)) {
if ((starta + sela != select_pressa || startb + selb != select_pressb) && select_pressx != -1) {
select = 2
} else if (exist = 1) {
remove_block_manual(selbx, selby)
select_pressx = -1
}
}
if (mouse_check_button_released(mb_right)) {
if (starta + sela = select_pressa && startb + selb = select_pressb && select_pressx != -1 && !keyboard_check(vk_control)) {
str = ""
customstr = ""
insmenu = 1
for (a = 0; a < ds_list_size(instrument_list); a += 1) {
var ins = instrument_list[| a];
if (ins.user) {
if (language != 1) customstr += "...to " + clean(ins.name) + "|"
else customstr += "...为 " + clean(ins.name) + "|"
} else {
if (language != 1) str += "...to " + clean(ins.name) + "|"
else str += "...为 " + clean(ins.name) + "|"
}
if (a % 25 == 0 && a > 1 && a < ds_list_size(instrument_list) - 1) {
if (language != 1) customstr += "-|More...|\\|"
else customstr += "-|更多......|\\|"
insmenu++
}
}
if (language != 1) menu = show_menu_ext("editext", mouse_x, mouse_y, inactive(selected = 0) + icon(icons.COPY - (selected = 0)) + "Ctrl+C$Copy|"+
inactive(selected = 0) + icon(icons.CUT - (selected = 0)) + "Ctrl+X$Cut|"+
inactive(selection_copied = "") + icon(icons.PASTE - (selection_copied = "")) + "Ctrl+V$Paste|"+
inactive(selected = 0) + icon(icons.DELETE - (selected = 0)) + "Delete$Delete|-|"+
inactive(totalblocks = 0) + "Ctrl+A$Select all|"+
inactive(selected = 0) + "Deselect all|"+
inactive(selected = 0 && totalblocks = 0) + "Ctrl+I$Invert selection|-|"+
inactive(totalblocks = 0 || selbx >= enda) + "Select all to the right ->|"+
inactive(totalblocks = 0 || selbx <= 0) + "Select all to the left <-|-|"+
inactive(instrument.num_blocks = 0) + "Select all " + clean(instrument.name) + "|"+
inactive(instrument.num_blocks = totalblocks) + "Select all but " + clean(instrument.name) + "|-|"+
inactive(selected = 0) + "Ctrl+E$" + get_mode_actions(1) + "|"+
inactive(selected = 0) + "Ctrl+D$" + get_mode_actions(2) + "|"+
inactive(selected = 0) + "Ctrl+R$" + get_mode_actions(3) + "|"+
inactive(selected = 0) + "Ctrl+F$" + get_mode_actions(4) + "|"+
condstr((editmode != m_key), inactive(selected = 0) + "Ctrl+T$" + get_mode_actions(5) + "|") +
condstr((editmode != m_key), inactive(selected = 0) + "Ctrl+G$" + get_mode_actions(6) + "|") +
inactive(selected = 0) + "Change instrument...|\\|" + str + condstr(customstr != "", "-|") + customstr + string_repeat("/|", insmenu) + "-|" +
inactive(selected = 0 || selection_l = 0) + "Expand selection|"+
inactive(selected = 0 || selection_l = 0) + "Compress selection|"+
inactive(selected = 0 || selection_l = 0) + "Macros...|\\||"+
"Ctrl+Shift+A$Tremolo...|"+
"Ctrl+Shift+S$Stereo...|"+
"Ctrl+Shift+D$Arpeggio...|"+
"Ctrl+Shift+F$Portamento...|"+
"Ctrl+Shift+G$Vibrato|"+
"Ctrl+Shift+H$Stagger...|"+
"Ctrl+Shift+J$Chorus|"+
"Ctrl+Shift+K$Volume LFO|"+
"Ctrl+Shift+Q$Fade in|"+
"Ctrl+Shift+W$Fade out|"+
"Ctrl+Shift+E$Replace key|"+
"Ctrl+Shift+R$Set velocity...|"+
"Ctrl+Shift+T$Set panning...|"+
"Ctrl+Shift+Y$Set pitch...|"+
"Ctrl+Shift+U$Reset all properties|"+
"/|-|"+
inactive(selected = 0) + "Transpose notes outside octave range|")
else menu = show_menu_ext("editext", mouse_x, mouse_y, inactive(selected = 0) + icon(icons.COPY - (selected = 0)) + "Ctrl+C$复制|"+
inactive(selected = 0) + icon(icons.CUT - (selected = 0)) + "Ctrl+X$剪切|"+
inactive(selection_copied = "") + icon(icons.PASTE - (selection_copied = "")) + "Ctrl+V$粘贴|"+
inactive(selected = 0) + icon(icons.DELETE - (selected = 0)) + "Delete$删除|-|"+
inactive(totalblocks = 0) + "Ctrl+A$全选|"+
inactive(selected = 0) + "全不选|"+
inactive(selected = 0 && totalblocks = 0) + "Ctrl+I$选择反转|-|"+
inactive(totalblocks = 0 || selbx >= enda) + "选择右侧所有 ->|"+
inactive(totalblocks = 0 || selbx <= 0) + "选择左侧所有 <-|-|"+
inactive(instrument.num_blocks = 0) + "选择所有 " + clean(instrument.name) + "|"+
inactive(instrument.num_blocks = totalblocks) + "选择所有除了 " + clean(instrument.name) + "|-|"+
inactive(selected = 0) + "Ctrl+E$" + get_mode_actions(1) + "|"+
inactive(selected = 0) + "Ctrl+D$" + get_mode_actions(2) + "|"+
inactive(selected = 0) + "Ctrl+R$" + get_mode_actions(3) + "|"+
inactive(selected = 0) + "Ctrl+F$" + get_mode_actions(4) + "|"+
condstr((editmode != m_key), inactive(selected = 0) + "Ctrl+T$" + get_mode_actions(5) + "|") +
condstr((editmode != m_key), inactive(selected = 0) + "Ctrl+G$" + get_mode_actions(6) + "|") +
inactive(selected = 0) + "更改音色......|\\|" + str + condstr(customstr != "", "-|") + customstr + string_repeat("/|", insmenu) + "-|" +
inactive(selected = 0 || selection_l = 0) + "扩展选区|"+
inactive(selected = 0 || selection_l = 0) + "压缩选区|"+
inactive(selected = 0 || selection_l = 0) + "快捷键......|\\||"+
"Ctrl+Shift+A$Tremolo...|"+
"Ctrl+Shift+S$Stereo...|"+
"Ctrl+Shift+D$Arpeggio...|"+
"Ctrl+Shift+F$Portamento...|"+
"Ctrl+Shift+G$Vibrato|"+
"Ctrl+Shift+H$Stagger...|"+
"Ctrl+Shift+J$Chorus|"+
"Ctrl+Shift+K$Volume LFO|"+
"Ctrl+Shift+Q$淡入|"+
"Ctrl+Shift+W$淡出|"+
"Ctrl+Shift+E$替换音|"+
"Ctrl+Shift+R$设定音量......|"+
"Ctrl+Shift+T$设定声道......|"+
"Ctrl+Shift+Y$设定音高......|"+
"Ctrl+Shift+U$重置所有属性|"+
"/|-|"+
inactive(selected = 0) + "转换所有超出八度范围的音符|")
menu.menuc = selbx
menu.pastex = selbx
menu.pastey = selby
}
}
}
}
// Keyboard shortcuts
if (window = 0 && text_focus = -1) {
if (playing = 0) {
if (keyboard_check(vk_control) && !keyboard_check(vk_shift)) {
if (keyboard_check_pressed(ord("N")) && !isplayer) new_song()
if (keyboard_check_pressed(ord("O"))) load_song("")
if (keyboard_check_pressed(ord("S")) && !isplayer) save_song(filename)
if (keyboard_check_pressed(ord("A")) && !isplayer) select_all(-1, 0)
if (keyboard_check_pressed(ord("A")) && keyboard_check(vk_shift) && !isplayer) selection_place(0)
if (keyboard_check_pressed(ord("I")) && !isplayer) selection_invert()
if (keyboard_check_pressed(ord("C")) && !isplayer) action_copy()
if (keyboard_check_pressed(ord("X")) && !isplayer) action_cut()
if (keyboard_check_pressed(ord("V")) && !isplayer) {
if (selbx > -1 && selby > -1) action_paste(selbx, selby)
else action_paste(starta, startb)
}
if (keyboard_check_pressed(ord("Z")) && !isplayer) action_undo()
if (keyboard_check_pressed(ord("Y")) && !isplayer) action_redo()
if (keyboard_check_pressed(ord("E")) && !isplayer) mode_action(1)
if (keyboard_check_pressed(ord("D")) && !isplayer) mode_action(2)
if (keyboard_check_pressed(ord("R")) && !isplayer) mode_action(3)
if (keyboard_check_pressed(ord("F")) && !isplayer) mode_action(4)
if ((editmode != m_key) && (keyboard_check_pressed(ord("T"))) && !isplayer) mode_action(5)
if ((editmode != m_key) && (keyboard_check_pressed(ord("G"))) && !isplayer) mode_action(6)
if (keyboard_check_pressed(ord("P"))) window = w_preferences
if keyboard_check_pressed(ord("0")) {
window_scale = get_default_window_scale()
set_msg(condstr(language = 1, "窗口缩放", "Window scale") + " => " + string(window_scale * 100) + "%")
}
if (keyboard_check_pressed(187) || (mouse_wheel_up())) {
if (window_scale >= 0.5 && window_scale < 0.67) {window_scale = 0.67}
else if (window_scale < 0.75) {window_scale = 0.75}
else if (window_scale < 0.8) {window_scale = 0.8}
else if (window_scale < 0.9) {window_scale = 0.9}
else if (window_scale < 1) {window_scale = 1}
else if (window_scale < 1.25) {window_scale = 1.25}
else if (window_scale < 1.5) {window_scale = 1.5}
else if (window_scale < 1.75) {window_scale = 1.75}
else if (window_scale < 2) {window_scale = 2}
else if (window_scale < 2.5) {window_scale = 2.5}
else if (window_scale < 3) {window_scale = 3}
else if (window_scale < 3.5) {window_scale = 3.5}
else if (window_scale < 4) {window_scale = 4}
set_msg(condstr(language = 1, "窗口缩放", "Window scale") + " => " + string(window_scale * 100) + "%")
}
if (keyboard_check_pressed(189) || (mouse_wheel_down())) {
if (window_scale <= 4 && window_scale > 3.5) {window_scale = 3.5}
else if (window_scale > 3) {window_scale = 3}
else if (window_scale > 2.5) {window_scale = 2.5}
else if (window_scale > 2) {window_scale = 2}
else if (window_scale > 1.75) {window_scale = 1.75}
else if (window_scale > 1.5) {window_scale = 1.5}
else if (window_scale > 1.25) {window_scale = 1.25}
else if (window_scale > 1) {window_scale = 1}
else if (window_scale > 0.9) {window_scale = 0.9}
else if (window_scale > 0.8) {window_scale = 0.8}
else if (window_scale > 0.75) {window_scale = 0.75}
else if (window_scale > 0.67) {window_scale = 0.67}
else if (window_scale > 0.5) {window_scale = 0.5}
set_msg(condstr(language = 1, "窗口缩放", "Window scale") + " => " + string(window_scale * 100) + "%")
}
}
if (keyboard_check_pressed(vk_delete) && selected > 0 && !isplayer) {
selection_delete(0)
changed = 1
}
if (sb_sel = 0 && !isplayer) {
if (keyboard_check_pressed(vk_home)) starta = 0
if (keyboard_check_pressed(vk_end)) starta = enda
if (keyboard_check_pressed(vk_pageup)) starta += totalcols
if (keyboard_check_pressed(vk_pagedown)) starta -= totalcols
starta = median(0, starta, enda)
sb_val[0] = starta
}
if (sb_sel = 1 && !isplayer) {
if (keyboard_check_pressed(vk_home)) startb = 0
if (keyboard_check_pressed(vk_end)) startb = endb
if (keyboard_check_pressed(vk_pageup)) startb += totalrows
if (keyboard_check_pressed(vk_pagedown)) startb -= totalrows
startb = median(0, startb, endb)
sb_val[1] = startb
}
}
if (keyboard_check(vk_right)) forward = 1
if (keyboard_check(vk_left)) forward = -1
if (keyboard_check_pressed(vk_enter)) {
playing = 0
marker_pos = 0
marker_prevpos = 0
}
if (keyboard_check_pressed(vk_space)) toggle_playing(totalcols) timestoloop = real(loopmax)
if (keyboard_check_pressed(vk_f1)) {
if (language != 1) open_url("http://www.youtube.com/playlist?list=PL7EA4F0D271DA6E86")
else open_url("https://www.bilibili.com/video/BV1Mx411a76p")
}
// Instrument shortcuts
if (keyboard_check_pressed(vk_f5) && keyboard_check(vk_control) && keyboard_check(vk_shift) && theme = 3) {
rainbowtoggle = !rainbowtoggle
if (language != 1) {
if (rainbowtoggle) {
set_msg("Rainbow mode => ON")
} else {
set_msg("Rainbow mode => OFF")
draw_accent_init()
}
} else {
if (rainbowtoggle) {
set_msg("炫彩模式 => ON")
} else {
set_msg("炫彩模式 => OFF")
draw_accent_init()
}
}
}
if (!isplayer) {
if (keyboard_check(vk_control)) {
//First 9 (only ctrl)
if(!keyboard_check(vk_shift)){
for (a = 1; a <= 9; a++) {
if (keyboard_check_pressed(ord(string(a % 10)))) {
instrument = instrument_list[| a - 1]
selected_vel = 100
selected_pan = 100
selected_pit = 0
play_sound(instrument, selected_key, 100 ,100, 0)
}
}
}else{
//Last 7 (ctrl+shift)
for (a = 1; a <= 7; a++) {
if (keyboard_check_pressed(ord(string(a % 10)))) {
instrument = instrument_list[| a + 8]
selected_vel = 100
selected_pan = 100
selected_pit = 0
play_sound(instrument, selected_key, 100 ,100, 0)
}
}
}
}
// Control+Shift Stuff (Macros, Clip Editor)
if (keyboard_check(vk_control)) {
if (keyboard_check_pressed(ord("P"))&& keyboard_check(vk_shift)) {
playing = 0
text_exists[59] = 0
window = w_clip_editor
}
if (keyboard_check_pressed(ord("I"))&& keyboard_check(vk_shift)) {
playing = 0
window = w_tempotapper
}
// Macro Hotkeys
if selected != 0 {
if (keyboard_check_pressed(ord("A"))&& keyboard_check(vk_shift)) {
playing = 0
window = w_tremolo
}
if (keyboard_check_pressed(ord("S"))&& keyboard_check(vk_shift)) {
playing = 0
window = w_stereo
}
if (keyboard_check_pressed(ord("D"))&& keyboard_check(vk_shift)) {
playing = 0
window = w_arpeggio
}
if (keyboard_check_pressed(ord("F"))&& keyboard_check(vk_shift)) {
playing = 0
window = w_portamento
}
if (keyboard_check_pressed(ord("G"))&& keyboard_check(vk_shift)) {
playing = 0
macro_vibrato()
}
if (keyboard_check_pressed(ord("H"))&& keyboard_check(vk_shift)) {
playing = 0
window = w_stagger
}
if (keyboard_check_pressed(ord("J"))&& keyboard_check(vk_shift)) {
playing = 0
macro_chorus()
}
if (keyboard_check_pressed(ord("K"))&& keyboard_check(vk_shift)) {
playing = 0
macro_velocitylfo()
}
if (keyboard_check_pressed(ord("Q"))&& keyboard_check(vk_shift)) {
playing = 0
macro_fadein()
}
if (keyboard_check_pressed(ord("W"))&& keyboard_check(vk_shift)) {
playing = 0
macro_fadeout()
}
if (keyboard_check_pressed(ord("E"))&& keyboard_check(vk_shift)) {
playing = 0
macro_replacekey()
}
if (keyboard_check_pressed(ord("R"))&& keyboard_check(vk_shift)) {
playing = 0
window = w_setvelocity
}
if (keyboard_check_pressed(ord("T"))&& keyboard_check(vk_shift)) {
playing = 0
window = w_setpanning
}
if (keyboard_check_pressed(ord("Y"))&& keyboard_check(vk_shift)) {
playing = 0
window = w_setpitch
}
if (keyboard_check_pressed(ord("U"))&& keyboard_check(vk_shift)) {
playing = 0
macro_reset()
}
}
}
}
}
if (keyboard_check_pressed(vk_f7) && playing = 0) {
if (refreshrate = 0){
game_set_speed(60,gamespeed_fps)
refreshrate = 1
if (language != 1) set_msg("Max framerate => 60 FPS")
else set_msg("帧数上限 => 60 FPS")
} else if (refreshrate = 1) {
game_set_speed(120,gamespeed_fps)
refreshrate = 2
if (language != 1) set_msg("Max framerate => 120 FPS")
else set_msg("帧数上限 => 120 FPS")
} else if (refreshrate = 2) {
game_set_speed(144,gamespeed_fps)
refreshrate = 3
if (language != 1) set_msg("Max framerate => 144 FPS")
else set_msg("帧数上限 => 144 FPS")
} else if (refreshrate = 3) {
game_set_speed(240,gamespeed_fps)
refreshrate = 4
if (language != 1) set_msg("Max framerate => 240 FPS")
else set_msg("帧数上限 => 240 FPS")
} else if (refreshrate = 4) {
game_set_speed(30,gamespeed_fps)
refreshrate = 0
if (language != 1) set_msg("Max framerate => 30 FPS")
else set_msg("帧数上限 => 30 FPS")
}
}
if (keyboard_check_released(vk_f3) && !debug_option) debug_overlay = !debug_overlay
if (keyboard_check(vk_f3)) {
if (keyboard_check_released(ord("C"))){
window = 0
debug_option = 1
set_msg("[Debug] Window => 0")
}
//if (keyboard_check_released(ord("D")) && isplayer) {
// if (!dropmode) window_maximize()
// //else window_set_size(floor(800 * window_scale), floor(500 * window_scale))
// else window_setnormal()
// dropmode = !dropmode
// debug_option = 1
// set_msg("[Debug] Toggle experimental drop mode")
//}
}
if (keyboard_check_released(vk_f3)) debug_option = 0
if (!isplayer) {
// Selecting note blocks
if (select > 0) {
curs = cr_handpoint
window = 0.1
x2 = mouse_x
y2 = mouse_y
if (starta = 0) x2 = max(x1 + 2, mouse_x)
if (startb = 0) y2 = max(y1 + 34, mouse_y)
if (theme != 3) {
draw_set_color(c_blue)
if (select = 2) draw_set_color(c_red)
} else {
draw_set_color(14120960)
if (select = 2) draw_set_color(c_red)
}
draw_set_alpha(0.25)
draw_rectangle(select_pressx, select_pressy, x2, y2, 0)
draw_set_alpha(1)
draw_rectangle(select_pressx, select_pressy, x2, y2, 1)
draw_theme_color()
}
// Timeline and markers
if (hires && theme = 3) gpu_set_texfilter(false)
draw_sprite_ext(spr_timeline, (0 + theme = 2 + (fdark && theme = 3)) * !blackout + blackout * 2, x1 + 2, y1 + 2, totalcols * 32 + 18, 1, 0, -1, 1)
if (hires && theme = 3) gpu_set_texfilter(true)
draw_theme_font(font_small)
draw_set_halign(fa_left)
draw_theme_color()
if (blackout) draw_set_color(c_white)
c = 1
if (tempo < 3.5) c = 5
if (tempo < 1) c = 10
if (tempo < 0.5) c = 30
if (tempo > 11) c = 0.5
if (tempo > 18) c = 0.25
a = ceil(starta / (tempo * c)) * c
xx = (ceil(starta / (tempo * c)) - (starta / (tempo * c))) * (32 * tempo * c)
while (xx < totalcols * 32 + 16) {
if (a > 0) draw_set_halign(fa_center)
if (!hires || obj_controller.theme != 3) draw_text(x1 + 2 + xx - note_offset, y1 + 2, time_str(a))
else draw_text_transformed(x1 + 2 + xx - note_offset, y1 + 2, time_str(a), 0.25, 0.25, 0)
draw_set_alpha(0.6)
draw_line(x1 + 2 + xx - note_offset, y1 + 2 + 12, x1 + 2 + xx - note_offset, y1 + 2 + 15)
draw_set_alpha(1)
draw_set_halign(fa_left)
xx += (32 * tempo) * c
a += c
}
for (a = 0; a <= totalcols; a += 1) {
b = ((starta + a) mod 4 == 0)
draw_set_alpha(0.6)
draw_line(x1 + 2 + 32 * a - note_offset, y1 + 33, x1 + 2 + 32 * a - note_offset, y1 + 30 - 3 * b)
draw_set_alpha(1)
if (b) {