@k-l-lambda/lilylet 0.1.49 → 0.1.51

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. package/lib/abc/abc.d.ts +102 -0
  2. package/lib/abc/abc.js +25 -0
  3. package/lib/abc/grammar.jison.js +1203 -0
  4. package/lib/abc/parser.d.ts +3 -0
  5. package/lib/abc/parser.js +6 -0
  6. package/lib/abcDecoder.d.ts +1 -0
  7. package/lib/abcDecoder.js +1 -0
  8. package/lib/grammar.jison.js +1 -1303
  9. package/lib/index.d.ts +1 -8
  10. package/lib/index.js +1 -10
  11. package/lib/lilylet/abcDecoder.d.ts +25 -0
  12. package/lib/lilylet/abcDecoder.js +1007 -0
  13. package/lib/lilylet/grammar.jison.js +1308 -0
  14. package/lib/lilylet/index.d.ts +10 -0
  15. package/lib/lilylet/index.js +10 -0
  16. package/lib/lilylet/lilypondDecoder.d.ts +29 -0
  17. package/lib/lilylet/lilypondDecoder.js +1053 -0
  18. package/lib/lilylet/lilypondEncoder.d.ts +34 -0
  19. package/lib/lilylet/lilypondEncoder.js +759 -0
  20. package/lib/lilylet/meiEncoder.d.ts +8 -0
  21. package/lib/lilylet/meiEncoder.js +1813 -0
  22. package/lib/lilylet/musicXmlDecoder.d.ts +20 -0
  23. package/lib/lilylet/musicXmlDecoder.js +1195 -0
  24. package/lib/lilylet/musicXmlEncoder.d.ts +15 -0
  25. package/lib/lilylet/musicXmlEncoder.js +701 -0
  26. package/lib/lilylet/musicXmlTypes.d.ts +199 -0
  27. package/lib/lilylet/musicXmlTypes.js +7 -0
  28. package/lib/lilylet/musicXmlUtils.d.ts +92 -0
  29. package/lib/lilylet/musicXmlUtils.js +469 -0
  30. package/lib/lilylet/parser.d.ts +3 -0
  31. package/lib/lilylet/parser.js +151 -0
  32. package/lib/lilylet/serializer.d.ts +11 -0
  33. package/lib/lilylet/serializer.js +702 -0
  34. package/lib/lilylet/types.d.ts +245 -0
  35. package/lib/lilylet/types.js +99 -0
  36. package/lib/lilypondDecoder.d.ts +1 -29
  37. package/lib/lilypondDecoder.js +1 -1006
  38. package/lib/lilypondEncoder.d.ts +1 -34
  39. package/lib/lilypondEncoder.js +1 -759
  40. package/lib/meiEncoder.d.ts +1 -8
  41. package/lib/meiEncoder.js +1 -1545
  42. package/lib/musicXmlDecoder.d.ts +1 -20
  43. package/lib/musicXmlDecoder.js +1 -1151
  44. package/lib/musicXmlEncoder.d.ts +1 -15
  45. package/lib/musicXmlEncoder.js +1 -666
  46. package/lib/musicXmlTypes.d.ts +1 -199
  47. package/lib/musicXmlTypes.js +1 -7
  48. package/lib/musicXmlUtils.d.ts +1 -81
  49. package/lib/musicXmlUtils.js +1 -435
  50. package/lib/parser.d.ts +1 -3
  51. package/lib/parser.js +1 -151
  52. package/lib/serializer.d.ts +1 -11
  53. package/lib/serializer.js +1 -650
  54. package/lib/types.d.ts +1 -244
  55. package/lib/types.js +1 -99
  56. package/package.json +2 -1
  57. package/source/abc/abc.jison +692 -0
  58. package/source/abc/abc.ts +176 -0
  59. package/source/abc/grammar.jison.js +1203 -0
  60. package/source/abc/parser.ts +12 -0
  61. package/source/lilylet/abcDecoder.ts +1121 -0
  62. package/source/lilylet/grammar.jison.js +195 -190
  63. package/source/lilylet/index.ts +4 -3
  64. package/source/lilylet/lilylet.jison +10 -3
  65. package/source/lilylet/lilypondDecoder.ts +91 -41
  66. package/source/lilylet/meiEncoder.ts +284 -0
  67. package/source/lilylet/musicXmlDecoder.ts +74 -27
  68. package/source/lilylet/musicXmlEncoder.ts +201 -146
  69. package/source/lilylet/musicXmlUtils.ts +46 -4
  70. package/source/lilylet/serializer.ts +75 -21
  71. package/source/lilylet/types.ts +1 -0
