-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApply_Palette_Symbols_MU4.txt
3850 lines (3539 loc) · 129 KB
/
Apply_Palette_Symbols_MU4.txt
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
; AutoHotkey version 1.1.36.02 download on https://github.com/AutoHotkey/AutoHotkey/releases
; latest version v1.1.36.02 NOT v2.00 or v2.0.2 - Click 'Assets'
; download AutoHotkey_1.1.36.02_setup.exe - 3.19 MB - Dec 7, 2022
; AutoHotkey comes with a script called Window Spy, which can be used to confirm the title, class and process name
; of a window. the class and process name are often used when identifying a window by title alone is not feasible.
; you can find Window Spy in the script's tray menu or the AutoHotkey Dash.
; with a double click on an AHK file in the script's tray menu you can inspect command execution
; to get pixel precision use the tool PixelMousing which is part of this kit
; in the NotePad View menu: switch Word wrap OFF
; search with (*change*?) to customize the position of some tooltips and offsets
#NoEnv ; recommended for performance and compatibility with future AutoHotkey releases.
#Warn ; enable warnings to assist with detecting common errors.
SendMode Input ; recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; ensures a consistent starting directory
#SingleInstance force ; replaces script (reloads).
#Persistent ; to make it run indefinitely
#IfWinActive ahk_exe C:\Program Files\MuseScore 4\bin\MuseScore4.exe ; (*) enables Hotkeys when MuseScore4 Window is Active
; (*) Check the path C:\Program Files\MuseScore 4\bin\MuseScore4.exe.
; if different: replace it with your location of MuseScore4.exe
; NB: AutoHotkey does not read the lines after semicolon and space. they don't influence speed of execution.
; Liberate (or redefine) MU4 shortcut keys to enable them as Prefix keys in AHK.
; the macros presuppose a 'Defined State'. the MU4 window must be in a fixed screen layout of your choice.
; it is essential that all panels are always docked and the statusbar must always be visible.
; in normal operation the F789 SideBar contains all 3 Radio Buttons: Instruments, Properties and Palettes.
; in this document the F789 SideBar is docked left, but you can choose a different MU4 screen layout.
; the macros may not allow unpredictable edits. for instance in your chosen layout the ToolBar Note Input TBNI
; must always be absent but you have it switched on a moment ago. now the F789 sidebar titles are NOT in their
; defined state, they are too low. for safety reasons macro execution must now be prevented.
; a 'wrong' layout increases the chance for a misbehaving mouse in the Canvas Search Area (see below) as well.
; to test the layout we need some checks each having its own subroutine. these concern the position of the
; ToolBar Note Input TBNI, the StatusBar and (related) the screen size (full or maximized)
; the Defined_State_Check:
; to check the TBNI position we need an image (.png), created by Windows Snipping Tool,named Def_State_4_Dots.png.
; this small image - 4 dots! - is present in the 4 possible positions of the 6 Dots shwon by the TBNI,
; horizontal high or low and vertical left or right
; the AHK ImageSearch command will scan all surfaces where this image may appear to detect its presence
; how to determine the search area of images? TIP(§)
; start PixelMousing, doubleclick the png, measure width and height of the image, if in doubt increase the
; found numbers a tiny bit
; Press Z + U to open the utilities. in the help file find the number of the image you want to test
; and input the number, for the TBNI it is 1
; make the screen Max or Full (according to your chosen layout). now the screen is searched, the image is found
; and the mouse moves to its Upper Left Corner ULC. make a note of the X- and Y-coordinates. decrease the found X by 1px.
; you have found X1. add the earlier found width to X1 and increase by 2. You have found X2.
; idem for Y. decrease the found Y by 1px to determine Y1. add the height to Y1 and increase by 2.
; you now have found Y2. replace the numbers (below) in this auto-execute section of the script by your own numbers
; you'll have to determine the coordinates of 4 small search areas, for each possible position of a docked TBNI,
; even if you don't need the toolbar!
; in the five lines below you see 4 lines 'outcommented' - switched off - by a semicolon and a space
; this reflects my personal favorite: i prefer maximum real estate and don't need the ToolBar Note Input TBNI.
; if you prefer another layout put a semicolon and a space before this line and enable your favorite
; by deleting the semicolon and space in front of it (and save this ahk file)
TBNI_Pos := "no" ; no ToolBar Note Input
; TBNI_Pos := "hh" ; ToolBar Note Input is horizontal high
; TBNI_Pos := "hl" ; ToolBar Note Input is horizontal low
; TBNI_Pos := "vl" ; ToolBar Note Input is vertical left
; TBNI_Pos := "vr" ; ToolBar Note Input is vertical right
4_Dots_HH_X1 := 6 ; HH - TBNI in horizontal high position
4_Dots_HH_Y1 := 72
4_Dots_HH_X2 := 29
4_Dots_HH_Y2 := 100
4_Dots_HL_X1 := 4_Dots_HH_X1 ; HL - TBNI in horizontal low position
4_Dots_HL_Y1 := 1370
4_Dots_HL_X2 := 4_Dots_HH_X2
4_Dots_HL_Y2 := 1411
4_Dots_VL_X1 := 33 ; VL - TBNI in vertical left position
4_Dots_VL_Y1 := 69
4_Dots_VL_X2 := 67
4_Dots_VL_Y2 := 98
4_Dots_VR_X1 := 2517 ; VR - TBNI in vertical right position
4_Dots_VR_Y1 := 4_Dots_VL_Y1
4_Dots_VR_X2 := A_ScreenWidth
4_Dots_VR_Y2 := 4_Dots_VL_Y2
; the Full_Max_Check checks your screen size, an important part of your Defined State.
; the check uses the image Def_State_Zoom_Tools.png
; if the image is not found within the StatusBar macro execution is delayed and the subroutine
; sets immediately the correct screen size corresponding with the height of the StatusBar within
; your chosen layout, maximized or full. For the surface area of the StatusBar see below.
; RELATED - the HEIGHT of the MU4 WINDOW WHEN MAXIMIZED
; to find the MU4_Max_Window_Height: run PixelMousing. put the cursor in the upper left corner of the screen.
; press WIN + Up to maximize the MU4 window. Check the coordinates.
; if they are NOT 0,0 press WIN + Up again. the coordinates must become 0,0.
; now put the mouse cursor at the bottom of the screen. pixel mouse upward until the cursor changes shape.
; go 1 px down, the cursor appears as an arrow again. write down the number of MU4_Max_Window_Height
; see also below: intermediate screen size change
MU4_Max_Window_Height := 1392
; a simple protection against unwanted edits:
; when you press F9 and the Palettes sidepanel disappears the hotkey Z+A will be disabled
; a MessageBox will appear signalling this situation
; NAVIGATION - START
; for the 'navigation principles' see https://musescore.org/en/handbook/4/accessibility#keyboard-access
; to start navigating within the F789 SideBar panels AutoHotkey needs a fixed point of departure
; it first has to find the radio button 'Home'
; the image must show its selected state with the black line between 'Home' and 'Score'
; it is created by first making a screenshot of the upper left area of MU4, pasted in a text editor.
; these are the coordinates of the surface in which the image Def_State_Nav_to_Home.png will be found on the test screen
Nav_Home_X1 := 0 ; area occupied by the radio button 'Home' in its selected state
Nav_Home_Y1 := 32 ; X1 and Y1 determine the upper left corner ULC of the image
Nav_Home_X2 := 70 ; X2 and Y2 the lower right corner LRC
Nav_Home_Y2 := 68 ; make the search area a tiny bit bigger than the image, see TIP(§) above
; NAVIGATION - FINDING and ACTIVATING THE SIDEPANELS
; we have three titles, so we need 6 images, each title in its selected and unselected state
; the subroutine F7_F8_F9_Tab_Title_Check: must activate the needed sidepanel even if currently absent
; we must define the search area for the images of the titles 'Palettes' ,'Properties', 'Instruments'
; the coordinates below are valid on the testscreen (resolution 2560 X 1440) for that Defined State
; in which there is no TBNI (or maybe the TBNI is Horizontal Low or Vertical Right)
; it will be clear that a vertical left TBNI shifts the search area of the Titles to the right.
; determine the coordinates for the layout of your choice
F7_F8_F9_Tab_Title_X1 := 0 ; search area for the titles 'Palettes' ,'Properties', 'Instruments'
F7_F8_F9_Tab_Title_Y1 := 68
F7_F8_F9_Tab_Title_X2 := 300 ; this X is on the separator line of SideBar <> Canvas
F7_F8_F9_Tab_Title_Y2 := 104 ; see TIP§ above
; (‡) we don't want the mouse to click on the Upper Left Corner ULC of a title image. too risky, we need an offset
; check with the tool PixelMousing if the offset given below works also for your screen
; as mentioned you can find the ULC with the utility Z+U which of course also checks if the image is recognized at all
X_Offset_F7_F8_F9_Tab_Title := 20 ; 20 pixels more to the right and
Y_Offset_F7_F8_F9_Tab_Title := 15 ; 15 down relative to ULC of the selected image
; the Defined State is also important if we immediately want to attach the chosen symbol again
; although many symbols can be attached in one go using a range or list selection.
; imagine we have added a tremolo - via Z+A and immediately want to attach it somewhere else.
; the fastest way is by pressing WIN + / by which the macro simply clicks the already selected palette cell.
; it finds the cell by its color (more about colors below), but we have to tell it where to search.
; dynamics need the biggest search area. press Control+F9 and type 'dy'.
; determine the coordinates for your favorite layout
Side_Bar_X1 := 0 ; extreme left
Side_Bar_Y1 := 180 ; just under the Palette category title ▼ Dynamics
Side_Bar_X2 := 300 ; separation Sidebar and Canvas
Side_Bar_Y2 := 520 ; just under the cell mf < of ▼ Lines
; determining the Canvas Surface Area
CSA_X1 := 304 ; Canvas Surface Area - the real estate
CSA_Y1 := 96 ; CSA_X1, CSA_Y1 is upper left corner, just to the right of the Sidebar
CSA_X2 := 2559 ; CSA_X2, CSA_Y2 define the lower right corner, the screenwidth
CSA_Y2 := 1410 ; just above the Statusbar
; the InputBox 'Apply Symbols from Palette'appears after pressing Z + A
; use the AHK utility Window Spy to determine size and position of this InputBox.
; in this example the InputBox is positioned in the SideBar (at the left), just above the StatusBar.
; the appearance of the InputBox forces the screen temporarily to its maximized state.
W_IB := 302 ; Width of InputBox in left side bar
H_IB := 103 ; Height of InputBox idem
IB_X := 0 ; X-pos top left corner InputBox in left side bar
IB_Y := 1282 ; Y-pos top left corner InputBox idem
; THE STATUSBAR - in many situations we use images of its messages, enhancing macro functionality
; search area - surface in which an image - e.g. StatusBar_Range_Selection.png - will be found.
; the given settings are for Full Screen.
SB_X1 := 0 ; the search area is the narrow ribbon at the bottom
SB_Y1 := 1411 ; across the full width of of the screen.
; SB_Y1 := 1364 ; in Maximized Screen
SB_X2 := A_ScreenWidth ; width and height are known and represented by the AHK inbuilt variables
SB_Y2 := A_ScreenHeight ; A_ScreenWidth and A_ScreenHeight - here Full Screen is enabled
; SB_Y2 := 1392 ; in Maximized Screen
; all StatusBar images but one are searched within this surface area
; the EXCEPTION is the image Nothing_Selected.png, it consists of an empty area extreme left within the StatusBar
; the StatusBar will be searched from the left (X1=0). but X2 is determined by its width + 1 px
Width_Nothing_Selected := 60 ; doubleclick Nothing_Selected.png and measure the width using PixelMousing
; make 'Width_Nothing_Selected' just a bit bigger than the found width
; AHK can search for a specific color. this functionality increases the efficiency of any workflow
; the command ColorSearch also takes care of the return to the Canvas after an edit in a side panel
ColorV1 := 0x0065bf ; Preferences > Advanced: engraving/colors
ColorV2 := 0x007f00 ; engraving/colors/voice1, idem 2 3 and 4
ColorV3 := 0xc53f00 ; 0x is the AHK equivalent of # in the window Select Color
ColorV4 := 0xc31989 ; the numbers are the default values. change them when you use custom colors
Color_LBC := 0xa0a0a4 ; Layout Break Color - see below
Color_Selected_PalCell := 0xb7d7f4 ; idem of a selected cell e.g. the dynamic pppppp
Color_Beam_Type_Auto := 0xb7d7f4 ; color field when beaming is auto
; the fields having the last 2 colors change color when the mouse hovers over them.
; to prevent that change we first open another window e.g. Preferences
; now we can find the color number using the utility Z+/ (which is part of this kit) or Window Spy
; for the palette cell color press Control + F9, type 6xp (pppppp) in the Palettes search field and press Tab
; after pressing Tab press right and down. pppppp is selected.
; put the mouse on a colored spot within the pppppp palette cell. press Z+/
; repeat the procedure to find Color_Beam_Type_Auto in the Properties side panel
; Layout Break Color: in Continuous view set a high zoom factor and put the mouse on a (greyish) time signature. press Z+/
; some macros have extra functionality giving immediate access to the 'Properties' panel.
; a special case is 'feathered beams'. but creating them via the Palette makes a return to the Canvas impossible.
; that's why they are created in 'Properties'. however to make this full proof AHK needs an extra check.
; we need AHK to search for the Color_Beam_Type_Auto in this area:
Beam_Type_Auto_X1 := 18 ; if the beaming of the feathered beam is not 'Auto' the field 'Reset beam type'
Beam_Type_Auto_Y1 := 403 ; is active. This adds an extra field. So when we need to reset a feathered beam
Beam_Type_Auto_X2 := 59 ; we have in this case to add an extra 'Down stroke' to reach the field 'None'.
Beam_Type_Auto_Y2 := 443 ; AHK checks if the field 'Auto' is colored to determine what to do.
; INTERMEDIATE SCREEN SIZE CHANGE - FULL OR MAX
; the hotkey CapsLock + A toggles full/max screen. advantage: in *both* screen sizes you now can press WIN + Down
; to minimize MU4. this hotkey does NOT use the MU4 shortcut for Full Screen.
; in this way we avoid some particular problems of early versions of MU4. moreover the Canvas is a tiny bit bigger.
; SETTING YOUR PREFERRED SCREEN SIZE
; if you prefer Maximized screen remove the semicolon plus space in the second line and put them before the first
Screen := "full" ; defined state - Full Screen
; Screen := "max" ; defined state - Maximized Screen
; some initial values
Toggle_Screen_Full_Max := 1 ; just a declaration - leave it as it is
Toggle_F9 := 0 ; idem
Counter_F9 := 0 ; idem
Show_Palettes := 1 ; idem
Range_Selection := "" ; idem
Side_Bar_Tab_Old := "" ; idem
Side_Bar_Tab := "" ; idem
PaletteSymbolOld := "" ; idem
Return_to_Canvas := "" ; idem
Repeat_Glyph_X := "" ; idem
Repeat_Glyph_Y := "" ; idem
Offset_Glyph := 15 ; palette cell selected, we need an offset as mentioned above (‡)
; 15 pixels more right and idem lower relative to the upper left corner
; determine the offset for your system
; ♣===================================== SLEEP TIMES ==============================================
; after a command the sleep time (in milliseconds) gives MU4 and/or Win OS time to respond
; e.g a mousemove and click on the test screen needs a sleep of 200 ms, statusbar images usually 150 ms
; commands working globally - e.g. inserting a repeat barline - usually need more time
; reaction times for showing windows or submenus vary greatly in MU4
; in the lines below you can optimize the sleep times for your system in one go
; e.g change all sleep times set on 100 ms to 90 ms. -> Sleep_100 := 90
Sleep_25 := 25
Sleep_30 := 30
Sleep_50 := 50
Sleep_80 := 80
Sleep_100 := 100
Sleep_150 := 150
Sleep_200 := 200
Sleep_250 := 250
Sleep_300 := 300
Sleep_400 := 400
Sleep_500 := 500
; ====================================== MATCHLIST UTILITIES ======================================
; allowed input in Z+U , utilities hotkey
MatchListUtilities = ?,Help = Questionmark,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
; ======================================= MATCHLIST PALETTES ======================================
; change this only if you know what you're doing
; allowed input in Z+A palettes hotkey. new shortcuts always have to be inserted in this list
; of course duplicates are not allowed
; MatchListPalettes: line 1+2+3+4 dynamics, 5+6+7 articulations, 8+9+10 clefs, 11 ornaments, 12 barlines,
; 13 rbl > reset barline span to default, r > repeat command
; 14 breaths & pauses, 15+16 accidentals, 17 key signatures, 18+19 repeats & jumps, 20 grace notes
; 21+22 arpeggioss and glissandi, 23 pitch lines, 24 keyboard, 25 other lines, 26+27 text, 28 time signatures,
; 29 tremolos, 30+31+32+33+34+35 tempo, 36 noteheads, 37 layout, 38 beam props, 39 brackets, 40 fingering,
; 41 fretboard diagrams, 42 guitar, 43 harp, 44+45 info screens
MatchListPalettes = c,cinv,d,dinv,pppppp,ppppp,pppp,ppp,pp,p,mp,mf,f,ff,fff,ffff,fffff,ffffff
,fp,pf,sf,sfz,sff,sffz,sfp,sfpp,rfz,rf,fz,m*,r*,s*,z*,n*,mf<
,=pppppp,=ppppp,=pppp,=ppp,=pp,=p,=mp,=mf,=f,=ff,=fff,=ffff,=fffff,=ffffff
,=fp,=pf,=sf,=sfz,=sff,=sffz,=sfp,=sfpp,=rfz,=rf,=fz,=m*,=r*,=s*,=z*,=n*
,a,.,..,t,t.,.t,l.,.l,m,a.,.a,lv,m.,.m,mt,p.,tm,..s,..w,w..,str,ta,at
,unstr,sa,sa.,sat,sat.,fi,fo,vs,sls,swls,vlf,vls,o,+,h,ub,db,sp,b,tb
,>,>.,.>,:,_,-.,._,^,^.,.^,^_,_^,../,/..,..','..,_>,>_,<>,<.>,<_>,<_.>,<._>,'
,clt,clt8va,clt15ma,clt8vb,clt15vb,cldt8vb,clto8vb,clfvc,cls,clms,cla,clten,clbar
,clb,clb8va,clb15ma,clb8vb,clb15mb,clbarf,clsb,clp,clp2,cltab,cltab4
,clc19,cls18,cla18,clt18,clf18,cls20,cla20,clt20,clf19,cltabs,cltabs4
,-t,-turn,+t,+turn,turn,tr,im,trmb,prm,upr,mor,mup,upm,pdn,dnm,pup,lpr,sl,slide,shtr,+t/,trl,upl,dpl,ppl
,|,||,|:,:|,:||:,1:||:2,dash,----,fbl,|||,bl.,....,bt1,bt2,bs1,bs2,rfbl,hbl,hdbl
,rbl,r
,fm,sfm,lfm,lfmh,sfmh,vlfm,vsfm,bmc,bmt,bms,salz,bmv,c),c/,c||,c//,cal
,!,@,#,##,!!,@!,@#,1fb,1fn,1sn,1s#,3fb,3fbb,3sx,3s#,5fbb,5sx,,upb,dnb
,upn,ndn,sup,dns,xup,dnx,bupb,dnbb,ardn,arf,arup,ars,[],()
,1#,2#,3#,4#,5#,6#,7#,7b,6b,5b,4b,3b,2b,1b,0#0b,xsig
,rlm,r2m,r4m,seg,segv,coda,codav,fine,tct,tcs,dc,dcaf,dcac,dcadc,dacoda
,da2coda,ds,dss,dsac,dsaf,dssac,dssadc,dssaf,1v,2v,2vo,3v,vibsaw,tremsaw
,ac,acs,ap,aps,g4,g16,g32,g8a,g16a,g32a
,arp,aru,ard,arru,arrd,arb,arbr,gls,glw,fal,fall,doi,doit,plo,plop
,sco,scoop,sod,slod,sou,slou,sia,slia,sib,slib
,8va,8vb,15ma,15mb,22ma,22mb,amb
,pss,ps*,psr,psc,pcc,pcr
,l,nal
,syt,stt,sytl,sttl,ext,rm,lg,arc,dt,dis,od,har,jt,nm,mar,cl,sult,sulp,s/a,t/b,t/l/b/b,ci,mn,trem,mu,vib,piz
,2/4,3/4,4/4,5/4,6/4,3/8,4/8,5/8,6/8,7/8,9/8,12/8,c4/4,2/2,c2/2,3/2,4/2,b2/2,c9/8
,8,q,16,sq,32,dsq,64,hdsq,br,buzz,-8-,-q-,-16-,-sq-,-32-,-dsq-,-64-,-hdsq-
,m2,m2.,m4,m4.,m8,m8.,gra,grav,grave,lar,larg,largo,len,lent,lento,ada,adag,adagi,adagio
,and,anda,andan,andante,mod,mode,moder,moderato,alto,a>,allegre,allegretto
,alro,a<,allegro,viv,viva,vivace,pre,pres,prest,presto,issimo,prestissimo
,mm4=4.,mmc=c.,mm4.=4,mmc.=c,mm2=4,mmm=c,mm4=2,mmc=m,mm8=8,mmq=q,mm4=4,mmc=c,mm8.=4,mmq.=c
,accel,allar,ritar,swing,strai,calan,lenta,moren,preci,smorz,soste,strin
,minim,minim.,crotchet,crotchet.,quaver,quaver.
,*n,*x,*+,*xc,*xx,*tu,*td,*/,*\,*d,*do,*c,*cl,*la,*ab,*//,*ld,sol,la,fa,mi,do,re,ti,*hx,*hxh
,sb,pb,xb,ssd,ssu,ssf,stc,ivf,ihf,itf,i1mbs,kmoss
,=ab,=nb,=bl,=sb,=jb,=mb,=bi8,=2b,=bi6,=3b,=fbd,=fbs,=fba,=fbf,=rfb
,[[,[{,[s],[l
,fsa,fsb,p0,p1,p2,p3,p4,p5,-a,-c,-i,-m,-p,0,1,2,3,4,5,s0,s1,s2,s3,s4,s5,s6,th,tp,lt,l1,l2,l3
,qa,qam,qa7,qb,qbm,qb7,qc,qcm,qc7,qd,qdm,qd7,qe,qem,qe7,qf,qfm,qf7,qg,qgm,qg7
,tl,bl,pm,lr,gv,gvw,vsaw,tsaw
,hped,htxt
,Help = Questionmark,?,?ac,?ag,?ar,?be,?bl,?bp,?br,?cl,?dy,?fd,?fi,?gn,?gt,?ha,?kb,?ks,?li,?lo,?nh
,?or,?pi,?rj,?tx,?tr,?ts,?tm,??
CoordMode, ToolTip, Screen
ToolTip, Apply Symbols from Palette P + H, A_ScreenWidth/2, 0, 1 ; tooltip (1) at half Screenwidth and Y=0 (*change*?)
; ♣================================== AT SESSION START ============================================
Gosub, Get_MU4_Window_Data
If (Screen = "full")
WinMove, ahk_exe MuseScore4.exe, , 0, 0 , A_ScreenWidth, A_ScreenHeight
If (Screen = "max")
WinMove, ahk_exe MuseScore4.exe, , 0, 0 , A_ScreenWidth, MU4_Max_Window_Height
Sleep, Sleep_300
Gosub, Defined_State_Check
Return
; ♣============================== END OF AUTO-EXECUTE SECTION =====================================
; ♣======================================= HELP INFO ==============================================
~p & h::
MsgBox, 4096, Palette Help - P + H,
(
Apply symbols from palette Z + A
Recreate current symbol Win + /
Reset palette search field CapsLock + P
Escape from navigation CapsLock + X
Toggle toolbar note input CapsLock + 1
Toggle full/max screen CapsLock + A
Preferences - shortcuts CapsLock + S
Click selected element Alt + Z
From element to voice 1 Shift + Alt + Z
Navigation
To 'Home' [ + Home
Fast access Instruments [ + I
Fast access Properties [ + O
Fast access Palettes [ + P
Get color mouse position Z + /
Other utilities Z + U
Relaunch apply symbols # [ + S
Exit apply symbols ] + S
# In Master MU4
Selection
Range - all similar Control + RButton
Range - same subtype CapsLock + RButton
Range - same voice Alt + Shift + RButton
Staff - all similar Shift + RButton
Staff - same subtype Control + Shift + RButton
)
Return
; ♣=============================== GENERAL SUPPORTING HOTKEYS =====================================
~] & s:: ; exit Apply_Palette_Symbols_MU4.ahk
MsgBox, 4132, Exit Apply Palette Symbols ] + S, Are you sure you want to exit?
IfMsgBox, Yes
ExitApp
Return
; in auto-exec section - Toggle_Screen_Full_Max := 1
#MaxThreadsPerHotkey, 2 ; this line and its companion below belong to the hotkey!
~CapsLock & a:: ; full/max screen toggle (adjacent keys)
Toggle_Screen_Full_Max := !Toggle_Screen_Full_Max
Gosub, Get_MU4_Window_Data ; subroutine corrects for incorrect origin, X and Y of ULC must both be 0
If (MU4_Height = A_ScreenHeight)
WinMove, ahk_exe MuseScore4.exe, , 0, 0 , A_ScreenWidth, MU4_Max_Window_Height
If !(MU4_Height = A_ScreenHeight)
WinMove, ahk_exe MuseScore4.exe, , 0, 0 , A_ScreenWidth, A_ScreenHeight
Return
#MaxThreadsPerHotkey, 1
~CapsLock & 1:: ; toggle toolbar note input
Send !v
Sleep, Sleep_200
Send t
Sleep, Sleep_100
Send {down}
Send {Enter}
Return
~CapsLock & p:: ; empty palette search field and minimize palette list
Send ^{F9}
Sleep, Sleep_200
Send {del}
Sleep, Sleep_50
Send {esc}
Sleep, Sleep_50
Return
~CapsLock & s:: ; preferences > shortcuts > search field
Send !e
Sleep, Sleep_200
Send p
Sleep, Sleep_100
Send {Enter}
Winwait, Preferences
Send {tab 3}
Send {up 3}
Send {tab }
Return
~CapsLock & x:: ; if focus on canvas is lost - escape from navigation
Gosub, Nav_to_Home
Send +{f6 2} ; to score title tab
Sleep, Sleep_50
Send {esc} ; focus in Canvas, (range) selection remains intact
Sleep, Sleep_100
If (Range_Selection = 1) { ; to get only one element selected for the VoiceSearch
Send {right}
Sleep, Sleep_50
}
ImageSearch, , , SB_X1, SB_Y1, SB_X2, SB_Y2, *40 StatusBar_Voice1.png
If (ErrorLevel = 1) {
Send ^!+{right}
Sleep, Sleep_150
ImageSearch, , , SB_X1, SB_Y1, SB_X2, SB_Y2, *40 StatusBar_Barline.png
If (ErrorLevel = 0) {
Send ^!+{left}
Sleep, Sleep_150
}
}
Gosub, VoiceSearch
Click, %VS_X%, %VS_Y%
Sleep, Sleep_200
Return
~!z:: ; click selected element on canvas
Gosub, VoiceSearch
Click, %VS_X%, %VS_Y%
Return
~+!z:: ; from any element to note/rest voice 1
Loop, 7
{
ImageSearch, , , SB_X1, SB_Y1, SB_X2, SB_Y2, *40 StatusBar_Voice1.png
If (ErrorLevel = 0)
Break
If (ErrorLevel = 1) {
Send ^!+{right} ; to next voice 1 element (skip articulations, text, dynamics etc.)
Sleep, Sleep_150 ; time for statusbar image
Continue
}
}
Gosub, VoiceSearch
Click, %VS_X%, %VS_Y%
Return
; ♣=========================================== UTILITY ============================================
z & /:: ; get color mouseposition
CoordMode, Mouse, Window
CoordMode, Pixel, Window
MouseGetPos, X, Y
PixelGetColor, PixColor, %X%, %Y% , RGB
MsgBox, 4160, Color of mousepositionpixel , --- The color is %PixColor% ---`n`n0x is the equivalent of #`nin the window Select Color.
Return
; ♣==================================== DEFINED STATE OF F9 =======================================
; in auto-exec Toggle_F9 := 0 Counter_F9 := 0 and Show_Palettes := 1
; at session start 'Palettes' is visible
#MaxThreadsPerHotkey, 2 ; this line and its companion below belong to the hotkey
F9:: ; this command has no tilde ~ so the immediate MU4 command is intercepted
Counter_F9 := ++Counter_F9
Toggle_F9 := !Toggle_F9 ; you need this hotkey to hide/show the Palettes side panel
If !(Toggle_F9 = 0) && (Counter_F9 = 1) { ; manually activating this panel via the View menu is counterproductive!
MsgBox, 4144, Defined State Attention!,
(
You pressed F9 to hide the Palettes side panel.
The hotkey Z + A is disabled.
) , 2.5
Send {f9}
Show_Palettes := 0
}
If (Toggle_F9 = 0) && (Counter_F9 = 2) {
MsgBox, 4144, Defined State Attention!,
(
You pressed F9 to show the Palettes side panel.
The hotkey Z + A is enabled.
) , 2.5
Send {f9}
Show_Palettes := 1
Counter_F9 := 0
}
Return
#MaxThreadsPerHotkey, 1
; ♣============================== RECREATE CURRENT PALETTE ELEMENT ================================
#/:: ; recreate current palette element
ClickPoint_X := Repeat_Glyph_X + Offset_Glyph ; a bit more to the right of the upper left corner of the selected cell
ClickPoint_Y := Repeat_Glyph_Y + Offset_Glyph ; idem a bit lower
Click, %ClickPoint_X%, %ClickPoint_Y%
Sleep, Sleep_200
; treatment of accidentals
If PaletteSymbolOld in ,!,@,#,##,!!,@!,@#,1fb,1fn,1sn,1s#,3fb,3fbb,3sx,3s#,5fbb,5sx
,upb,dnb,upn,ndn,sup,dns,xup,dnx,bupb,dnbb,ardn,arf,arup,ars
Goto, Finish_Repeat_Glyph ; see below 🎵
; treatment of parentheses and brackets
If PaletteSymbolOld in [],() ; parentheses and brackets
Goto, Par_Brack ; see below 🎵
If PaletteSymbolOld in pss,ps*,psr,psc,pcc,pcr ; pedal lines
{
Send {right}
Sleep, Sleep_100
Send {left}
Sleep, Sleep_50
Goto, Finish_Repeat_Glyph
}
If PaletteSymbol in ac,acs,ap,aps,g4,g16,g32,g8a,g16a,g32a ; grace note stays selected - facilitates adding more
Goto, Finish_Repeat_Glyph ; see below 🎵 - see also (≈)
Par_Brack: ; HERE 🎵 🎶 🎶
Send !{left}
Sleep, Sleep_100
Finish_Repeat_Glyph: ; OR HERE 🎵 🎶 🎶
Gosub, VoiceSearch
Click, %VS_X%, %VS_Y%
Return
; ♣================================= APPLY SYMBOLS FROM PALETTE ==================================
~z & a:: ; apply symbols from palette
Gosub, Nothing_Selected
If (Nothing_Selected = 1) {
MsgBox, 4144, Apply Palette Symbols, Nothing selected!
Return
}
If (Show_Palettes = 0) {
MsgBox, 4144, Defined State Attention!, The Palettes side panel is not visible!`nPress F9.
Return
}
Gosub, Get_MU4_Window_Data
Gosub, Full_Max_Check
Gosub, Range_Selection_Check
MouseGetPos, StartX, StartY ; position mouse
Side_Bar_Tab := "pal"
Pal_Downstroke := 0
Pal_Upstroke := 0
Prop_Downstroke := 0
Gosub, F7_F8_F9_Tab_Title_Check ; if not present presses F9 and enters active tab
InputBox, PaletteSymbol, Apply Symbols from Palette, , , W_IB, H_IB, IB_X, IB_Y, , , Help = Questionmark ; (*change*?)
if ErrorLevel ; when Cancel is pressed
Return
If PaletteSymbol not in %MatchListPalettes%
{
MsgBox, 4144, Apply Symbols from Palette, No valid command.
Return
}
If (PaletteSymbol = "r") ; but the hotkey WIN + / works faster
PaletteSymbol := PaletteSymbolOld
If (PaletteSymbol = "?") || (PaletteSymbol = "Help = Questionmark") {
MsgBox, 4096, Info Palettes,
(
Enter a help shortcut or a symbol shortcut
▼ Accidentals ?AC
▼ Arpeggios & Glissandi ?AG
▼ Articulations ?AR
▼ Barlines ?BL
▼ Beam Properties ?BE
▼ Brackets ?BR
▼ Breath's & Pauses ?BP
▼ Clefs ?CL
▼ Dynamics ?DY
▼ Fingering ?FI
▼ Fretboard Diagrams ?FD
▼ Grace Notes ?GN
▼ Guitar ?GT
▼ Harp ?HA
▼ Keyboard ?KB
▼ Key Signatures ?KS
▼ Layout ?LO
▼ Lines ?LI
▼ Noteheads ?NH
▼ Ornaments ?OR
▼ Pitch ?PI
▼ Repeats & Jumps ?RJ
▼ Tempo ?TM
▼ Text ?TX
▼ Time Signatures ?TS
▼ Tremolo ?TR
Repeat last command R
NB: if palette is open
and macro finished
Repeat last command WIN + /
Close palette search field CapsLock + P
and show Palette list
Info Special Symbols ??
)
InputBox, PaletteSymbol, Apply Symbols from Palette, , , W_IB, H_IB, IB_X, IB_Y, , , Enter Help or Symbol Shortcut ; (*change*?)
if ErrorLevel ; when Cancel is pressed
{
Click, %StartX%, %StartY%
Return
}
}
If (PaletteSymbol = "Enter Help or Symbol Shortcut") {
MsgBox, 4096, Apply Symbols from Palette, "Enter Help or Symbol Shortcut"`nis no valid input.`nThe macro will exit.
Return
}
If (PaletteSymbol = "?ac") {
MsgBox, 4096, Accidentals - shortcuts,
(
In InputBox enter:
Flat !
Natural @
Sharp #
Double sharp ##
Double flat !!
Natural Flat @!
Natural Sharp @#
Arrow down quarter-tone flat ARDN ARF
Arrow quarter-tone sharp ARUP ARS
Gould arrow quartertone accidentals (24-EDO)
Quarter-tone flat UPB ↑♭ 1FB
Three-quarter-tones flat DNB ↓♭ 3FB
Quarter-tone sharp UPN ↑♮ 1SN
Quarter-tone flat NDN ♮↓ 1FN
Three-quarter-tones sharp SUP ♯↑ 3S#
Quarter-tone sharp DNS ↓♯ 1S#
Five-quarter-tones sharp XUP ×↑ 5SX
Three-quarter-tones sharp DNX ↓× 3SX
Three-quarter-tones flat BUPB ♭↑♭ 3FBB
Five-quarter-tones flat DNBB ↓♭♭ 5FBB
Add brackets to accidental [ ]
Add parentheses to element ( )
)
}
If (PaletteSymbol = "?ag") {
MsgBox, 4096, Arpeggios & Glissandi - shortcuts,
(
In InputBox enter:
Arpeggio ARP
Arpeggio point up ARU
Arpeggio point down ARD
Arpeggio bracket ARB ARBR
Arpeggio arrow up ARRU
Arpeggio arrow down ARRD
Glissando line straight GLS
Glissando line wavy GLW
Fall FAL FALL
Doit DOI DOIT
Plop PLO PLOP
Scoop SCO SCOOP
Slide out down SOD SLOD
Slide out up SOU SLOU
Slide in above SIA SLIA
Slide in below SIB SLIB
)
}
If (PaletteSymbol = "?ar") {
MsgBox, 4096, Articulations - shortcuts,
(
In InputBox enter:
Accent A >
Accent staccato A. .A >. .>
Bend B
Downbow DB
Fade in FI
Fade out FO
Harmonic H
Laissez vibrer LV
Louré L.
Marcato M ^
Marcato staccato M. .M ^. .^
Marcato tenuto MT TM ^_ _^
Muted +
Open O
Portato P.
Sawtooth line segment SLS
Idem wide line segment SWLS
Snap pizzicato SP
Soft accent SA <>
Soft accent staccato SA. <.>
Soft accent tenuto SAT <_>
Idem SAT staccato SAT. <_.> <._>
Staccato .
Staccatissimo ..
Staccatissimo stroke ..S S.. ../ /..
Staccatissimo wedge ..W W.. ..' '..
Stress STR '
Tenuto T _
Tenuto accent TA AT _> >_
Tenuto staccato T. .T _. ._
Tremolo bar TB
Unstress UNSTR
Upbow UB
Vibrato large faster VLF
Vibrato large slowest VLS
Volume swell VS
)
}
If (PaletteSymbol = "?bl") {
MsgBox, 4096, Barlines - shortcuts,
(
In InputBox enter:
Single barline |
Double barline ||
Start repeat barline |:
End repeat barline :|
End-start repeat barline :||:
Heavy barline HBL
Heavy double barline HDBL
Dashed barline DASH ----
Final barline FBL |||
Reverse final barline RFBL
Barline dotted BL. ....
Barline tick 1 span # BT1
Barline tick 2 span # BT2
Barline short 1 span # BS1
Barline short 2 span # BS2
# Reset barlines RBL
using 'Properties'
Combination
┌─1─┐:‖:┌─2── 1:||:2
)
}
If (PaletteSymbol = "?be") {
MsgBox, 4096, Beam Properties - shortcuts,
(
In InputBox enter:
MU4 Name MU3 Name
Auto beam =AB =AB Auto beam
No beam =NB =NB No beam
Break beam left =BL =SB Start beam
Join beams =JB =MB Middle beam
Break inner beams (eighth) =BI8 =2B Start 2nd level beam
Break inner beams (16th) =BI6 =3B Start 3rd level beam
Feathered beams #
Decelerate =FBD =FBS F-beam slower
Accelerate =FBA =FBF F-beam faster
Reset FB's =RFB
# Select a beamed 16th or 32nd note
)
}
If (PaletteSymbol = "?bp") {
MsgBox, 4096, Breath's & Pauses - shortcuts,
(
In InputBox enter:
Breath mark (comma) BMC
Breathmark tick-like BMT
Breathmark salzedo BMS SALZ
Breathmark upbow-like BMV
Curved caesura C)
Caesura straight C/
Short caesura C||
Thick caesura C//
Caesura accent-like CAL
Fermata FM
Short fermata SFM
Short fermata Henze SFMH
Very short fermata VSFM
Long fermata LFM
Long fermata Henze LFMH
Very long fermata VLFM
)
}
If (PaletteSymbol = "?br") {
MsgBox, 4096, Brackets - shortcuts,
(
⁞ In InputBox enter:
⁞
⁞ Bracket [ [
⁞ Brace [ {
⁞ Square [S]
⁞ Line [L
)
}
If (PaletteSymbol = "?cl") {
MsgBox, 4096, Clefs - shortcuts,
(
In InputBox enter:
Treble CLT
Treble 8va CLT8VA
Treble 15ma CLT15MA
Treble 8vb CLT8VB
Treble 15vb CLT15VB
Double Treble 8vb CLDT8VB
Treble optional 8vb CLTO8VB
French violin clef CLFVC
Soprano CLS
Mezzo Soprano CLMS
Alto CLA
Tenor CLTEN
Baritone CLBAR
Bass CLB
Bass 8va CLB8VA
Bass 15ma CLB15MA
Bass 8vb CLB8VB
Bass 15mb CLB15MB
Baritone F clef CLBARF
Subbass CLSB
Percussion CLP
Percussion 2 CLP2
Tablature CLTAB
Tablature 4 lines CLTAB4
Tablature serif CLTABS
Tablature serif 4 lines CLTABS4
French 18th century
Soprano CLS18
Alto CLA18
Tenor CLT18
F clef CLF18
19th century
C clef H shape CLC19
F clef CLF19
French 20th century
Soprano CLS20
Alto CLA20
Tenor CLT20
)
}
If (PaletteSymbol = "?dy") {
MsgBox, 4096, Dynamics - shortcuts,
(
In InputBox enter:
PPPPPP PPPPP PPPP PPP PP P MP
FFFFFF FFFFF FFFF FFF FF F MF
RF RFZ FZ SF SFZ SFF SFFZ
SFPP SFP FP M* R* S* Z* N*
You can REPLACE a single dynamic by selecting its note.
In InputBox enter prefix = followed by the new dynamic.
E.g. =MF =SFZ =S* =SFF =FP =SFPP
mf < cresc pin MF<
# Cresc _ _ _ C CINV
# Dim _ _ _ D DINV
# CINV and DINV make the lines invisible
)
}
If (PaletteSymbol = "?fi")
{
MsgBox, 4096, Fingering - shortcuts,
(
In InputBox enter:
Piano LH Guitar
0 P0 0 0
1 P1 1 1
2 P2 2 2
3 P3 3 3
4 P4 4 4
5 P5 5 5
T TH
Circled String RH Guitar
0 S0 p -P
1 S1 i -I
2 S2 m -M
3 S3 a -A
4 S4 c -C
5 S5 Th pos TP
6 S6
Lute
RH thumb LT
RH first finger L1
RH second finger L2
RH third finger L3
Finger substitution above FSA
Finger substitution below FSB
)
}
If (PaletteSymbol = "?fd")
{
MsgBox, 4096, Fretboard diagrams - shortcuts,
(
QA QA7 QAm
QB QB7 QBm
QC QC7 QCm
QD QD7 QDm
QE QE7 QEm
QF QF7 QFm
QG QG7 QGm
)
}
If (PaletteSymbol = "?gn") {
MsgBox, 4096, Grace Notes - shortcuts,
(
In InputBox enter:
Acciaccatura AC
Acciaccatura + slur # ACS
Appogiatura AP
Appogiatura + slur # APS
Grace quarter G4
Grace 16th G16
Grace 32nd G32
Grace eight after G8A
Grace 16th after G16A
Grace 32nd after G32A
# Grace note diatonically raised
NB: if palette is open and macro finished
Repeat last command WIN + /
to add more grace notes
)
}
If (PaletteSymbol = "?gt") {
MsgBox, 4096, Guitar - shortcuts,
(
In InputBox enter:
Barré line BL
Palm mute PM
Let ring LR
Bend B
Tremolo bar TB
Guitar vibrato GV
Guitar vibrato wide GVW
Distort DIS
Overdrive OD
Harmonics HAR
Jazz tone JT
LH Guitar Circled String RH Guitar
0 0 0 S0 p -P
1 1 1 S1 i -I
2 2 2 S2 m -M
3 3 3 S3 a -A
4 4 4 S4 c -C
5 5 5 S5 Th pos TP
T TH 6 S6