@@ -0,0 +1,1308 @@
1
+ /* parser generated by jison 0.4.18 */
2
+ /*
3
+ Returns a Parser object of the following structure:
4
+
5
+ Parser: {
6
+ yy: {}
7
+ }
8
+
9
+ Parser.prototype: {
10
+ yy: {},
11
+ trace: function(),
12
+ symbols_: {associative list: name ==> number},
13
+ terminals_: {associative list: number ==> name},
14
+ productions_: [...],
15
+ performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$),
16
+ table: [...],
17
+ defaultActions: {...},
18
+ parseError: function(str, hash),
19
+ parse: function(input),
20
+
21
+ lexer: {
22
+ EOF: 1,
23
+ parseError: function(str, hash),
24
+ setInput: function(input),
25
+ input: function(),
26
+ unput: function(str),
27
+ more: function(),
28
+ less: function(n),
29
+ pastInput: function(),
30
+ upcomingInput: function(),
31
+ showPosition: function(),
32
+ test_match: function(regex_match_array, rule_index),
33
+ next: function(),
34
+ lex: function(),
35
+ begin: function(condition),
36
+ popState: function(),
37
+ _currentRules: function(),
38
+ topState: function(),
39
+ pushState: function(condition),
40
+
41
+ options: {
42
+ ranges: boolean (optional: true ==> token location info will include a .range[] member)
43
+ flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match)
44
+ backtrack_lexer: boolean (optional: true ==> lexer regexes are tested in order and for each matching regex the action code is invoked; the lexer terminates the scan when a token is returned by the action code)
45
+ },
46
+
47
+ performAction: function(yy, yy_, $avoiding_name_collisions, YY_START),
48
+ rules: [...],
49
+ conditions: {associative list: name ==> set},
50
+ }
51
+ }
52
+
53
+
54
+ token location info (@$, _$, etc.): {
55
+ first_line: n,
56
+ last_line: n,
57
+ first_column: n,
58
+ last_column: n,
59
+ range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based)
60
+ }
61
+
62
+
63
+ the parseError function receives a 'hash' object with these members for lexer and parser errors: {
64
+ text: (matched text)
65
+ token: (the produced terminal token, if any)
66
+ line: (yylineno)
67
+ }
68
+ while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: {
69
+ loc: (yylloc)
70
+ expected: (string describing the set of expected tokens)
71
+ recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error)
72
+ }
73
+ */
74
+ Object.defineProperty(globalThis, "__lilyletGrammar__", { value: (function(){
75
+ var o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[5,23,26,29,41,42,43,48,51,58,59,69,70,75,77,78,79,81,82,85,86,87,88,91,93],$V1=[2,30],$V2=[1,9],$V3=[1,10],$V4=[1,11],$V5=[1,12],$V6=[1,13],$V7=[1,14],$V8=[1,15],$V9=[1,16],$Va=[1,17],$Vb=[1,27],$Vc=[1,28],$Vd=[5,9,11,14,15,16,17,18,19,20,21,23,26,29,41,42,43,48,51,58,59,69,70,75,77,78,79,81,82,85,86,87,88,91,93],$Ve=[5,9,23,26,29,41,42,43,48,51,58,59,69,70,75,77,78,79,81,82,85,86,87,88,91,93],$Vf=[5,23],$Vg=[5,23,26],$Vh=[1,39],$Vi=[5,23,26,29],$Vj=[1,67],$Vk=[1,68],$Vl=[1,69],$Vm=[1,70],$Vn=[1,71],$Vo=[1,72],$Vp=[1,53],$Vq=[1,54],$Vr=[1,73],$Vs=[1,74],$Vt=[1,75],$Vu=[1,82],$Vv=[1,83],$Vw=[1,76],$Vx=[1,77],$Vy=[1,78],$Vz=[1,79],$VA=[1,80],$VB=[1,81],$VC=[1,64],$VD=[1,65],$VE=[1,66],$VF=[2,23],$VG=[5,9,23,26,29,41,42,43,48,51,58,59,69,70,75,77,78,79,81,82,85,86,87,88,90,91,93],$VH=[5,9,13,23,26,29,41,42,43,48,50,51,57,58,59,69,70,75,77,78,79,81,82,84,85,86,87,88,90,91,93,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],$VI=[2,102],$VJ=[1,100],$VK=[5,9,13,23,26,29,41,42,43,48,50,51,55,57,58,59,69,70,75,77,78,79,81,82,84,85,86,87,88,90,91,93,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],$VL=[5,9,23,26,29,41,42,48,51,58,59,69,70,75,77,78,79,81,82,85,86,87,88,90,91,93],$VM=[1,185],$VN=[1,191],$VO=[1,153],$VP=[1,188],$VQ=[1,154],$VR=[1,152],$VS=[1,187],$VT=[1,146],$VU=[1,147],$VV=[1,148],$VW=[1,149],$VX=[1,150],$VY=[1,151],$VZ=[1,157],$V_=[1,156],$V$=[1,155],$V01=[1,158],$V11=[1,159],$V21=[1,160],$V31=[1,161],$V41=[1,162],$V51=[1,163],$V61=[1,164],$V71=[1,165],$V81=[1,166],$V91=[1,167],$Va1=[1,168],$Vb1=[1,169],$Vc1=[1,170],$Vd1=[1,171],$Ve1=[1,172],$Vf1=[1,173],$Vg1=[1,174],$Vh1=[1,175],$Vi1=[1,176],$Vj1=[1,177],$Vk1=[1,178],$Vl1=[1,179],$Vm1=[1,180],$Vn1=[1,181],$Vo1=[1,182],$Vp1=[1,183],$Vq1=[1,184],$Vr1=[1,186],$Vs1=[1,189],$Vt1=[1,190],$Vu1=[5,9,13,23,26,29,41,42,43,48,50,51,55,57,58,59,69,70,75,77,78,79,80,81,82,84,85,86,87,88,90,91,93,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],$Vv1=[9,41,42,43,48,51,58,59,69,70,75,77,78,79,81,82,85,86,87,88,90,91,93],$Vw1=[50,51],$Vx1=[5,9,13,23,26,29,41,42,43,48,50,51,53,54,55,57,58,59,69,70,75,77,78,79,81,82,84,85,86,87,88,90,91,93,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],$Vy1=[48,51,55,90];
76
+ var parser = {trace: function trace () { },
77
+ yy: {},
78
+ symbols_: {"error":2,"document":3,"content":4,"EOF":5,"headers":6,"measures":7,"newlines":8,"NEWLINE":9,"header":10,"HEADER_TITLE":11,"STRING":12,"]":13,"HEADER_SUBTITLE":14,"HEADER_COMPOSER":15,"HEADER_ARRANGER":16,"HEADER_LYRICIST":17,"HEADER_OPUS":18,"HEADER_INSTRUMENT":19,"HEADER_GENRE":20,"HEADER_AUTOBEAM":21,"measure_content":22,"|":23,"parts":24,"part_voices":25,"PART_SEP":26,"part_start":27,"voice_events":28,"VOICE_SEP":29,"event":30,"note_event":31,"rest_event":32,"context_event":33,"grace_event":34,"tuplet_event":35,"tremolo_event":36,"pitch_reset_event":37,"barline_event":38,"harmony_event":39,"markup_event":40,"CMD_BAR":41,"CMD_CHORDS":42,"CMD_MARKUP":43,"chord":44,"duration":45,"post_events":46,"pitch":47,"<":48,"pitches":49,">":50,"PITCH":51,"octave":52,"OCT_UP":53,"OCT_DOWN":54,"NUMBER":55,"dots":56,".":57,"REST_CHAR":58,"SPACE_CHAR":59,"clef_cmd":60,"key_cmd":61,"time_cmd":62,"tempo_cmd":63,"staff_cmd":64,"ottava_cmd":65,"stem_cmd":66,"numeric_time_sig_cmd":67,"default_time_sig_cmd":68,"CMD_CLEF":69,"CMD_KEY":70,"pitch_name":71,"mode":72,"MODE_MAJOR":73,"MODE_MINOR":74,"CMD_TIME":75,"/":76,"CMD_NUMERIC_TIME_SIG":77,"CMD_DEFAULT_TIME_SIG":78,"CMD_TEMPO":79,"=":80,"CMD_STAFF":81,"CMD_OTTAVA":82,"#":83,"-":84,"CMD_STEMUP":85,"CMD_STEMDOWN":86,"CMD_STEMNEUTRAL":87,"CMD_GRACE":88,"{":89,"}":90,"CMD_TIMES":91,"tremolo_pitches":92,"CMD_REPEAT":93,"TREMOLO":94,"post_event":95,"articulation_mark":96,"ornament_mark":97,"dynamic_mark":98,"hairpin_mark":99,"pedal_mark":100,"tie_mark":101,"slur_mark":102,"beam_mark":103,"tremolo_mark":104,"direction_mark":105,"rest_mark":106,"fingering_mark":107,"fingering_number":108,"navigation_mark":109,"markup_mark":110,"CMD_REST":111,"ART_STACCATO":112,"ART_STACCATISSIMO":113,"ART_TENUTO":114,"ART_MARCATO":115,"ART_ACCENT":116,"ART_PORTATO":117,"_":118,"^":119,"!":120,"ORN_TRILL":121,"ORN_TURN":122,"ORN_MORDENT":123,"ORN_PRALL":124,"ORN_FERMATA":125,"ORN_SHORTFERMATA":126,"ORN_ARPEGGIO":127,"DYN_PPP":128,"DYN_PP":129,"DYN_P":130,"DYN_MP":131,"DYN_MF":132,"DYN_F":133,"DYN_FF":134,"DYN_FFF":135,"DYN_SFZ":136,"DYN_RFZ":137,"DYN_SF":138,"CMD_CRESC_BEGIN":139,"CMD_DIM_BEGIN":140,"CMD_DYNAMICS_END":141,"CMD_SUSTAINON":142,"CMD_SUSTAINOFF":143,"~":144,"(":145,")":146,"[":147,":":148,"CMD_CODA":149,"CMD_SEGNO":150,"$accept":0,"$end":1},
79
+ terminals_: {2:"error",5:"EOF",9:"NEWLINE",11:"HEADER_TITLE",12:"STRING",13:"]",14:"HEADER_SUBTITLE",15:"HEADER_COMPOSER",16:"HEADER_ARRANGER",17:"HEADER_LYRICIST",18:"HEADER_OPUS",19:"HEADER_INSTRUMENT",20:"HEADER_GENRE",21:"HEADER_AUTOBEAM",23:"|",26:"PART_SEP",29:"VOICE_SEP",41:"CMD_BAR",42:"CMD_CHORDS",43:"CMD_MARKUP",48:"<",50:">",51:"PITCH",53:"OCT_UP",54:"OCT_DOWN",55:"NUMBER",57:".",58:"REST_CHAR",59:"SPACE_CHAR",69:"CMD_CLEF",70:"CMD_KEY",73:"MODE_MAJOR",74:"MODE_MINOR",75:"CMD_TIME",76:"/",77:"CMD_NUMERIC_TIME_SIG",78:"CMD_DEFAULT_TIME_SIG",79:"CMD_TEMPO",80:"=",81:"CMD_STAFF",82:"CMD_OTTAVA",83:"#",84:"-",85:"CMD_STEMUP",86:"CMD_STEMDOWN",87:"CMD_STEMNEUTRAL",88:"CMD_GRACE",89:"{",90:"}",91:"CMD_TIMES",93:"CMD_REPEAT",94:"TREMOLO",111:"CMD_REST",112:"ART_STACCATO",113:"ART_STACCATISSIMO",114:"ART_TENUTO",115:"ART_MARCATO",116:"ART_ACCENT",117:"ART_PORTATO",118:"_",119:"^",120:"!",121:"ORN_TRILL",122:"ORN_TURN",123:"ORN_MORDENT",124:"ORN_PRALL",125:"ORN_FERMATA",126:"ORN_SHORTFERMATA",127:"ORN_ARPEGGIO",128:"DYN_PPP",129:"DYN_PP",130:"DYN_P",131:"DYN_MP",132:"DYN_MF",133:"DYN_F",134:"DYN_FF",135:"DYN_FFF",136:"DYN_SFZ",137:"DYN_RFZ",138:"DYN_SF",139:"CMD_CRESC_BEGIN",140:"CMD_DIM_BEGIN",141:"CMD_DYNAMICS_END",142:"CMD_SUSTAINON",143:"CMD_SUSTAINOFF",144:"~",145:"(",146:")",147:"[",148:":",149:"CMD_CODA",150:"CMD_SEGNO"},
80
+ productions_: [0,[3,2],[4,2],[4,3],[4,2],[4,1],[8,1],[8,2],[6,1],[6,2],[6,2],[6,3],[10,3],[10,3],[10,3],[10,3],[10,3],[10,3],[10,3],[10,3],[10,3],[7,1],[7,3],[7,2],[22,1],[24,1],[24,4],[27,0],[25,1],[25,3],[28,0],[28,2],[30,1],[30,1],[30,1],[30,1],[30,1],[30,1],[30,1],[30,1],[30,1],[30,1],[38,2],[39,2],[40,2],[37,1],[31,3],[31,3],[31,2],[31,2],[44,3],[49,1],[49,2],[47,2],[47,1],[52,1],[52,1],[52,2],[52,2],[45,2],[56,0],[56,2],[32,3],[32,3],[32,2],[32,2],[33,1],[33,1],[33,1],[33,1],[33,1],[33,1],[33,1],[33,1],[33,1],[60,2],[61,3],[71,1],[72,1],[72,1],[62,4],[67,1],[68,1],[63,5],[63,2],[63,4],[64,2],[65,3],[65,4],[65,1],[66,1],[66,1],[66,1],[34,4],[34,2],[34,2],[35,7],[92,1],[92,1],[36,9],[36,8],[36,7],[46,0],[46,2],[95,1],[95,1],[95,1],[95,1],[95,1],[95,1],[95,1],[95,1],[95,1],[95,1],[95,1],[95,1],[95,1],[95,1],[95,1],[106,1],[96,1],[96,1],[96,1],[96,1],[96,1],[96,1],[96,2],[96,2],[96,2],[96,2],[96,2],[96,2],[96,1],[96,1],[96,1],[96,1],[96,1],[96,1],[97,1],[97,1],[97,1],[97,1],[97,1],[97,1],[97,1],[98,1],[98,1],[98,1],[98,1],[98,1],[98,1],[98,1],[98,1],[98,1],[98,1],[98,1],[99,1],[99,1],[99,1],[100,1],[100,1],[101,1],[102,1],[102,1],[103,1],[103,1],[104,2],[105,2],[105,2],[107,2],[108,1],[109,1],[109,1],[110,2]],
81
+ performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) {
82
+ /* this == yyval */
83
+
84
+ var $0 = $$.length - 1;
85
+ switch (yystate) {
86
+ case 1:
87
+ return { metadata: $$[$0-1].metadata, measures: $$[$0-1].measures };
88
+ break;
89
+ case 2:
90
+ this.$ = ({ metadata: $$[$0-1], measures: $$[$0] });
91
+ break;
92
+ case 3:
93
+ this.$ = ({ metadata: $$[$0-2], measures: $$[$0] });
94
+ break;
95
+ case 4: case 5:
96
+ this.$ = ({ metadata: undefined, measures: $$[$0] });
97
+ break;
98
+ case 8: case 98:
99
+ this.$ = $$[$0];
100
+ break;
101
+ case 9:
102
+ this.$ = ({ ...$$[$0-1], ...$$[$0] });
103
+ break;
104
+ case 10: case 50:
105
+ this.$ = $$[$0-1];
106
+ break;
107
+ case 11:
108
+ this.$ = ({ ...$$[$0-2], ...$$[$0] });
109
+ break;
110
+ case 12:
111
+ this.$ = ({ title: $$[$0-1].slice(1, -1) });
112
+ break;
113
+ case 13:
114
+ this.$ = ({ subtitle: $$[$0-1].slice(1, -1) });
115
+ break;
116
+ case 14:
117
+ this.$ = ({ composer: $$[$0-1].slice(1, -1) });
118
+ break;
119
+ case 15:
120
+ this.$ = ({ arranger: $$[$0-1].slice(1, -1) });
121
+ break;
122
+ case 16:
123
+ this.$ = ({ lyricist: $$[$0-1].slice(1, -1) });
124
+ break;
125
+ case 17:
126
+ this.$ = ({ opus: $$[$0-1].slice(1, -1) });
127
+ break;
128
+ case 18:
129
+ this.$ = ({ instrument: $$[$0-1].slice(1, -1) });
130
+ break;
131
+ case 19:
132
+ this.$ = ({ genre: $$[$0-1].slice(1, -1) });
133
+ break;
134
+ case 20:
135
+ this.$ = ({ autoBeam: $$[$0-1].slice(1, -1) });
136
+ break;
137
+ case 21: case 51: case 97:
138
+ this.$ = [$$[$0]];
139
+ break;
140
+ case 22:
141
+ this.$ = $$[$0-2].concat([$$[$0]]);
142
+ break;
143
+ case 23:
144
+ this.$ = $$[$0-1];
145
+ break;
146
+ case 24:
147
+ this.$ = measure($$[$0], currentKey, currentTimeSig);
148
+ break;
149
+ case 25:
150
+ this.$ = [part($$[$0])];
151
+ break;
152
+ case 26:
153
+ this.$ = $$[$0-3].concat([part($$[$0])]);
154
+ break;
155
+ case 27:
156
+ currentStaff = 1; currentOttava = 0;
157
+ break;
158
+ case 28:
159
+ this.$ = [voice(currentStaff, $$[$0])];
160
+ break;
161
+ case 29:
162
+ this.$ = $$[$0-2].concat([voice(currentStaff, $$[$0])]);
163
+ break;
164
+ case 30: case 102:
165
+ this.$ = [];
166
+ break;
167
+ case 31:
168
+ this.$ = $$[$0] === null ? $$[$0-1] : $$[$0-1].concat(Array.isArray($$[$0]) ? $$[$0] : [$$[$0]]);
169
+ break;
170
+ case 42:
171
+ this.$ = barlineEvent($$[$0].slice(1, -1));
172
+ break;
173
+ case 43:
174
+ this.$ = harmonyEvent($$[$0].slice(1, -1));
175
+ break;
176
+ case 44:
177
+ this.$ = markupEvent($$[$0].slice(1, -1));
178
+ break;
179
+ case 45:
180
+
181
+ // On newline, reset ottava to 0 if it's non-zero (like pitch base resets)
182
+ if (currentOttava !== 0) {
183
+ const ottavaReset = contextChange({ ottava: 0 });
184
+ currentOttava = 0;
185
+ this.$ = [ottavaReset, { type: 'pitchReset' }];
186
+ } else {
187
+ this.$ = { type: 'pitchReset' };
188
+ }
189
+
190
+ break;
191
+ case 46: case 47:
192
+ currentDuration = $$[$0-1]; this.$ = noteEvent($$[$0-2], $$[$0-1], $$[$0]);
193
+ break;
194
+ case 48: case 49:
195
+ this.$ = noteEvent($$[$0-1], currentDuration, $$[$0]);
196
+ break;
197
+ case 52: case 103:
198
+ this.$ = $$[$0-1].concat([$$[$0]]);
199
+ break;
200
+ case 53:
201
+ this.$ = parsePitch($$[$0-1], $$[$0]);
202
+ break;
203
+ case 54:
204
+ this.$ = parsePitch($$[$0], 0);
205
+ break;
206
+ case 55:
207
+ this.$ = 1;
208
+ break;
209
+ case 56:
210
+ this.$ = -1;
211
+ break;
212
+ case 57:
213
+ this.$ = $$[$0-1] + 1;
214
+ break;
215
+ case 58:
216
+ this.$ = $$[$0-1] - 1;
217
+ break;
218
+ case 59:
219
+ this.$ = duration(Number($$[$0-1]), $$[$0]);
220
+ break;
221
+ case 60:
222
+ this.$ = 0;
223
+ break;
224
+ case 61:
225
+ this.$ = $$[$0-1] + 1;
226
+ break;
227
+ case 62:
228
+ currentDuration = $$[$0-1]; this.$ = restEvent($$[$0-1], { fullMeasure: $$[$0-2] === 'R' });
229
+ break;
230
+ case 63:
231
+ currentDuration = $$[$0-1]; this.$ = restEvent($$[$0-1], { invisible: true });
232
+ break;
233
+ case 64:
234
+ this.$ = restEvent(currentDuration, { fullMeasure: $$[$0-1] === 'R' });
235
+ break;
236
+ case 65:
237
+ this.$ = restEvent(currentDuration, { invisible: true });
238
+ break;
239
+ case 66:
240
+ this.$ = contextChange({ clef: $$[$0] });
241
+ break;
242
+ case 67:
243
+ this.$ = contextChange({ key: $$[$0] });
244
+ break;
245
+ case 68:
246
+ this.$ = contextChange({ time: $$[$0] });
247
+ break;
248
+ case 69:
249
+ this.$ = contextChange({ tempo: $$[$0] });
250
+ break;
251
+ case 70:
252
+ this.$ = contextChange({ staff: $$[$0] });
253
+ break;
254
+ case 71:
255
+ this.$ = contextChange({ ottava: $$[$0] });
256
+ break;
257
+ case 72:
258
+ this.$ = contextChange({ stemDirection: $$[$0] });
259
+ break;
260
+ case 73: case 74:
261
+ this.$ = null;
262
+ break;
263
+ case 75:
264
+ this.$ = $$[$0].slice(1, -1);
265
+ break;
266
+ case 76:
267
+ currentKey = keySignature($$[$0-1].phonet, $$[$0-1].accidental, $$[$0]); this.$ = currentKey;
268
+ break;
269
+ case 77:
270
+ this.$ = parsePitchName($$[$0]);
271
+ break;
272
+ case 78:
273
+ this.$ = 'major';
274
+ break;
275
+ case 79:
276
+ this.$ = 'minor';
277
+ break;
278
+ case 80:
279
+
280
+ const num = Number($$[$0-2]);
281
+ const den = Number($$[$0]);
282
+ const timeSig = fraction(num, den);
283
+ // Add symbol for 4/4 (common) and 2/2 (cut) unless numericTimeSignature is set
284
+ if (!numericTimeSignature) {
285
+ if (num === 4 && den === 4) {
286
+ timeSig.symbol = 'common';
287
+ } else if (num === 2 && den === 2) {
288
+ timeSig.symbol = 'cut';
289
+ }
290
+ }
291
+ currentTimeSig = timeSig;
292
+ this.$ = currentTimeSig;
293
+
294
+ break;
295
+ case 81:
296
+ numericTimeSignature = true; this.$ = null;
297
+ break;
298
+ case 82:
299
+ numericTimeSignature = false; this.$ = null;
300
+ break;
301
+ case 83:
302
+ this.$ = ({ text: $$[$0-3].slice(1, -1), beat: $$[$0-2], bpm: Number($$[$0]) });
303
+ break;
304
+ case 84:
305
+ this.$ = ({ text: $$[$0].slice(1, -1) });
306
+ break;
307
+ case 85:
308
+ this.$ = ({ beat: $$[$0-2], bpm: Number($$[$0]) });
309
+ break;
310
+ case 86:
311
+ currentStaff = Number($$[$0].slice(1, -1)); this.$ = currentStaff;
312
+ break;
313
+ case 87:
314
+ currentOttava = Number($$[$0]); this.$ = currentOttava;
315
+ break;
316
+ case 88:
317
+ currentOttava = -Number($$[$0]); this.$ = currentOttava;
318
+ break;
319
+ case 89:
320
+ currentOttava = 0; this.$ = 0;
321
+ break;
322
+ case 90:
323
+ this.$ = 'up';
324
+ break;
325
+ case 91:
326
+ this.$ = 'down';
327
+ break;
328
+ case 92:
329
+ this.$ = 'auto';
330
+ break;
331
+ case 93:
332
+ this.$ = ($$[$0-1].filter(e => e.type === 'note' || e.type === 'rest').map(e => ({ ...e, grace: true })));
333
+ break;
334
+ case 94: case 95:
335
+ this.$ = ({ ...$$[$0], grace: true });
336
+ break;
337
+ case 96:
338
+ this.$ = tupletEvent(fraction(Number($$[$0-5]), Number($$[$0-3])), $$[$0-1].filter(e => e.type === 'note' || e.type === 'rest'));
339
+ break;
340
+ case 99:
341
+ currentDuration = $$[$0-3]; this.$ = tremoloEvent($$[$0-4], $$[$0-2], Number($$[$0-6]), $$[$0-3].division);
342
+ break;
343
+ case 100:
344
+ currentDuration = $$[$0-2]; this.$ = tremoloEvent($$[$0-3], $$[$0-1], Number($$[$0-5]), $$[$0-2].division);
345
+ break;
346
+ case 101:
347
+ this.$ = tremoloEvent($$[$0-2], $$[$0-1], Number($$[$0-4]), currentDuration.division);
348
+ break;
349
+ case 119:
350
+ this.$ = ({ pitchedRest: true });
351
+ break;
352
+ case 120: case 126: case 133:
353
+ this.$ = articulation('staccato');
354
+ break;
355
+ case 121: case 130: case 135:
356
+ this.$ = articulation('staccatissimo');
357
+ break;
358
+ case 122: case 131: case 134:
359
+ this.$ = articulation('tenuto');
360
+ break;
361
+ case 123: case 128: case 136:
362
+ this.$ = articulation('marcato');
363
+ break;
364
+ case 124: case 129: case 132:
365
+ this.$ = articulation('accent');
366
+ break;
367
+ case 125: case 127: case 137:
368
+ this.$ = articulation('portato');
369
+ break;
370
+ case 138:
371
+ this.$ = ornament('trill');
372
+ break;
373
+ case 139:
374
+ this.$ = ornament('turn');
375
+ break;
376
+ case 140:
377
+ this.$ = ornament('mordent');
378
+ break;
379
+ case 141:
380
+ this.$ = ornament('prall');
381
+ break;
382
+ case 142:
383
+ this.$ = ornament('fermata');
384
+ break;
385
+ case 143:
386
+ this.$ = ornament('shortFermata');
387
+ break;
388
+ case 144:
389
+ this.$ = ornament('arpeggio');
390
+ break;
391
+ case 145:
392
+ this.$ = dynamic('ppp');
393
+ break;
394
+ case 146:
395
+ this.$ = dynamic('pp');
396
+ break;
397
+ case 147:
398
+ this.$ = dynamic('p');
399
+ break;
400
+ case 148:
401
+ this.$ = dynamic('mp');
402
+ break;
403
+ case 149:
404
+ this.$ = dynamic('mf');
405
+ break;
406
+ case 150:
407
+ this.$ = dynamic('f');
408
+ break;
409
+ case 151:
410
+ this.$ = dynamic('ff');
411
+ break;
412
+ case 152:
413
+ this.$ = dynamic('fff');
414
+ break;
415
+ case 153: case 155:
416
+ this.$ = dynamic('sfz');
417
+ break;
418
+ case 154:
419
+ this.$ = dynamic('rfz');
420
+ break;
421
+ case 156:
422
+ this.$ = hairpin('crescendoStart');
423
+ break;
424
+ case 157:
425
+ this.$ = hairpin('diminuendoStart');
426
+ break;
427
+ case 158:
428
+ this.$ = hairpin('crescendoEnd');
429
+ break;
430
+ case 159:
431
+ this.$ = pedal('sustainOn');
432
+ break;
433
+ case 160:
434
+ this.$ = pedal('sustainOff');
435
+ break;
436
+ case 161:
437
+ this.$ = tie(true);
438
+ break;
439
+ case 162:
440
+ this.$ = slur(true);
441
+ break;
442
+ case 163:
443
+ this.$ = slur(false);
444
+ break;
445
+ case 164:
446
+ this.$ = beam(true);
447
+ break;
448
+ case 165:
449
+ this.$ = beam(false);
450
+ break;
451
+ case 166:
452
+ this.$ = ({ tremolo: Number($$[$0]) });
453
+ break;
454
+ case 167:
455
+ this.$ = ({ ...$$[$0], placement: 'above' });
456
+ break;
457
+ case 168:
458
+ this.$ = ({ ...$$[$0], placement: 'below' });
459
+ break;
460
+ case 169: case 170:
461
+ const n = Number($$[$0]); if (n >= 1 && n <= 5) this.$ = fingering(n); else this.$ = null;
462
+ break;
463
+ case 171:
464
+ this.$ = navigation('coda');
465
+ break;
466
+ case 172:
467
+ this.$ = navigation('segno');
468
+ break;
469
+ case 173:
470
+ this.$ = markupMark($$[$0].slice(1, -1));
471
+ break;
472
+ }
473
+ },
474
+ table: [o($V0,$V1,{3:1,4:2,6:3,8:4,7:5,10:6,22:8,24:18,25:19,28:20,9:[1,7],11:$V2,14:$V3,15:$V4,16:$V5,17:$V6,18:$V7,19:$V8,20:$V9,21:$Va}),{1:[3]},{5:[1,21]},o($V0,$V1,{22:8,24:18,25:19,28:20,7:22,8:23,10:24,9:[1,25],11:$V2,14:$V3,15:$V4,16:$V5,17:$V6,18:$V7,19:$V8,20:$V9,21:$Va}),o($V0,$V1,{22:8,24:18,25:19,28:20,7:26,9:$Vb}),{5:[2,5],23:$Vc},o($Vd,[2,8]),o($Ve,[2,6]),o($Vf,[2,21]),{12:[1,29]},{12:[1,30]},{12:[1,31]},{12:[1,32]},{12:[1,33]},{12:[1,34]},{12:[1,35]},{12:[1,36]},{12:[1,37]},o($Vf,[2,24],{26:[1,38]}),o($Vg,[2,25],{29:$Vh}),o($Vi,[2,28],{30:40,31:41,32:42,33:43,34:44,35:45,36:46,37:47,38:48,39:49,40:50,44:51,47:52,60:55,61:56,62:57,63:58,64:59,65:60,66:61,67:62,68:63,9:$Vj,41:$Vk,42:$Vl,43:$Vm,48:$Vn,51:$Vo,58:$Vp,59:$Vq,69:$Vr,70:$Vs,75:$Vt,77:$Vu,78:$Vv,79:$Vw,81:$Vx,82:$Vy,85:$Vz,86:$VA,87:$VB,88:$VC,91:$VD,93:$VE}),{1:[2,1]},{5:[2,2],23:$Vc},o($V0,$V1,{22:8,24:18,25:19,28:20,7:84,9:$Vb}),o($Vd,[2,9]),o($Ve,[2,10],{10:85,11:$V2,14:$V3,15:$V4,16:$V5,17:$V6,18:$V7,19:$V8,20:$V9,21:$Va}),{5:[2,4],23:$Vc},o($Ve,[2,7]),o([9,26,29,41,42,43,48,51,58,59,69,70,75,77,78,79,81,82,85,86,87,88,91,93],$V1,{24:18,25:19,28:20,22:86,5:$VF,23:$VF}),{13:[1,87]},{13:[1,88]},{13:[1,89]},{13:[1,90]},{13:[1,91]},{13:[1,92]},{13:[1,93]},{13:[1,94]},{13:[1,95]},o($Ve,[2,27],{27:96}),o($Ve,$V1,{28:97}),o($VG,[2,31]),o($VG,[2,32]),o($VG,[2,33]),o($VG,[2,34]),o($VG,[2,35]),o($VG,[2,36]),o($VG,[2,37]),o($VG,[2,38]),o($VG,[2,39]),o($VG,[2,40]),o($VG,[2,41]),o($VH,$VI,{45:98,46:99,55:$VJ}),o($VH,$VI,{45:101,46:102,55:$VJ}),o($VH,$VI,{45:103,46:104,55:$VJ}),o($VH,$VI,{45:105,46:106,55:$VJ}),o($VG,[2,66]),o($VG,[2,67]),o($VG,[2,68]),o($VG,[2,69]),o($VG,[2,70]),o($VG,[2,71]),o($VG,[2,72]),o($VG,[2,73]),o($VG,[2,74]),{31:108,32:109,44:51,47:52,48:$Vn,51:$Vo,58:$Vp,59:$Vq,89:[1,107]},{55:[1,110]},{94:[1,111]},o($VG,[2,45]),{12:[1,112]},{12:[1,113]},{12:[1,114]},{47:116,49:115,51:$Vo},o($VK,[2,54],{52:117,53:[1,118],54:[1,119]}),{12:[1,120]},{51:[1,122],71:121},{55:[1,123]},{12:[1,124],45:125,55:$VJ},{12:[1,126]},o($VG,[2,89],{83:[1,127]}),o($VG,[2,90]),o($VG,[2,91]),o($VG,[2,92]),o($VG,[2,81]),o($VG,[2,82]),{5:[2,3],23:$Vc},o($Vd,[2,11]),o($Vf,[2,22]),o($Vd,[2,12]),o($Vd,[2,13]),o($Vd,[2,14]),o($Vd,[2,15]),o($Vd,[2,16]),o($Vd,[2,17]),o($Vd,[2,18]),o($Vd,[2,19]),o($Vd,[2,20]),o($Ve,$V1,{28:20,25:128}),o($Vi,[2,29],{30:40,31:41,32:42,33:43,34:44,35:45,36:46,37:47,38:48,39:49,40:50,44:51,47:52,60:55,61:56,62:57,63:58,64:59,65:60,66:61,67:62,68:63,9:$Vj,41:$Vk,42:$Vl,43:$Vm,48:$Vn,51:$Vo,58:$Vp,59:$Vq,69:$Vr,70:$Vs,75:$Vt,77:$Vu,78:$Vv,79:$Vw,81:$Vx,82:$Vy,85:$Vz,86:$VA,87:$VB,88:$VC,91:$VD,93:$VE}),o($VK,$VI,{46:129}),o($VL,[2,48],{95:130,96:131,97:132,98:133,99:134,100:135,101:136,102:137,103:138,104:139,105:140,106:141,107:142,108:143,109:144,110:145,13:$VM,43:$VN,50:$VO,55:$VP,57:$VQ,84:$VR,111:$VS,112:$VT,113:$VU,114:$VV,115:$VW,116:$VX,117:$VY,118:$VZ,119:$V_,120:$V$,121:$V01,122:$V11,123:$V21,124:$V31,125:$V41,126:$V51,127:$V61,128:$V71,129:$V81,130:$V91,131:$Va1,132:$Vb1,133:$Vc1,134:$Vd1,135:$Ve1,136:$Vf1,137:$Vg1,138:$Vh1,139:$Vi1,140:$Vj1,141:$Vk1,142:$Vl1,143:$Vm1,144:$Vn1,145:$Vo1,146:$Vp1,147:$Vq1,148:$Vr1,149:$Vs1,150:$Vt1}),o($Vu1,[2,60],{56:192}),o($VK,$VI,{46:193}),o($VL,[2,49],{95:130,96:131,97:132,98:133,99:134,100:135,101:136,102:137,103:138,104:139,105:140,106:141,107:142,108:143,109:144,110:145,13:$VM,43:$VN,50:$VO,55:$VP,57:$VQ,84:$VR,111:$VS,112:$VT,113:$VU,114:$VV,115:$VW,116:$VX,117:$VY,118:$VZ,119:$V_,120:$V$,121:$V01,122:$V11,123:$V21,124:$V31,125:$V41,126:$V51,127:$V61,128:$V71,129:$V81,130:$V91,131:$Va1,132:$Vb1,133:$Vc1,134:$Vd1,135:$Ve1,136:$Vf1,137:$Vg1,138:$Vh1,139:$Vi1,140:$Vj1,141:$Vk1,142:$Vl1,143:$Vm1,144:$Vn1,145:$Vo1,146:$Vp1,147:$Vq1,148:$Vr1,149:$Vs1,150:$Vt1}),o($VK,$VI,{46:194}),o($VL,[2,64],{95:130,96:131,97:132,98:133,99:134,100:135,101:136,102:137,103:138,104:139,105:140,106:141,107:142,108:143,109:144,110:145,13:$VM,43:$VN,50:$VO,55:$VP,57:$VQ,84:$VR,111:$VS,112:$VT,113:$VU,114:$VV,115:$VW,116:$VX,117:$VY,118:$VZ,119:$V_,120:$V$,121:$V01,122:$V11,123:$V21,124:$V31,125:$V41,126:$V51,127:$V61,128:$V71,129:$V81,130:$V91,131:$Va1,132:$Vb1,133:$Vc1,134:$Vd1,135:$Ve1,136:$Vf1,137:$Vg1,138:$Vh1,139:$Vi1,140:$Vj1,141:$Vk1,142:$Vl1,143:$Vm1,144:$Vn1,145:$Vo1,146:$Vp1,147:$Vq1,148:$Vr1,149:$Vs1,150:$Vt1}),o($VK,$VI,{46:195}),o($VL,[2,65],{95:130,96:131,97:132,98:133,99:134,100:135,101:136,102:137,103:138,104:139,105:140,106:141,107:142,108:143,109:144,110:145,13:$VM,43:$VN,50:$VO,55:$VP,57:$VQ,84:$VR,111:$VS,112:$VT,113:$VU,114:$VV,115:$VW,116:$VX,117:$VY,118:$VZ,119:$V_,120:$V$,121:$V01,122:$V11,123:$V21,124:$V31,125:$V41,126:$V51,127:$V61,128:$V71,129:$V81,130:$V91,131:$Va1,132:$Vb1,133:$Vc1,134:$Vd1,135:$Ve1,136:$Vf1,137:$Vg1,138:$Vh1,139:$Vi1,140:$Vj1,141:$Vk1,142:$Vl1,143:$Vm1,144:$Vn1,145:$Vo1,146:$Vp1,147:$Vq1,148:$Vr1,149:$Vs1,150:$Vt1}),o($Vv1,$V1,{28:196}),o($VG,[2,94]),o($VG,[2,95]),{76:[1,197]},{55:[1,198]},o($VG,[2,42]),o($VG,[2,43]),o($VG,[2,44]),{47:200,50:[1,199],51:$Vo},o($Vw1,[2,51]),o($VK,[2,53],{53:[1,201],54:[1,202]}),o($Vx1,[2,55]),o($Vx1,[2,56]),o($VG,[2,75]),{72:203,73:[1,204],74:[1,205]},o([73,74],[2,77]),{76:[1,206]},o($VG,[2,84],{45:207,55:$VJ}),{80:[1,208]},o($VG,[2,86]),{55:[1,209],84:[1,210]},o($Vg,[2,26],{29:$Vh}),o($VL,[2,46],{95:130,96:131,97:132,98:133,99:134,100:135,101:136,102:137,103:138,104:139,105:140,106:141,107:142,108:143,109:144,110:145,13:$VM,43:$VN,50:$VO,55:$VP,57:$VQ,84:$VR,111:$VS,112:$VT,113:$VU,114:$VV,115:$VW,116:$VX,117:$VY,118:$VZ,119:$V_,120:$V$,121:$V01,122:$V11,123:$V21,124:$V31,125:$V41,126:$V51,127:$V61,128:$V71,129:$V81,130:$V91,131:$Va1,132:$Vb1,133:$Vc1,134:$Vd1,135:$Ve1,136:$Vf1,137:$Vg1,138:$Vh1,139:$Vi1,140:$Vj1,141:$Vk1,142:$Vl1,143:$Vm1,144:$Vn1,145:$Vo1,146:$Vp1,147:$Vq1,148:$Vr1,149:$Vs1,150:$Vt1}),o($VK,[2,103]),o($VK,[2,104]),o($VK,[2,105]),o($VK,[2,106]),o($VK,[2,107]),o($VK,[2,108]),o($VK,[2,109]),o($VK,[2,110]),o($VK,[2,111]),o($VK,[2,112]),o($VK,[2,113]),o($VK,[2,114]),o($VK,[2,115]),o($VK,[2,116]),o($VK,[2,117]),o($VK,[2,118]),o($VK,[2,120]),o($VK,[2,121]),o($VK,[2,122]),o($VK,[2,123]),o($VK,[2,124]),o($VK,[2,125]),o([5,9,13,23,26,29,41,42,43,48,51,58,59,69,70,75,77,78,79,81,82,85,86,87,88,90,91,93,111,112,113,114,115,116,117,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],[2,134],{50:[1,214],55:[1,217],57:[1,211],84:[1,216],118:[1,212],119:[1,213],120:[1,215]}),o($VK,[2,132]),o($VK,[2,133]),o($VK,[2,135]),o($VL,[2,136],{96:131,97:132,98:133,99:134,100:135,101:136,102:137,103:138,104:139,105:140,106:141,107:142,108:143,109:144,110:145,95:218,13:$VM,43:$VN,50:$VO,55:$VP,57:$VQ,84:$VR,111:$VS,112:$VT,113:$VU,114:$VV,115:$VW,116:$VX,117:$VY,118:$VZ,119:$V_,120:$V$,121:$V01,122:$V11,123:$V21,124:$V31,125:$V41,126:$V51,127:$V61,128:$V71,129:$V81,130:$V91,131:$Va1,132:$Vb1,133:$Vc1,134:$Vd1,135:$Ve1,136:$Vf1,137:$Vg1,138:$Vh1,139:$Vi1,140:$Vj1,141:$Vk1,142:$Vl1,143:$Vm1,144:$Vn1,145:$Vo1,146:$Vp1,147:$Vq1,148:$Vr1,149:$Vs1,150:$Vt1}),o($VL,[2,137],{96:131,97:132,98:133,99:134,100:135,101:136,102:137,103:138,104:139,105:140,106:141,107:142,108:143,109:144,110:145,95:219,13:$VM,43:$VN,50:$VO,55:$VP,57:$VQ,84:$VR,111:$VS,112:$VT,113:$VU,114:$VV,115:$VW,116:$VX,117:$VY,118:$VZ,119:$V_,120:$V$,121:$V01,122:$V11,123:$V21,124:$V31,125:$V41,126:$V51,127:$V61,128:$V71,129:$V81,130:$V91,131:$Va1,132:$Vb1,133:$Vc1,134:$Vd1,135:$Ve1,136:$Vf1,137:$Vg1,138:$Vh1,139:$Vi1,140:$Vj1,141:$Vk1,142:$Vl1,143:$Vm1,144:$Vn1,145:$Vo1,146:$Vp1,147:$Vq1,148:$Vr1,149:$Vs1,150:$Vt1}),o($VK,[2,138]),o($VK,[2,139]),o($VK,[2,140]),o($VK,[2,141]),o($VK,[2,142]),o($VK,[2,143]),o($VK,[2,144]),o($VK,[2,145]),o($VK,[2,146]),o($VK,[2,147]),o($VK,[2,148]),o($VK,[2,149]),o($VK,[2,150]),o($VK,[2,151]),o($VK,[2,152]),o($VK,[2,153]),o($VK,[2,154]),o($VK,[2,155]),o($VK,[2,156]),o($VK,[2,157]),o($VK,[2,158]),o($VK,[2,159]),o($VK,[2,160]),o($VK,[2,161]),o($VK,[2,162]),o($VK,[2,163]),o($VK,[2,164]),o($VK,[2,165]),{55:[1,220]},o($VK,[2,119]),o($VK,[2,170]),o($VK,[2,171]),o($VK,[2,172]),{12:[1,221]},o([5,9,13,23,26,29,41,42,43,48,50,51,55,58,59,69,70,75,77,78,79,80,81,82,84,85,86,87,88,90,91,93,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],[2,59],{57:[1,222]}),o($VL,[2,47],{95:130,96:131,97:132,98:133,99:134,100:135,101:136,102:137,103:138,104:139,105:140,106:141,107:142,108:143,109:144,110:145,13:$VM,43:$VN,50:$VO,55:$VP,57:$VQ,84:$VR,111:$VS,112:$VT,113:$VU,114:$VV,115:$VW,116:$VX,117:$VY,118:$VZ,119:$V_,120:$V$,121:$V01,122:$V11,123:$V21,124:$V31,125:$V41,126:$V51,127:$V61,128:$V71,129:$V81,130:$V91,131:$Va1,132:$Vb1,133:$Vc1,134:$Vd1,135:$Ve1,136:$Vf1,137:$Vg1,138:$Vh1,139:$Vi1,140:$Vj1,141:$Vk1,142:$Vl1,143:$Vm1,144:$Vn1,145:$Vo1,146:$Vp1,147:$Vq1,148:$Vr1,149:$Vs1,150:$Vt1}),o($VL,[2,62],{95:130,96:131,97:132,98:133,99:134,100:135,101:136,102:137,103:138,104:139,105:140,106:141,107:142,108:143,109:144,110:145,13:$VM,43:$VN,50:$VO,55:$VP,57:$VQ,84:$VR,111:$VS,112:$VT,113:$VU,114:$VV,115:$VW,116:$VX,117:$VY,118:$VZ,119:$V_,120:$V$,121:$V01,122:$V11,123:$V21,124:$V31,125:$V41,126:$V51,127:$V61,128:$V71,129:$V81,130:$V91,131:$Va1,132:$Vb1,133:$Vc1,134:$Vd1,135:$Ve1,136:$Vf1,137:$Vg1,138:$Vh1,139:$Vi1,140:$Vj1,141:$Vk1,142:$Vl1,143:$Vm1,144:$Vn1,145:$Vo1,146:$Vp1,147:$Vq1,148:$Vr1,149:$Vs1,150:$Vt1}),o($VL,[2,63],{95:130,96:131,97:132,98:133,99:134,100:135,101:136,102:137,103:138,104:139,105:140,106:141,107:142,108:143,109:144,110:145,13:$VM,43:$VN,50:$VO,55:$VP,57:$VQ,84:$VR,111:$VS,112:$VT,113:$VU,114:$VV,115:$VW,116:$VX,117:$VY,118:$VZ,119:$V_,120:$V$,121:$V01,122:$V11,123:$V21,124:$V31,125:$V41,126:$V51,127:$V61,128:$V71,129:$V81,130:$V91,131:$Va1,132:$Vb1,133:$Vc1,134:$Vd1,135:$Ve1,136:$Vf1,137:$Vg1,138:$Vh1,139:$Vi1,140:$Vj1,141:$Vk1,142:$Vl1,143:$Vm1,144:$Vn1,145:$Vo1,146:$Vp1,147:$Vq1,148:$Vr1,149:$Vs1,150:$Vt1}),{9:$Vj,30:40,31:41,32:42,33:43,34:44,35:45,36:46,37:47,38:48,39:49,40:50,41:$Vk,42:$Vl,43:$Vm,44:51,47:52,48:$Vn,51:$Vo,58:$Vp,59:$Vq,60:55,61:56,62:57,63:58,64:59,65:60,66:61,67:62,68:63,69:$Vr,70:$Vs,75:$Vt,77:$Vu,78:$Vv,79:$Vw,81:$Vx,82:$Vy,85:$Vz,86:$VA,87:$VB,88:$VC,90:[1,223],91:$VD,93:$VE},{55:[1,224]},{89:[1,225]},o($VK,[2,50]),o($Vw1,[2,52]),o($Vx1,[2,57]),o($Vx1,[2,58]),o($VG,[2,76]),o($VG,[2,78]),o($VG,[2,79]),{55:[1,226]},{80:[1,227]},{55:[1,228]},o($VG,[2,87]),{55:[1,229]},o($VK,[2,126]),o($VK,[2,127]),o($VK,[2,128]),o($VK,[2,129]),o($VK,[2,130]),o($VK,[2,131]),o($VK,[2,169]),o($VK,[2,167]),o($VK,[2,168]),o($VK,[2,166]),o($VK,[2,173]),o($Vu1,[2,61]),o($VG,[2,93]),{89:[1,230]},{44:233,47:232,48:$Vn,51:$Vo,92:231},o($VG,[2,80]),{55:[1,234]},o($VG,[2,85]),o($VG,[2,88]),o($Vv1,$V1,{28:235}),{44:233,45:236,47:232,48:$Vn,51:$Vo,55:$VJ,92:237},o($Vy1,[2,97]),o($Vy1,[2,98]),o($VG,[2,83]),{9:$Vj,30:40,31:41,32:42,33:43,34:44,35:45,36:46,37:47,38:48,39:49,40:50,41:$Vk,42:$Vl,43:$Vm,44:51,47:52,48:$Vn,51:$Vo,58:$Vp,59:$Vq,60:55,61:56,62:57,63:58,64:59,65:60,66:61,67:62,68:63,69:$Vr,70:$Vs,75:$Vt,77:$Vu,78:$Vv,79:$Vw,81:$Vx,82:$Vy,85:$Vz,86:$VA,87:$VB,88:$VC,90:[1,238],91:$VD,93:$VE},{44:233,47:232,48:$Vn,51:$Vo,92:239},{90:[1,240]},o($VG,[2,96]),{45:241,55:$VJ,90:[1,242]},o($VG,[2,101]),{90:[1,243]},o($VG,[2,100]),o($VG,[2,99])],
475
+ defaultActions: {21:[2,1]},
476
+ parseError: function parseError (str, hash) {
477
+ if (hash.recoverable) {
478
+ this.trace(str);
479
+ } else {
480
+ var error = new Error(str);
481
+ error.hash = hash;
482
+ throw error;
483
+ }
484
+ },
485
+ parse: function parse(input) {
486
+ var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = '', yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1;
487
+ var args = lstack.slice.call(arguments, 1);
488
+ var lexer = Object.create(this.lexer);
489
+ var sharedState = { yy: {} };
490
+ for (var k in this.yy) {
491
+ if (Object.prototype.hasOwnProperty.call(this.yy, k)) {
492
+ sharedState.yy[k] = this.yy[k];
493
+ }
494
+ }
495
+ lexer.setInput(input, sharedState.yy);
496
+ sharedState.yy.lexer = lexer;
497
+ sharedState.yy.parser = this;
498
+ if (typeof lexer.yylloc == 'undefined') {
499
+ lexer.yylloc = {};
500
+ }
501
+ var yyloc = lexer.yylloc;
502
+ lstack.push(yyloc);
503
+ var ranges = lexer.options && lexer.options.ranges;
504
+ if (typeof sharedState.yy.parseError === 'function') {
505
+ this.parseError = sharedState.yy.parseError;
506
+ } else {
507
+ this.parseError = Object.getPrototypeOf(this).parseError;
508
+ }
509
+ function popStack(n) {
510
+ stack.length = stack.length - 2 * n;
511
+ vstack.length = vstack.length - n;
512
+ lstack.length = lstack.length - n;
513
+ }
514
+ _token_stack:
515
+ var lex = function () {
516
+ var token;
517
+ token = lexer.lex() || EOF;
518
+ if (typeof token !== 'number') {
519
+ token = self.symbols_[token] || token;
520
+ }
521
+ return token;
522
+ };
523
+ var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected;
524
+ while (true) {
525
+ state = stack[stack.length - 1];
526
+ if (this.defaultActions[state]) {
527
+ action = this.defaultActions[state];
528
+ } else {
529
+ if (symbol === null || typeof symbol == 'undefined') {
530
+ symbol = lex();
531
+ }
532
+ action = table[state] && table[state][symbol];
533
+ }
534
+ if (typeof action === 'undefined' || !action.length || !action[0]) {
535
+ var errStr = '';
536
+ expected = [];
537
+ for (p in table[state]) {
538
+ if (this.terminals_[p] && p > TERROR) {
539
+ expected.push('\'' + this.terminals_[p] + '\'');
540
+ }
541
+ }
542
+ if (lexer.showPosition) {
543
+ errStr = 'Parse error on line ' + (yylineno + 1) + ':\n' + lexer.showPosition() + '\nExpecting ' + expected.join(', ') + ', got \'' + (this.terminals_[symbol] || symbol) + '\'';
544
+ } else {
545
+ errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\'' + (this.terminals_[symbol] || symbol) + '\'');
546
+ }
547
+ this.parseError(errStr, {
548
+ text: lexer.match,
549
+ token: this.terminals_[symbol] || symbol,
550
+ line: lexer.yylineno,
551
+ loc: yyloc,
552
+ expected: expected
553
+ });
554
+ }
555
+ if (action[0] instanceof Array && action.length > 1) {
556
+ throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol);
557
+ }
558
+ switch (action[0]) {
559
+ case 1:
560
+ stack.push(symbol);
561
+ vstack.push(lexer.yytext);
562
+ lstack.push(lexer.yylloc);
563
+ stack.push(action[1]);
564
+ symbol = null;
565
+ if (!preErrorSymbol) {
566
+ yyleng = lexer.yyleng;
567
+ yytext = lexer.yytext;
568
+ yylineno = lexer.yylineno;
569
+ yyloc = lexer.yylloc;
570
+ if (recovering > 0) {
571
+ recovering--;
572
+ }
573
+ } else {
574
+ symbol = preErrorSymbol;
575
+ preErrorSymbol = null;
576
+ }
577
+ break;
578
+ case 2:
579
+ len = this.productions_[action[1]][1];
580
+ yyval.$ = vstack[vstack.length - len];
581
+ yyval._$ = {
582
+ first_line: lstack[lstack.length - (len || 1)].first_line,
583
+ last_line: lstack[lstack.length - 1].last_line,
584
+ first_column: lstack[lstack.length - (len || 1)].first_column,
585
+ last_column: lstack[lstack.length - 1].last_column
586
+ };
587
+ if (ranges) {
588
+ yyval._$.range = [
589
+ lstack[lstack.length - (len || 1)].range[0],
590
+ lstack[lstack.length - 1].range[1]
591
+ ];
592
+ }
593
+ r = this.performAction.apply(yyval, [
594
+ yytext,
595
+ yyleng,
596
+ yylineno,
597
+ sharedState.yy,
598
+ action[1],
599
+ vstack,
600
+ lstack
601
+ ].concat(args));
602
+ if (typeof r !== 'undefined') {
603
+ return r;
604
+ }
605
+ if (len) {
606
+ stack = stack.slice(0, -1 * len * 2);
607
+ vstack = vstack.slice(0, -1 * len);
608
+ lstack = lstack.slice(0, -1 * len);
609
+ }
610
+ stack.push(this.productions_[action[1]][0]);
611
+ vstack.push(yyval.$);
612
+ lstack.push(yyval._$);
613
+ newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
614
+ stack.push(newState);
615
+ break;
616
+ case 3:
617
+ return true;
618
+ }
619
+ }
620
+ return true;
621
+ }};
622
+
623
+ // Helper functions
624
+ const fraction = (numerator, denominator) => ({ numerator, denominator });
625
+
626
+ const pitch = (phonet, accidental, octave) => ({
627
+ phonet,
628
+ accidental: accidental || undefined,
629
+ octave: octave || 0,
630
+ });
631
+
632
+ const duration = (division, dots) => ({
633
+ division,
634
+ dots: dots || 0,
635
+ });
636
+
637
+ const noteEvent = (pitches, dur, marks, options = {}) => {
638
+ // Check if this is a pitched rest (e.g., g'\rest)
639
+ const pitchedRestMark = marks && marks.find(m => m && m.pitchedRest);
640
+ if (pitchedRestMark) {
641
+ const pitch = Array.isArray(pitches) ? pitches[0] : pitches;
642
+ return {
643
+ type: 'rest',
644
+ duration: dur,
645
+ pitch: pitch,
646
+ };
647
+ }
648
+ return {
649
+ type: 'note',
650
+ pitches: Array.isArray(pitches) ? pitches : [pitches],
651
+ duration: dur,
652
+ marks: marks && marks.length ? marks : undefined,
653
+ ...options,
654
+ };
655
+ };
656
+
657
+ const restEvent = (dur, options = {}) => ({
658
+ type: 'rest',
659
+ duration: dur,
660
+ ...options,
661
+ });
662
+
663
+ const contextChange = (changes) => ({
664
+ type: 'context',
665
+ ...changes,
666
+ });
667
+
668
+ const keySignature = (phonet, accidental, mode) => ({
669
+ pitch: phonet,
670
+ accidental: accidental || undefined,
671
+ mode,
672
+ });
673
+
674
+ const voice = (staff, events) => ({
675
+ staff: staff || 1,
676
+ events,
677
+ });
678
+
679
+ const part = (voices, name) => ({
680
+ name: name || undefined,
681
+ voices,
682
+ });
683
+
684
+ const measure = (parts, key, timeSig, partial) => ({
685
+ key: key || undefined,
686
+ timeSig: timeSig || undefined,
687
+ parts,
688
+ partial: partial || undefined,
689
+ });
690
+
691
+ const tupletEvent = (ratio, events) => ({
692
+ type: 'tuplet',
693
+ ratio,
694
+ events,
695
+ });
696
+
697
+ const tremoloEvent = (pitchA, pitchB, count, division) => ({
698
+ type: 'tremolo',
699
+ pitchA,
700
+ pitchB,
701
+ count,
702
+ division,
703
+ });
704
+
705
+ // Articulation/mark helpers - all marks have markType for discrimination
706
+ const articulation = (type, placement) => ({ markType: 'articulation', type, placement });
707
+ const ornament = (type) => ({ markType: 'ornament', type });
708
+ const dynamic = (type) => ({ markType: 'dynamic', type });
709
+ const hairpin = (type) => ({ markType: 'hairpin', type });
710
+ const pedal = (type) => ({ markType: 'pedal', type });
711
+ const tie = (start) => ({ markType: 'tie', start });
712
+ const slur = (start) => ({ markType: 'slur', start });
713
+ const beam = (start) => ({ markType: 'beam', start });
714
+ const fingering = (finger, placement) => ({ markType: 'fingering', finger, placement });
715
+ const navigation = (type) => ({ markType: 'navigation', type });
716
+
717
+ const barlineEvent = (style) => ({ type: 'barline', style });
718
+ const harmonyEvent = (text) => ({ type: 'harmony', text });
719
+ const markupEvent = (content, placement) => ({ type: 'markup', content, placement: placement || undefined });
720
+ const markupMark = (content) => ({ markType: 'markup', content });
721
+
722
+ // Parse PITCH token (e.g., "c", "cs", "bf", "css", "bff") into phonet and accidental
723
+ const parsePitch = (text, octave) => {
724
+ const phonet = text[0].toLowerCase();
725
+ const accStr = text.slice(1).toLowerCase();
726
+ let accidental = undefined;
727
+ if (accStr === 's') accidental = 'sharp';
728
+ else if (accStr === 'f') accidental = 'flat';
729
+ else if (accStr === 'ss') accidental = 'doubleSharp';
730
+ else if (accStr === 'ff') accidental = 'doubleFlat';
731
+ return pitch(phonet, accidental, octave || 0);
732
+ };
733
+
734
+ // Parse PITCH token for key signature (no octave)
735
+ const parsePitchName = (text) => {
736
+ const phonet = text[0].toLowerCase();
737
+ const accStr = text.slice(1).toLowerCase();
738
+ let accidental = undefined;
739
+ if (accStr === 's') accidental = 'sharp';
740
+ else if (accStr === 'f') accidental = 'flat';
741
+ else if (accStr === 'ss') accidental = 'doubleSharp';
742
+ else if (accStr === 'ff') accidental = 'doubleFlat';
743
+ return { phonet, accidental };
744
+ };
745
+
746
+ // Global state for parsing
747
+ let currentStaff = 1;
748
+ let currentKey = null;
749
+ let currentTimeSig = null;
750
+ let currentDuration = { division: 4, dots: 0 }; // default quarter note
751
+ let numericTimeSignature = false; // When true, 4/4 and 2/2 use numeric display instead of C/C|
752
+ let currentOttava = 0; // Current ottava level, resets on newline
753
+
754
+ // Reset parser state - call before each parse
755
+ const resetParserState = () => {
756
+ currentStaff = 1;
757
+ currentKey = null;
758
+ currentTimeSig = null;
759
+ currentDuration = { division: 4, dots: 0 };
760
+ numericTimeSignature = false;
761
+ currentOttava = 0;
762
+ };
763
+
764
+ // Export reset function
765
+ parser.resetState = resetParserState;
766
+ /* generated by jison-lex 0.3.4 */
767
+ var lexer = (function(){
768
+ var lexer = ({
769
+
770
+ EOF:1,
771
+
772
+ parseError:function parseError(str, hash) {
773
+ if (this.yy.parser) {
774
+ this.yy.parser.parseError(str, hash);
775
+ } else {
776
+ throw new Error(str);
777
+ }
778
+ },
779
+
780
+ // resets the lexer, sets new input
781
+ setInput:function (input, yy) {
782
+ this.yy = yy || this.yy || {};
783
+ this._input = input;
784
+ this._more = this._backtrack = this.done = false;
785
+ this.yylineno = this.yyleng = 0;
786
+ this.yytext = this.matched = this.match = '';
787
+ this.conditionStack = ['INITIAL'];
788
+ this.yylloc = {
789
+ first_line: 1,
790
+ first_column: 0,
791
+ last_line: 1,
792
+ last_column: 0
793
+ };
794
+ if (this.options.ranges) {
795
+ this.yylloc.range = [0,0];
796
+ }
797
+ this.offset = 0;
798
+ return this;
799
+ },
800
+
801
+ // consumes and returns one char from the input
802
+ input:function () {
803
+ var ch = this._input[0];
804
+ this.yytext += ch;
805
+ this.yyleng++;
806
+ this.offset++;
807
+ this.match += ch;
808
+ this.matched += ch;
809
+ var lines = ch.match(/(?:\r\n?|\n).*/g);
810
+ if (lines) {
811
+ this.yylineno++;
812
+ this.yylloc.last_line++;
813
+ } else {
814
+ this.yylloc.last_column++;
815
+ }
816
+ if (this.options.ranges) {
817
+ this.yylloc.range[1]++;
818
+ }
819
+
820
+ this._input = this._input.slice(1);
821
+ return ch;
822
+ },
823
+
824
+ // unshifts one char (or a string) into the input
825
+ unput:function (ch) {
826
+ var len = ch.length;
827
+ var lines = ch.split(/(?:\r\n?|\n)/g);
828
+
829
+ this._input = ch + this._input;
830
+ this.yytext = this.yytext.substr(0, this.yytext.length - len);
831
+ //this.yyleng -= len;
832
+ this.offset -= len;
833
+ var oldLines = this.match.split(/(?:\r\n?|\n)/g);
834
+ this.match = this.match.substr(0, this.match.length - 1);
835
+ this.matched = this.matched.substr(0, this.matched.length - 1);
836
+
837
+ if (lines.length - 1) {
838
+ this.yylineno -= lines.length - 1;
839
+ }
840
+ var r = this.yylloc.range;
841
+
842
+ this.yylloc = {
843
+ first_line: this.yylloc.first_line,
844
+ last_line: this.yylineno + 1,
845
+ first_column: this.yylloc.first_column,
846
+ last_column: lines ?
847
+ (lines.length === oldLines.length ? this.yylloc.first_column : 0)
848
+ + oldLines[oldLines.length - lines.length].length - lines[0].length :
849
+ this.yylloc.first_column - len
850
+ };
851
+
852
+ if (this.options.ranges) {
853
+ this.yylloc.range = [r[0], r[0] + this.yyleng - len];
854
+ }
855
+ this.yyleng = this.yytext.length;
856
+ return this;
857
+ },
858
+
859
+ // When called from action, caches matched text and appends it on next action
860
+ more:function () {
861
+ this._more = true;
862
+ return this;
863
+ },
864
+
865
+ // When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead.
866
+ reject:function () {
867
+ if (this.options.backtrack_lexer) {
868
+ this._backtrack = true;
869
+ } else {
870
+ return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n' + this.showPosition(), {
871
+ text: "",
872
+ token: null,
873
+ line: this.yylineno
874
+ });
875
+
876
+ }
877
+ return this;
878
+ },
879
+
880
+ // retain first n characters of the match
881
+ less:function (n) {
882
+ this.unput(this.match.slice(n));
883
+ },
884
+
885
+ // displays already matched input, i.e. for error messages
886
+ pastInput:function () {
887
+ var past = this.matched.substr(0, this.matched.length - this.match.length);
888
+ return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\n/g, "");
889
+ },
890
+
891
+ // displays upcoming input, i.e. for error messages
892
+ upcomingInput:function () {
893
+ var next = this.match;
894
+ if (next.length < 20) {
895
+ next += this._input.substr(0, 20-next.length);
896
+ }
897
+ return (next.substr(0,20) + (next.length > 20 ? '...' : '')).replace(/\n/g, "");
898
+ },
899
+
900
+ // displays the character position where the lexing error occurred, i.e. for error messages
901
+ showPosition:function () {
902
+ var pre = this.pastInput();
903
+ var c = new Array(pre.length + 1).join("-");
904
+ return pre + this.upcomingInput() + "\n" + c + "^";
905
+ },
906
+
907
+ // test the lexed token: return FALSE when not a match, otherwise return token
908
+ test_match:function(match, indexed_rule) {
909
+ var token,
910
+ lines,
911
+ backup;
912
+
913
+ if (this.options.backtrack_lexer) {
914
+ // save context
915
+ backup = {
916
+ yylineno: this.yylineno,
917
+ yylloc: {
918
+ first_line: this.yylloc.first_line,
919
+ last_line: this.last_line,
920
+ first_column: this.yylloc.first_column,
921
+ last_column: this.yylloc.last_column
922
+ },
923
+ yytext: this.yytext,
924
+ match: this.match,
925
+ matches: this.matches,
926
+ matched: this.matched,
927
+ yyleng: this.yyleng,
928
+ offset: this.offset,
929
+ _more: this._more,
930
+ _input: this._input,
931
+ yy: this.yy,
932
+ conditionStack: this.conditionStack.slice(0),
933
+ done: this.done
934
+ };
935
+ if (this.options.ranges) {
936
+ backup.yylloc.range = this.yylloc.range.slice(0);
937
+ }
938
+ }
939
+
940
+ lines = match[0].match(/(?:\r\n?|\n).*/g);
941
+ if (lines) {
942
+ this.yylineno += lines.length;
943
+ }
944
+ this.yylloc = {
945
+ first_line: this.yylloc.last_line,
946
+ last_line: this.yylineno + 1,
947
+ first_column: this.yylloc.last_column,
948
+ last_column: lines ?
949
+ lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length :
950
+ this.yylloc.last_column + match[0].length
951
+ };
952
+ this.yytext += match[0];
953
+ this.match += match[0];
954
+ this.matches = match;
955
+ this.yyleng = this.yytext.length;
956
+ if (this.options.ranges) {
957
+ this.yylloc.range = [this.offset, this.offset += this.yyleng];
958
+ }
959
+ this._more = false;
960
+ this._backtrack = false;
961
+ this._input = this._input.slice(match[0].length);
962
+ this.matched += match[0];
963
+ token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);
964
+ if (this.done && this._input) {
965
+ this.done = false;
966
+ }
967
+ if (token) {
968
+ return token;
969
+ } else if (this._backtrack) {
970
+ // recover context
971
+ for (var k in backup) {
972
+ this[k] = backup[k];
973
+ }
974
+ return false; // rule action called reject() implying the next rule should be tested instead.
975
+ }
976
+ return false;
977
+ },
978
+
979
+ // return next match in input
980
+ next:function () {
981
+ if (this.done) {
982
+ return this.EOF;
983
+ }
984
+ if (!this._input) {
985
+ this.done = true;
986
+ }
987
+
988
+ var token,
989
+ match,
990
+ tempMatch,
991
+ index;
992
+ if (!this._more) {
993
+ this.yytext = '';
994
+ this.match = '';
995
+ }
996
+ var rules = this._currentRules();
997
+ for (var i = 0; i < rules.length; i++) {
998
+ tempMatch = this._input.match(this.rules[rules[i]]);
999
+ if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
1000
+ match = tempMatch;
1001
+ index = i;
1002
+ if (this.options.backtrack_lexer) {
1003
+ token = this.test_match(tempMatch, rules[i]);
1004
+ if (token !== false) {
1005
+ return token;
1006
+ } else if (this._backtrack) {
1007
+ match = false;
1008
+ continue; // rule action called reject() implying a rule MISmatch.
1009
+ } else {
1010
+ // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)
1011
+ return false;
1012
+ }
1013
+ } else if (!this.options.flex) {
1014
+ break;
1015
+ }
1016
+ }
1017
+ }
1018
+ if (match) {
1019
+ token = this.test_match(match, rules[index]);
1020
+ if (token !== false) {
1021
+ return token;
1022
+ }
1023
+ // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)
1024
+ return false;
1025
+ }
1026
+ if (this._input === "") {
1027
+ return this.EOF;
1028
+ } else {
1029
+ return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\n' + this.showPosition(), {
1030
+ text: "",
1031
+ token: null,
1032
+ line: this.yylineno
1033
+ });
1034
+ }
1035
+ },
1036
+
1037
+ // return next match that has a token
1038
+ lex:function lex () {
1039
+ var r = this.next();
1040
+ if (r) {
1041
+ return r;
1042
+ } else {
1043
+ return this.lex();
1044
+ }
1045
+ },
1046
+
1047
+ // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
1048
+ begin:function begin (condition) {
1049
+ this.conditionStack.push(condition);
1050
+ },
1051
+
1052
+ // pop the previously active lexer condition state off the condition stack
1053
+ popState:function popState () {
1054
+ var n = this.conditionStack.length - 1;
1055
+ if (n > 0) {
1056
+ return this.conditionStack.pop();
1057
+ } else {
1058
+ return this.conditionStack[0];
1059
+ }
1060
+ },
1061
+
1062
+ // produce the lexer rule set which is active for the currently active lexer condition state
1063
+ _currentRules:function _currentRules () {
1064
+ if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {
1065
+ return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;
1066
+ } else {
1067
+ return this.conditions["INITIAL"].rules;
1068
+ }
1069
+ },
1070
+
1071
+ // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
1072
+ topState:function topState (n) {
1073
+ n = this.conditionStack.length - 1 - Math.abs(n || 0);
1074
+ if (n >= 0) {
1075
+ return this.conditionStack[n];
1076
+ } else {
1077
+ return "INITIAL";
1078
+ }
1079
+ },
1080
+
1081
+ // alias for begin(condition)
1082
+ pushState:function pushState (condition) {
1083
+ this.begin(condition);
1084
+ },
1085
+
1086
+ // return the number of states currently on the stack
1087
+ stateStackSize:function stateStackSize() {
1088
+ return this.conditionStack.length;
1089
+ },
1090
+ options: {},
1091
+ performAction: function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) {
1092
+ var YYSTATE=YY_START;
1093
+ switch($avoiding_name_collisions) {
1094
+ case 0:
1095
+ break;
1096
+ case 1:return 9
1097
+ break;
1098
+ case 2:
1099
+ break;
1100
+ case 3:return 11
1101
+ break;
1102
+ case 4:return 14
1103
+ break;
1104
+ case 5:return 15
1105
+ break;
1106
+ case 6:return 16
1107
+ break;
1108
+ case 7:return 17
1109
+ break;
1110
+ case 8:return 18
1111
+ break;
1112
+ case 9:return 19
1113
+ break;
1114
+ case 10:return 20
1115
+ break;
1116
+ case 11:return 21
1117
+ break;
1118
+ case 12:return 13
1119
+ break;
1120
+ case 13:return 12
1121
+ break;
1122
+ case 14:return 69
1123
+ break;
1124
+ case 15:return 70
1125
+ break;
1126
+ case 16:return 75
1127
+ break;
1128
+ case 17:return 77
1129
+ break;
1130
+ case 18:return 78
1131
+ break;
1132
+ case 19:return 79
1133
+ break;
1134
+ case 20:return 81
1135
+ break;
1136
+ case 21:return 88
1137
+ break;
1138
+ case 22:return 91
1139
+ break;
1140
+ case 23:return 93
1141
+ break;
1142
+ case 24:return 82
1143
+ break;
1144
+ case 25:return 85
1145
+ break;
1146
+ case 26:return 86
1147
+ break;
1148
+ case 27:return 87
1149
+ break;
1150
+ case 28:return 73
1151
+ break;
1152
+ case 29:return 74
1153
+ break;
1154
+ case 30:return 142
1155
+ break;
1156
+ case 31:return 143
1157
+ break;
1158
+ case 32:return 41
1159
+ break;
1160
+ case 33:return 149
1161
+ break;
1162
+ case 34:return 150
1163
+ break;
1164
+ case 35:return 42
1165
+ break;
1166
+ case 36:return 43
1167
+ break;
1168
+ case 37:return 139
1169
+ break;
1170
+ case 38:return 140
1171
+ break;
1172
+ case 39:return 141
1173
+ break;
1174
+ case 40:return 112
1175
+ break;
1176
+ case 41:return 113
1177
+ break;
1178
+ case 42:return 114
1179
+ break;
1180
+ case 43:return 115
1181
+ break;
1182
+ case 44:return 116
1183
+ break;
1184
+ case 45:return 117
1185
+ break;
1186
+ case 46:return 121
1187
+ break;
1188
+ case 47:return 122
1189
+ break;
1190
+ case 48:return 123
1191
+ break;
1192
+ case 49:return 124
1193
+ break;
1194
+ case 50:return 125
1195
+ break;
1196
+ case 51:return 126
1197
+ break;
1198
+ case 52:return 127
1199
+ break;
1200
+ case 53:return 128
1201
+ break;
1202
+ case 54:return 129
1203
+ break;
1204
+ case 55:return 131
1205
+ break;
1206
+ case 56:return 132
1207
+ break;
1208
+ case 57:return 135
1209
+ break;
1210
+ case 58:return 134
1211
+ break;
1212
+ case 59:return 136
1213
+ break;
1214
+ case 60:return 137
1215
+ break;
1216
+ case 61:return 138
1217
+ break;
1218
+ case 62:return 130
1219
+ break;
1220
+ case 63:return 133
1221
+ break;
1222
+ case 64:return 111
1223
+ break;
1224
+ case 65:return 26
1225
+ break;
1226
+ case 66:return 29
1227
+ break;
1228
+ case 67:return 94
1229
+ break;
1230
+ case 68:return 51
1231
+ break;
1232
+ case 69:return 53
1233
+ break;
1234
+ case 70:return 54
1235
+ break;
1236
+ case 71:return 55
1237
+ break;
1238
+ case 72:return 76
1239
+ break;
1240
+ case 73:return 83
1241
+ break;
1242
+ case 74:return 89
1243
+ break;
1244
+ case 75:return 90
1245
+ break;
1246
+ case 76:return 48
1247
+ break;
1248
+ case 77:return 50
1249
+ break;
1250
+ case 78:return 23
1251
+ break;
1252
+ case 79:return 147
1253
+ break;
1254
+ case 80:return 13
1255
+ break;
1256
+ case 81:return 145
1257
+ break;
1258
+ case 82:return 146
1259
+ break;
1260
+ case 83:return 144
1261
+ break;
1262
+ case 84:return 57
1263
+ break;
1264
+ case 85:return 84
1265
+ break;
1266
+ case 86:return 118
1267
+ break;
1268
+ case 87:return 119
1269
+ break;
1270
+ case 88:return 120
1271
+ break;
1272
+ case 89:return 148
1273
+ break;
1274
+ case 90:return 80
1275
+ break;
1276
+ case 91:return 58
1277
+ break;
1278
+ case 92:return 59
1279
+ break;
1280
+ case 93:return 5
1281
+ break;
1282
+ case 94:
1283
+ break;
1284
+ }
1285
+ },
1286
+ rules: [/^(?:[ \t]+)/,/^(?:(\r?\n)+)/,/^(?:%.*)/,/^(?:\[title\b)/,/^(?:\[subtitle\b)/,/^(?:\[composer\b)/,/^(?:\[arranger\b)/,/^(?:\[lyricist\b)/,/^(?:\[opus\b)/,/^(?:\[instrument\b)/,/^(?:\[genre\b)/,/^(?:\[auto-beam\b)/,/^(?:\])/,/^(?:"[^"]*")/,/^(?:\\clef\b)/,/^(?:\\key\b)/,/^(?:\\time\b)/,/^(?:\\numericTimeSignature\b)/,/^(?:\\defaultTimeSignature\b)/,/^(?:\\tempo\b)/,/^(?:\\staff\b)/,/^(?:\\grace\b)/,/^(?:\\times\b)/,/^(?:\\repeat\b)/,/^(?:\\ottava\b)/,/^(?:\\stemUp\b)/,/^(?:\\stemDown\b)/,/^(?:\\stemNeutral\b)/,/^(?:\\major\b)/,/^(?:\\minor\b)/,/^(?:\\sustainOn\b)/,/^(?:\\sustainOff\b)/,/^(?:\\bar\b)/,/^(?:\\coda\b)/,/^(?:\\segno\b)/,/^(?:\\chords\b)/,/^(?:\\markup\b)/,/^(?:\\<)/,/^(?:\\>)/,/^(?:\\!)/,/^(?:\\staccato\b)/,/^(?:\\staccatissimo\b)/,/^(?:\\tenuto\b)/,/^(?:\\marcato\b)/,/^(?:\\accent\b)/,/^(?:\\portato\b)/,/^(?:\\trill\b)/,/^(?:\\turn\b)/,/^(?:\\mordent\b)/,/^(?:\\prall\b)/,/^(?:\\fermata\b)/,/^(?:\\shortfermata\b)/,/^(?:\\arpeggio\b)/,/^(?:\\ppp\b)/,/^(?:\\pp\b)/,/^(?:\\mp\b)/,/^(?:\\mf\b)/,/^(?:\\fff\b)/,/^(?:\\ff\b)/,/^(?:\\sfz\b)/,/^(?:\\rfz\b)/,/^(?:\\sf\b)/,/^(?:\\p\b)/,/^(?:\\f)/,/^(?:\\rest\b)/,/^(?:\\\\\\)/,/^(?:\\\\)/,/^(?:tremolo\b)/,/^(?:[a-g](ss|ff|s|f)?)/,/^(?:')/,/^(?:,)/,/^(?:[0-9]+)/,/^(?:\/)/,/^(?:#)/,/^(?:\{)/,/^(?:\})/,/^(?:<)/,/^(?:>)/,/^(?:\|)/,/^(?:\[)/,/^(?:\])/,/^(?:\()/,/^(?:\))/,/^(?:~)/,/^(?:\.)/,/^(?:-)/,/^(?:[_])/,/^(?:\^)/,/^(?:!)/,/^(?::)/,/^(?:=)/,/^(?:[rR])/,/^(?:[sS])/,/^(?:$)/,/^(?:.)/],
1287
+ conditions: {"INITIAL":{"rules":[0,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],"inclusive":true}}
1288
+ });
1289
+ return lexer;
1290
+ })();
1291
+ parser.lexer = lexer;
1292
+ function Parser () {
1293
+ this.yy = {};
1294
+ }
1295
+ Parser.prototype = parser;parser.Parser = Parser;
1296
+ return new Parser;
1297
+ })(), writable: false, configurable: false });
1298
+
1299
+
1300
+
1301
+ // ES module exports
1302
+ const __grammar = globalThis["__lilyletGrammar__"];
1303
+ const __parser = globalThis["__lilyletGrammar__"];
1304
+ const __Parser = globalThis["__lilyletGrammar__"].Parser;
1305
+ const __parse = function() { return globalThis["__lilyletGrammar__"].parse.apply(globalThis["__lilyletGrammar__"], arguments); };
1306
+
1307
+ export { __grammar as grammar, __parser as parser, __Parser as Parser, __parse as parse };
1308
+ export default __grammar;