musicxml-io 0.7.0 → 0.7.2

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.
package/dist/index.js CHANGED
@@ -127,7 +127,7 @@
127
127
 
128
128
 
129
129
 
130
- var _chunkYCNKCOR2js = require('./chunk-YCNKCOR2.js');
130
+ var _chunkS5MWUJU2js = require('./chunk-S5MWUJU2.js');
131
131
 
132
132
 
133
133
 
@@ -213,7 +213,12 @@ var _chunkYCNKCOR2js = require('./chunk-YCNKCOR2.js');
213
213
 
214
214
 
215
215
 
216
- var _chunkCJZK2DGVjs = require('./chunk-CJZK2DGV.js');
216
+
217
+
218
+
219
+
220
+
221
+ var _chunkCHMV7XWYjs = require('./chunk-CHMV7XWY.js');
217
222
 
218
223
  // src/importers/musicxml.ts
219
224
  var _txml = require('txml');
@@ -355,7 +360,7 @@ function parseScorePartwise(elements) {
355
360
  const defaults = parseDefaults(elements);
356
361
  const credits = parseCredits(elements);
357
362
  return {
358
- _id: _chunkYCNKCOR2js.generateId.call(void 0, ),
363
+ _id: _chunkS5MWUJU2js.generateId.call(void 0, ),
359
364
  metadata,
360
365
  partList,
361
366
  parts,
@@ -612,7 +617,7 @@ function parseSystemLayout(elements) {
612
617
  }
613
618
  function parseCredits(elements) {
614
619
  const credits = collectElements(elements, "credit", (content, attrs) => {
615
- const credit = { _id: _chunkYCNKCOR2js.generateId.call(void 0, ) };
620
+ const credit = { _id: _chunkS5MWUJU2js.generateId.call(void 0, ) };
616
621
  if (attrs["page"]) credit.page = parseInt(attrs["page"], 10);
617
622
  const types = collectElements(content, "credit-type", (c) => extractText(c));
618
623
  const words = collectElements(content, "credit-words", (c, a) => {
@@ -656,7 +661,7 @@ function parsePartList(elements) {
656
661
  const attrs = el.attributes;
657
662
  const content = el.children;
658
663
  const partInfo = {
659
- _id: _chunkYCNKCOR2js.generateId.call(void 0, ),
664
+ _id: _chunkS5MWUJU2js.generateId.call(void 0, ),
660
665
  type: "score-part",
661
666
  id: attrs["id"] || ""
662
667
  };
@@ -755,7 +760,7 @@ function parsePartList(elements) {
755
760
  const attrs = el.attributes;
756
761
  const content = el.children;
757
762
  const group = {
758
- _id: _chunkYCNKCOR2js.generateId.call(void 0, ),
763
+ _id: _chunkS5MWUJU2js.generateId.call(void 0, ),
759
764
  type: "part-group",
760
765
  groupType: attrs["type"] === "stop" ? "stop" : "start"
761
766
  };
@@ -792,7 +797,7 @@ function parseParts(elements) {
792
797
  const attrs = el.attributes;
793
798
  const content = el.children;
794
799
  const part = {
795
- _id: _chunkYCNKCOR2js.generateId.call(void 0, ),
800
+ _id: _chunkS5MWUJU2js.generateId.call(void 0, ),
796
801
  id: attrs["id"] || "",
797
802
  measures: []
798
803
  };
@@ -811,7 +816,7 @@ function parseParts(elements) {
811
816
  }
812
817
  function parseMeasure(elements, attrs) {
813
818
  const measure = {
814
- _id: _chunkYCNKCOR2js.generateId.call(void 0, ),
819
+ _id: _chunkS5MWUJU2js.generateId.call(void 0, ),
815
820
  number: attrs["number"] || "0",
816
821
  // Keep as string per MusicXML spec (token type)
817
822
  entries: []
@@ -828,7 +833,7 @@ function parseMeasure(elements, attrs) {
828
833
  measure.attributes = parsedAttrs;
829
834
  } else {
830
835
  const attrEntry = {
831
- _id: _chunkYCNKCOR2js.generateId.call(void 0, ),
836
+ _id: _chunkS5MWUJU2js.generateId.call(void 0, ),
832
837
  type: "attributes",
833
838
  attributes: parsedAttrs
834
839
  };
@@ -856,7 +861,7 @@ function parseMeasure(elements, attrs) {
856
861
  } else if (el.tagName === "grouping") {
857
862
  const grpAttrs = el.attributes;
858
863
  const grouping = {
859
- _id: _chunkYCNKCOR2js.generateId.call(void 0, ),
864
+ _id: _chunkS5MWUJU2js.generateId.call(void 0, ),
860
865
  type: "grouping",
861
866
  groupingType: grpAttrs["type"] || "start"
862
867
  };
@@ -910,7 +915,7 @@ function parsePrint(elements, attrs) {
910
915
  return print;
911
916
  }
912
917
  function parseAttributes(elements) {
913
- const attrs = { _id: _chunkYCNKCOR2js.generateId.call(void 0, ) };
918
+ const attrs = { _id: _chunkS5MWUJU2js.generateId.call(void 0, ) };
914
919
  const divisions = getElementTextAsInt(elements, "divisions");
915
920
  if (divisions !== void 0) attrs.divisions = divisions;
916
921
  const staves = getElementTextAsInt(elements, "staves");
@@ -1076,7 +1081,7 @@ function parseTranspose(elements) {
1076
1081
  }
1077
1082
  function parseNote(elements, attrs) {
1078
1083
  const note = {
1079
- _id: _chunkYCNKCOR2js.generateId.call(void 0, ),
1084
+ _id: _chunkS5MWUJU2js.generateId.call(void 0, ),
1080
1085
  type: "note",
1081
1086
  duration: 0
1082
1087
  };
@@ -1822,14 +1827,14 @@ function parseLyric(elements, attrs) {
1822
1827
  }
1823
1828
  function parseBackup(elements) {
1824
1829
  return {
1825
- _id: _chunkYCNKCOR2js.generateId.call(void 0, ),
1830
+ _id: _chunkS5MWUJU2js.generateId.call(void 0, ),
1826
1831
  type: "backup",
1827
1832
  duration: parseInt(getElementText(elements, "duration") || "0", 10)
1828
1833
  };
1829
1834
  }
1830
1835
  function parseForward(elements) {
1831
1836
  const forward = {
1832
- _id: _chunkYCNKCOR2js.generateId.call(void 0, ),
1837
+ _id: _chunkS5MWUJU2js.generateId.call(void 0, ),
1833
1838
  type: "forward",
1834
1839
  duration: parseInt(getElementText(elements, "duration") || "0", 10)
1835
1840
  };
@@ -1841,7 +1846,7 @@ function parseForward(elements) {
1841
1846
  }
1842
1847
  function parseDirection(elements, attrs) {
1843
1848
  const direction = {
1844
- _id: _chunkYCNKCOR2js.generateId.call(void 0, ),
1849
+ _id: _chunkS5MWUJU2js.generateId.call(void 0, ),
1845
1850
  type: "direction",
1846
1851
  directionTypes: []
1847
1852
  };
@@ -2266,7 +2271,7 @@ function parseDirectionTypes(elements) {
2266
2271
  }
2267
2272
  function parseBarline(elements, attrs) {
2268
2273
  const location = attrs["location"] || "right";
2269
- const barline = { _id: _chunkYCNKCOR2js.generateId.call(void 0, ), location };
2274
+ const barline = { _id: _chunkS5MWUJU2js.generateId.call(void 0, ), location };
2270
2275
  const barStyle = getElementText(elements, "bar-style");
2271
2276
  if (barStyle && isValidBarStyle(barStyle)) {
2272
2277
  barline.barStyle = barStyle;
@@ -2498,7 +2503,7 @@ function parseMeasureStyle(elements, attrs) {
2498
2503
  }
2499
2504
  function parseHarmony(elements, attrs) {
2500
2505
  const harmony = {
2501
- _id: _chunkYCNKCOR2js.generateId.call(void 0, ),
2506
+ _id: _chunkS5MWUJU2js.generateId.call(void 0, ),
2502
2507
  type: "harmony",
2503
2508
  root: { rootStep: "C" },
2504
2509
  kind: "major"
@@ -2638,7 +2643,7 @@ function parseHarmony(elements, attrs) {
2638
2643
  }
2639
2644
  function parseFiguredBass(elements, attrs) {
2640
2645
  const fb = {
2641
- _id: _chunkYCNKCOR2js.generateId.call(void 0, ),
2646
+ _id: _chunkS5MWUJU2js.generateId.call(void 0, ),
2642
2647
  type: "figured-bass",
2643
2648
  figures: []
2644
2649
  };
@@ -2687,7 +2692,7 @@ function parseFiguredBass(elements, attrs) {
2687
2692
  }
2688
2693
  function parseSound(elements, attrs) {
2689
2694
  const sound = {
2690
- _id: _chunkYCNKCOR2js.generateId.call(void 0, ),
2695
+ _id: _chunkS5MWUJU2js.generateId.call(void 0, ),
2691
2696
  type: "sound"
2692
2697
  };
2693
2698
  if (attrs["tempo"]) sound.tempo = parseFloat(attrs["tempo"]);
@@ -3728,7 +3733,7 @@ function buildScore(header, voiceTokensList, voiceIds, headerFieldOrder, inlineV
3728
3733
  const headerVoice = _optionalChain([header, 'access', _2 => _2.voices, 'optionalAccess', _3 => _3.find, 'call', _4 => _4((v) => v.id === voiceId)]) || header.voices && header.voices[voiceIndex];
3729
3734
  const voiceName = headerVoice ? headerVoice.name || `Voice ${voiceIndex + 1}` : voiceTokensList.length > 1 ? `Voice ${voiceIndex + 1}` : "Music";
3730
3735
  partListEntries.push({
3731
- _id: _chunkYCNKCOR2js.generateId.call(void 0, ),
3736
+ _id: _chunkS5MWUJU2js.generateId.call(void 0, ),
3732
3737
  type: "score-part",
3733
3738
  id: partId,
3734
3739
  name: voiceName
@@ -3736,7 +3741,7 @@ function buildScore(header, voiceTokensList, voiceIds, headerFieldOrder, inlineV
3736
3741
  const voiceClef = headerVoice ? abcClefToMusicXml(headerVoice.clef) : void 0;
3737
3742
  const buildResult = buildMeasures(tokens, unitNote, keySignature, timeSignature, measureDuration, voiceClef);
3738
3743
  parts.push({
3739
- _id: _chunkYCNKCOR2js.generateId.call(void 0, ),
3744
+ _id: _chunkS5MWUJU2js.generateId.call(void 0, ),
3740
3745
  id: partId,
3741
3746
  measures: buildResult.measures
3742
3747
  });
@@ -3789,7 +3794,7 @@ function buildScore(header, voiceTokensList, voiceIds, headerFieldOrder, inlineV
3789
3794
  encoding.encoder = encoderValues;
3790
3795
  }
3791
3796
  return {
3792
- _id: _chunkYCNKCOR2js.generateId.call(void 0, ),
3797
+ _id: _chunkS5MWUJU2js.generateId.call(void 0, ),
3793
3798
  metadata: {
3794
3799
  movementTitle: header.title,
3795
3800
  creators: creators.length > 0 ? creators : void 0,
@@ -3815,7 +3820,7 @@ function parseTempoToDirection(tempoStr) {
3815
3820
  if (found) beatUnit = found;
3816
3821
  }
3817
3822
  return {
3818
- _id: _chunkYCNKCOR2js.generateId.call(void 0, ),
3823
+ _id: _chunkS5MWUJU2js.generateId.call(void 0, ),
3819
3824
  type: "direction",
3820
3825
  directionTypes: [{ kind: "metronome", beatUnit, perMinute }],
3821
3826
  placement: "above",
@@ -3871,7 +3876,7 @@ function buildMeasures(tokens, unitNote, keySignature, timeSignature, measureDur
3871
3876
  if (dynDir) currentEntries.push(dynDir);
3872
3877
  } else if (item.kind === "decoration") {
3873
3878
  const decoDir = {
3874
- _id: _chunkYCNKCOR2js.generateId.call(void 0, ),
3879
+ _id: _chunkS5MWUJU2js.generateId.call(void 0, ),
3875
3880
  type: "direction",
3876
3881
  directionTypes: [{ kind: "words", text: item.value }]
3877
3882
  };
@@ -3882,13 +3887,13 @@ function buildMeasures(tokens, unitNote, keySignature, timeSignature, measureDur
3882
3887
  }
3883
3888
  function finalizeMeasure(endBarType) {
3884
3889
  const measure = {
3885
- _id: _chunkYCNKCOR2js.generateId.call(void 0, ),
3890
+ _id: _chunkS5MWUJU2js.generateId.call(void 0, ),
3886
3891
  number: String(measureNumber),
3887
3892
  entries: currentEntries
3888
3893
  };
3889
3894
  if (isFirstMeasure) {
3890
3895
  measure.attributes = {
3891
- _id: _chunkYCNKCOR2js.generateId.call(void 0, ),
3896
+ _id: _chunkS5MWUJU2js.generateId.call(void 0, ),
3892
3897
  divisions: DIVISIONS,
3893
3898
  time: timeSignature,
3894
3899
  key: keySignature,
@@ -3898,7 +3903,7 @@ function buildMeasures(tokens, unitNote, keySignature, timeSignature, measureDur
3898
3903
  }
3899
3904
  if (pendingKeyChange) {
3900
3905
  if (!measure.attributes) {
3901
- measure.attributes = { _id: _chunkYCNKCOR2js.generateId.call(void 0, ) };
3906
+ measure.attributes = { _id: _chunkS5MWUJU2js.generateId.call(void 0, ) };
3902
3907
  }
3903
3908
  const kValue = pendingKeyChange.replace(/^K:\s*/, "");
3904
3909
  measure.attributes.key = parseKeySignature2(kValue);
@@ -4101,7 +4106,7 @@ function buildMeasures(tokens, unitNote, keySignature, timeSignature, measureDur
4101
4106
  const rightBl = _optionalChain([lastMeasure, 'access', _9 => _9.barlines, 'optionalAccess', _10 => _10.find, 'call', _11 => _11((b) => b.location === "right")]);
4102
4107
  if (rightBl) {
4103
4108
  const endingBarline2 = {
4104
- _id: _chunkYCNKCOR2js.generateId.call(void 0, ),
4109
+ _id: _chunkS5MWUJU2js.generateId.call(void 0, ),
4105
4110
  location: "left",
4106
4111
  barStyle: rightBl.barStyle,
4107
4112
  repeat: rightBl.repeat,
@@ -4113,7 +4118,7 @@ function buildMeasures(tokens, unitNote, keySignature, timeSignature, measureDur
4113
4118
  }
4114
4119
  }
4115
4120
  const endingBarline = {
4116
- _id: _chunkYCNKCOR2js.generateId.call(void 0, ),
4121
+ _id: _chunkS5MWUJU2js.generateId.call(void 0, ),
4117
4122
  location: "left",
4118
4123
  ending: {
4119
4124
  number: token.value,
@@ -4216,7 +4221,7 @@ function buildMeasures(tokens, unitNote, keySignature, timeSignature, measureDur
4216
4221
  case "overlay": {
4217
4222
  if (currentPosition > 0) {
4218
4223
  const backupEntry = {
4219
- _id: _chunkYCNKCOR2js.generateId.call(void 0, ),
4224
+ _id: _chunkS5MWUJU2js.generateId.call(void 0, ),
4220
4225
  type: "backup",
4221
4226
  duration: currentPosition
4222
4227
  };
@@ -4230,7 +4235,7 @@ function buildMeasures(tokens, unitNote, keySignature, timeSignature, measureDur
4230
4235
  if (lMatch) {
4231
4236
  currentUnitNote = { num: parseInt(lMatch[1], 10), den: parseInt(lMatch[2], 10) };
4232
4237
  const inlineEntry = {
4233
- _id: _chunkYCNKCOR2js.generateId.call(void 0, ),
4238
+ _id: _chunkS5MWUJU2js.generateId.call(void 0, ),
4234
4239
  type: "direction",
4235
4240
  directionTypes: [{ kind: "words", text: `[L:${lMatch[1]}/${lMatch[2]}]` }]
4236
4241
  };
@@ -4249,7 +4254,7 @@ function buildMeasures(tokens, unitNote, keySignature, timeSignature, measureDur
4249
4254
  if (currentEntries.length > 0) {
4250
4255
  const breakText = token.value === "\\\n" ? "__abc_line_cont__" : "__abc_line_break__";
4251
4256
  const lineBreakDir = {
4252
- _id: _chunkYCNKCOR2js.generateId.call(void 0, ),
4257
+ _id: _chunkS5MWUJU2js.generateId.call(void 0, ),
4253
4258
  type: "direction",
4254
4259
  directionTypes: [{ kind: "words", text: breakText }]
4255
4260
  };
@@ -4353,7 +4358,7 @@ function createNoteEntry(token, unitNote, _hasTieStop, isGrace, tupletState) {
4353
4358
  }
4354
4359
  const { noteType, dots } = durationToNoteType(isGrace ? lengthToDuration(num, den, unitNote) : duration);
4355
4360
  const entry = {
4356
- _id: _chunkYCNKCOR2js.generateId.call(void 0, ),
4361
+ _id: _chunkS5MWUJU2js.generateId.call(void 0, ),
4357
4362
  type: "note",
4358
4363
  pitch: token.pitch,
4359
4364
  duration,
@@ -4407,7 +4412,7 @@ function createRestEntry(token, unitNote, tupletState, measureDuration) {
4407
4412
  }
4408
4413
  const { noteType, dots } = durationToNoteType(duration);
4409
4414
  const entry = {
4410
- _id: _chunkYCNKCOR2js.generateId.call(void 0, ),
4415
+ _id: _chunkS5MWUJU2js.generateId.call(void 0, ),
4411
4416
  type: "note",
4412
4417
  rest: isWholeMeasure ? { measure: true } : {},
4413
4418
  duration,
@@ -4422,7 +4427,7 @@ function createRestEntry(token, unitNote, tupletState, measureDuration) {
4422
4427
  }
4423
4428
  function createBarline(barType, location, endingNumber) {
4424
4429
  const barline = {
4425
- _id: _chunkYCNKCOR2js.generateId.call(void 0, ),
4430
+ _id: _chunkS5MWUJU2js.generateId.call(void 0, ),
4426
4431
  location
4427
4432
  };
4428
4433
  switch (barType) {
@@ -4513,7 +4518,7 @@ function createHarmonyEntry(chordStr) {
4513
4518
  break;
4514
4519
  }
4515
4520
  const entry = {
4516
- _id: _chunkYCNKCOR2js.generateId.call(void 0, ),
4521
+ _id: _chunkS5MWUJU2js.generateId.call(void 0, ),
4517
4522
  type: "harmony",
4518
4523
  root: { rootStep, rootAlter: rootAlter !== void 0 ? rootAlter : void 0 },
4519
4524
  kind
@@ -4532,7 +4537,7 @@ function createHarmonyEntry(chordStr) {
4532
4537
  function createDynamicsDirection(dynamic) {
4533
4538
  if (!DYNAMICS_VALUES.has(dynamic)) return null;
4534
4539
  return {
4535
- _id: _chunkYCNKCOR2js.generateId.call(void 0, ),
4540
+ _id: _chunkS5MWUJU2js.generateId.call(void 0, ),
4536
4541
  type: "direction",
4537
4542
  directionTypes: [{
4538
4543
  kind: "dynamics",
@@ -4561,13 +4566,13 @@ function serialize(score, options = {}) {
4561
4566
  const version = options.version || score.version || "4.0";
4562
4567
  const indent = _nullishCoalesce(options.indent, () => ( " "));
4563
4568
  if (options.validate) {
4564
- const result = _chunkYCNKCOR2js.validate.call(void 0, score, options.validateOptions);
4569
+ const result = _chunkS5MWUJU2js.validate.call(void 0, score, options.validateOptions);
4565
4570
  if (options.onValidation) {
4566
4571
  options.onValidation(result);
4567
4572
  }
4568
4573
  if (!result.valid && options.throwOnValidationError) {
4569
4574
  const errorMessages = result.errors.map((e) => `[${e.code}] ${e.message}`).join("\n");
4570
- throw new (0, _chunkYCNKCOR2js.ValidationException)(result.errors, `Score validation failed:
4575
+ throw new (0, _chunkS5MWUJU2js.ValidationException)(result.errors, `Score validation failed:
4571
4576
  ${errorMessages}`);
4572
4577
  }
4573
4578
  }
@@ -6489,13 +6494,31 @@ function scheduleGraceNotes(graceNotes, targetTick, baseVelocity, chromaticTrans
6489
6494
  }
6490
6495
  }
6491
6496
  function exportMidi(score, options = {}) {
6497
+ const { tracks, ticksPerQuarterNote } = buildMidiTracks(score, options);
6498
+ return buildMidiFile(tracks, ticksPerQuarterNote);
6499
+ }
6500
+ function exportMidiWithTimingMap(score, options = {}) {
6501
+ const { tracks, ticksPerQuarterNote, defaultTempo, grid } = buildMidiTracks(score, options);
6502
+ return {
6503
+ midi: buildMidiFile(tracks, ticksPerQuarterNote),
6504
+ sidecar: _chunkCHMV7XWYjs.buildTimingSidecar.call(void 0, grid, defaultTempo, ticksPerQuarterNote)
6505
+ };
6506
+ }
6507
+ function buildMidiTracks(score, options) {
6492
6508
  const ticksPerQuarterNote = _nullishCoalesce(options.ticksPerQuarterNote, () => ( 480));
6493
6509
  const defaultTempo = _nullishCoalesce(options.defaultTempo, () => ( 120));
6494
6510
  const defaultVelocity = _nullishCoalesce(options.defaultVelocity, () => ( 80));
6495
6511
  const tracks = [];
6496
- const measureOrder = _chunkCJZK2DGVjs.generatePlaybackSequence.call(void 0, score).map((m) => m.measureIndex);
6497
- const conductorTrack = createConductorTrack(score, defaultTempo, ticksPerQuarterNote, measureOrder);
6498
- tracks.push(conductorTrack);
6512
+ const sequence = _chunkCHMV7XWYjs.generatePlaybackSequence.call(void 0, score);
6513
+ const measureOrder = sequence.map((m) => m.measureIndex);
6514
+ const grid = _chunkCHMV7XWYjs.buildGridTimeline.call(void 0, score, ticksPerQuarterNote, sequence, {
6515
+ defaultTempo,
6516
+ fermataHoldMultiplier: options.fermataHoldMultiplier,
6517
+ caesuraSeconds: options.caesuraSeconds,
6518
+ breathSeconds: options.breathSeconds,
6519
+ tempoRampSteps: options.tempoRampSteps
6520
+ });
6521
+ tracks.push(createConductorTrack(score, defaultTempo, grid));
6499
6522
  const scoreParts = score.partList.filter((entry) => entry.type === "score-part");
6500
6523
  for (let partIndex = 0; partIndex < score.parts.length; partIndex++) {
6501
6524
  const part = score.parts[partIndex];
@@ -6518,7 +6541,7 @@ function exportMidi(score, options = {}) {
6518
6541
  );
6519
6542
  tracks.push(trackData);
6520
6543
  }
6521
- return buildMidiFile(tracks, ticksPerQuarterNote);
6544
+ return { tracks, ticksPerQuarterNote, defaultTempo, grid };
6522
6545
  }
6523
6546
  function pitchToMidiNote(pitch, chromaticTranspose = 0) {
6524
6547
  const stepValues = {
@@ -6533,130 +6556,46 @@ function pitchToMidiNote(pitch, chromaticTranspose = 0) {
6533
6556
  const baseMidi = (pitch.octave + 1) * 12 + stepValues[pitch.step] + (_nullishCoalesce(pitch.alter, () => ( 0)));
6534
6557
  return baseMidi + chromaticTranspose;
6535
6558
  }
6536
- function measureMaxPosition(measure) {
6537
- let position = 0;
6538
- let max = 0;
6539
- for (const entry of measure.entries) {
6540
- if (entry.type === "note") {
6541
- if (!entry.chord && !entry.grace) {
6542
- position += entry.duration;
6543
- if (position > max) max = position;
6544
- }
6545
- } else if (entry.type === "backup") {
6546
- position -= entry.duration;
6547
- } else if (entry.type === "forward") {
6548
- position += entry.duration;
6549
- if (position > max) max = position;
6550
- }
6551
- }
6552
- return max;
6553
- }
6554
- function measureEndTick(measure, part, divisions, measureStartTick, maxPosition, ticksPerQuarterNote) {
6555
- const actualTicks = Math.round(maxPosition * ticksPerQuarterNote / divisions);
6556
- if (measure.implicit) {
6557
- return measureStartTick + actualTicks;
6558
- }
6559
- const timeAttrs = findTimeSignature(part, measure.number);
6560
- if (timeAttrs) {
6561
- const measureDuration = timeAttrs.beats / timeAttrs.beatType * 4 * divisions;
6562
- const calculatedTicks = Math.round(measureDuration * ticksPerQuarterNote / divisions);
6563
- const ticksToAdd = Math.min(calculatedTicks, actualTicks > 0 ? actualTicks : calculatedTicks);
6564
- return measureStartTick + ticksToAdd;
6565
- }
6566
- return measureStartTick + actualTicks;
6567
- }
6568
- function metronomeBpm(perMinute) {
6569
- if (perMinute === void 0) return null;
6570
- const bpm = typeof perMinute === "number" ? perMinute : parseFloat(perMinute);
6571
- return isNaN(bpm) ? null : bpm;
6572
- }
6573
- function createConductorTrack(score, defaultTempo, ticksPerQuarterNote, measureOrder) {
6574
- const events = [];
6575
- const tempoEvents = [];
6576
- if (score.parts.length > 0) {
6577
- const part = score.parts[0];
6578
- let divisions = 1;
6579
- let currentTick = 0;
6580
- for (const measureIndex of measureOrder) {
6581
- const measure = part.measures[measureIndex];
6582
- if (!measure) continue;
6583
- if (_optionalChain([measure, 'access', _42 => _42.attributes, 'optionalAccess', _43 => _43.divisions])) {
6584
- divisions = measure.attributes.divisions;
6585
- }
6586
- const measureStartTick = currentTick;
6587
- let position = 0;
6588
- const tickAt = (pos) => measureStartTick + Math.round(pos * ticksPerQuarterNote / divisions);
6589
- for (const entry of measure.entries) {
6590
- if (entry.type === "direction") {
6591
- for (const dirType of entry.directionTypes) {
6592
- if (dirType.kind === "metronome") {
6593
- const bpm = metronomeBpm(dirType.perMinute);
6594
- if (bpm !== null) tempoEvents.push({ tick: tickAt(position), bpm });
6595
- }
6596
- }
6597
- if (_optionalChain([entry, 'access', _44 => _44.sound, 'optionalAccess', _45 => _45.tempo])) {
6598
- tempoEvents.push({ tick: tickAt(position), bpm: entry.sound.tempo });
6599
- }
6600
- } else if (entry.type === "sound") {
6601
- if (entry.tempo) tempoEvents.push({ tick: tickAt(position), bpm: entry.tempo });
6602
- } else if (entry.type === "note" && !entry.chord) {
6603
- position += entry.duration;
6604
- } else if (entry.type === "backup") {
6605
- position -= entry.duration;
6606
- } else if (entry.type === "forward") {
6607
- position += entry.duration;
6608
- }
6609
- }
6610
- currentTick = measureEndTick(
6611
- measure,
6612
- part,
6613
- divisions,
6614
- measureStartTick,
6615
- measureMaxPosition(measure),
6616
- ticksPerQuarterNote
6617
- );
6618
- }
6619
- }
6620
- tempoEvents.sort((a, b) => a.tick - b.tick);
6621
- const startBpm = tempoEvents.length > 0 && tempoEvents[0].tick === 0 ? tempoEvents[0].bpm : defaultTempo;
6622
- const pushTempo = (deltaTick, bpm) => {
6623
- const usPerQuarter = Math.round(6e7 / bpm);
6624
- events.push(
6625
- ...writeVariableLength(deltaTick),
6626
- 255,
6627
- 81,
6628
- 3,
6629
- usPerQuarter >> 16 & 255,
6630
- usPerQuarter >> 8 & 255,
6631
- usPerQuarter & 255
6632
- );
6559
+ function createConductorTrack(score, defaultTempo, grid) {
6560
+ const metaEvents = [];
6561
+ const tempoBytes = (bpm) => {
6562
+ const us = _chunkCHMV7XWYjs.bpmToUsPerQuarter.call(void 0, bpm);
6563
+ return [255, 81, 3, us >> 16 & 255, us >> 8 & 255, us & 255];
6633
6564
  };
6634
- pushTempo(0, startBpm);
6635
- if (score.parts.length > 0 && score.parts[0].measures.length > 0) {
6636
- const time = _optionalChain([score, 'access', _46 => _46.parts, 'access', _47 => _47[0], 'access', _48 => _48.measures, 'access', _49 => _49[0], 'access', _50 => _50.attributes, 'optionalAccess', _51 => _51.time]);
6637
- if (time) {
6565
+ const tempoEvents = [...grid.tempoEvents].sort((a, b) => a.tick - b.tick);
6566
+ const startBpm = tempoEvents.length > 0 && tempoEvents[0].tick === 0 ? tempoEvents[0].bpm : defaultTempo;
6567
+ metaEvents.push({ tick: 0, order: 0, bytes: tempoBytes(startBpm) });
6568
+ let lastBpm = startBpm;
6569
+ for (const ev of tempoEvents) {
6570
+ if (ev.tick === 0) continue;
6571
+ if (ev.bpm === lastBpm) continue;
6572
+ metaEvents.push({ tick: ev.tick, order: 0, bytes: tempoBytes(ev.bpm) });
6573
+ lastBpm = ev.bpm;
6574
+ }
6575
+ const part = score.parts.length > 0 ? score.parts[0] : void 0;
6576
+ if (part) {
6577
+ let lastSig = null;
6578
+ for (const m of grid.measures) {
6579
+ const time = _optionalChain([part, 'access', _42 => _42.measures, 'access', _43 => _43[m.measureIndex], 'optionalAccess', _44 => _44.attributes, 'optionalAccess', _45 => _45.time]);
6580
+ if (!time) continue;
6638
6581
  const numerator = parseInt(time.beats, 10) || 4;
6639
6582
  const denominator = Math.log2(time.beatType);
6640
- events.push(
6641
- ...writeVariableLength(0),
6642
- 255,
6643
- 88,
6644
- 4,
6645
- numerator,
6646
- denominator,
6647
- 24,
6648
- 8
6649
- );
6583
+ const sig = `${numerator}/${denominator}`;
6584
+ if (sig === lastSig) continue;
6585
+ lastSig = sig;
6586
+ metaEvents.push({
6587
+ tick: m.startTick,
6588
+ order: 1,
6589
+ bytes: [255, 88, 4, numerator, denominator, 24, 8]
6590
+ });
6650
6591
  }
6651
6592
  }
6593
+ metaEvents.sort((a, b) => a.tick - b.tick || a.order - b.order);
6594
+ const events = [];
6652
6595
  let lastTick = 0;
6653
- let lastBpm = startBpm;
6654
- for (const ev of tempoEvents) {
6655
- if (ev.tick === 0) continue;
6656
- if (ev.bpm === lastBpm) continue;
6657
- pushTempo(ev.tick - lastTick, ev.bpm);
6596
+ for (const ev of metaEvents) {
6597
+ events.push(...writeVariableLength(ev.tick - lastTick), ...ev.bytes);
6658
6598
  lastTick = ev.tick;
6659
- lastBpm = ev.bpm;
6660
6599
  }
6661
6600
  events.push(...writeVariableLength(0), 255, 47, 0);
6662
6601
  return new Uint8Array(events);
@@ -6680,10 +6619,10 @@ function createPartTrack(part, _score, channel, program, ticksPerQuarterNote, de
6680
6619
  for (const measureIndex of measureOrder) {
6681
6620
  const measure = part.measures[measureIndex];
6682
6621
  if (!measure) continue;
6683
- if (_optionalChain([measure, 'access', _52 => _52.attributes, 'optionalAccess', _53 => _53.divisions])) {
6622
+ if (_optionalChain([measure, 'access', _46 => _46.attributes, 'optionalAccess', _47 => _47.divisions])) {
6684
6623
  divisions = measure.attributes.divisions;
6685
6624
  }
6686
- if (_optionalChain([measure, 'access', _54 => _54.attributes, 'optionalAccess', _55 => _55.transpose])) {
6625
+ if (_optionalChain([measure, 'access', _48 => _48.attributes, 'optionalAccess', _49 => _49.transpose])) {
6687
6626
  chromaticTranspose = measure.attributes.transpose.chromatic;
6688
6627
  }
6689
6628
  const measureStartTick = currentTick;
@@ -6754,7 +6693,7 @@ function createPartTrack(part, _score, channel, program, ticksPerQuarterNote, de
6754
6693
  }
6755
6694
  }
6756
6695
  }
6757
- currentTick = measureEndTick(
6696
+ currentTick = _chunkCHMV7XWYjs.measureEndTick.call(void 0,
6758
6697
  measure,
6759
6698
  part,
6760
6699
  divisions,
@@ -6807,21 +6746,6 @@ function createPartTrack(part, _score, channel, program, ticksPerQuarterNote, de
6807
6746
  events.push(...writeVariableLength(0), 255, 47, 0);
6808
6747
  return new Uint8Array(events);
6809
6748
  }
6810
- function findTimeSignature(part, measureNumber) {
6811
- const targetMeasure = parseInt(String(measureNumber), 10);
6812
- let time;
6813
- for (const measure of part.measures) {
6814
- const mNum = parseInt(measure.number, 10);
6815
- if (!isNaN(targetMeasure) && !isNaN(mNum) && mNum > targetMeasure) break;
6816
- if (_optionalChain([measure, 'access', _56 => _56.attributes, 'optionalAccess', _57 => _57.time])) {
6817
- time = {
6818
- beats: parseInt(measure.attributes.time.beats, 10) || 4,
6819
- beatType: measure.attributes.time.beatType
6820
- };
6821
- }
6822
- }
6823
- return time;
6824
- }
6825
6749
  function writeVariableLength(value) {
6826
6750
  if (value < 0) value = 0;
6827
6751
  const bytes = [];
@@ -6988,8 +6912,8 @@ function serializeTimeSignature(time) {
6988
6912
  return `${time.beats}/${time.beatType}`;
6989
6913
  }
6990
6914
  function computeUnitNoteLength(score) {
6991
- const firstMeasure = _optionalChain([score, 'access', _58 => _58.parts, 'access', _59 => _59[0], 'optionalAccess', _60 => _60.measures, 'access', _61 => _61[0]]);
6992
- const time = _optionalChain([firstMeasure, 'optionalAccess', _62 => _62.attributes, 'optionalAccess', _63 => _63.time]);
6915
+ const firstMeasure = _optionalChain([score, 'access', _50 => _50.parts, 'access', _51 => _51[0], 'optionalAccess', _52 => _52.measures, 'access', _53 => _53[0]]);
6916
+ const time = _optionalChain([firstMeasure, 'optionalAccess', _54 => _54.attributes, 'optionalAccess', _55 => _55.time]);
6993
6917
  if (time) {
6994
6918
  const beats = parseInt(time.beats, 10);
6995
6919
  const beatType = time.beatType;
@@ -7132,15 +7056,15 @@ function serializeTempo(direction) {
7132
7056
  }
7133
7057
  function serializeAbc(score, options) {
7134
7058
  const opts = {
7135
- referenceNumber: _nullishCoalesce(_optionalChain([options, 'optionalAccess', _64 => _64.referenceNumber]), () => ( 1)),
7136
- notesPerLine: _nullishCoalesce(_optionalChain([options, 'optionalAccess', _65 => _65.notesPerLine]), () => ( 0)),
7137
- includeChordSymbols: _nullishCoalesce(_optionalChain([options, 'optionalAccess', _66 => _66.includeChordSymbols]), () => ( true)),
7138
- includeDynamics: _nullishCoalesce(_optionalChain([options, 'optionalAccess', _67 => _67.includeDynamics]), () => ( true)),
7139
- includeLyrics: _nullishCoalesce(_optionalChain([options, 'optionalAccess', _68 => _68.includeLyrics]), () => ( true))
7059
+ referenceNumber: _nullishCoalesce(_optionalChain([options, 'optionalAccess', _56 => _56.referenceNumber]), () => ( 1)),
7060
+ notesPerLine: _nullishCoalesce(_optionalChain([options, 'optionalAccess', _57 => _57.notesPerLine]), () => ( 0)),
7061
+ includeChordSymbols: _nullishCoalesce(_optionalChain([options, 'optionalAccess', _58 => _58.includeChordSymbols]), () => ( true)),
7062
+ includeDynamics: _nullishCoalesce(_optionalChain([options, 'optionalAccess', _59 => _59.includeDynamics]), () => ( true)),
7063
+ includeLyrics: _nullishCoalesce(_optionalChain([options, 'optionalAccess', _60 => _60.includeLyrics]), () => ( true))
7140
7064
  };
7141
- useExplicitHalf = _optionalChain([score, 'access', _69 => _69.metadata, 'access', _70 => _70.miscellaneous, 'optionalAccess', _71 => _71.find, 'call', _72 => _72((m) => m.name === "abc-explicit-half"), 'optionalAccess', _73 => _73.value]) === "true";
7142
- useIndividualChordDurations = _nullishCoalesce(_optionalChain([score, 'access', _74 => _74.metadata, 'access', _75 => _75.miscellaneous, 'optionalAccess', _76 => _76.some, 'call', _77 => _77((m) => m.name === "abc-chord-individual-durations" && m.value === "true")]), () => ( false));
7143
- const storedUnitNote = _optionalChain([score, 'access', _78 => _78.metadata, 'access', _79 => _79.miscellaneous, 'optionalAccess', _80 => _80.find, 'call', _81 => _81((m) => m.name === "abc-unit-note-length"), 'optionalAccess', _82 => _82.value]);
7065
+ useExplicitHalf = _optionalChain([score, 'access', _61 => _61.metadata, 'access', _62 => _62.miscellaneous, 'optionalAccess', _63 => _63.find, 'call', _64 => _64((m) => m.name === "abc-explicit-half"), 'optionalAccess', _65 => _65.value]) === "true";
7066
+ useIndividualChordDurations = _nullishCoalesce(_optionalChain([score, 'access', _66 => _66.metadata, 'access', _67 => _67.miscellaneous, 'optionalAccess', _68 => _68.some, 'call', _69 => _69((m) => m.name === "abc-chord-individual-durations" && m.value === "true")]), () => ( false));
7067
+ const storedUnitNote = _optionalChain([score, 'access', _70 => _70.metadata, 'access', _71 => _71.miscellaneous, 'optionalAccess', _72 => _72.find, 'call', _73 => _73((m) => m.name === "abc-unit-note-length"), 'optionalAccess', _74 => _74.value]);
7144
7068
  let unitNote;
7145
7069
  if (storedUnitNote) {
7146
7070
  const match = storedUnitNote.match(/^(\d+)\/(\d+)$/);
@@ -7154,56 +7078,56 @@ function serializeAbc(score, options) {
7154
7078
  }
7155
7079
  const lines = [];
7156
7080
  const firstPart = score.parts[0];
7157
- const firstMeasure = _optionalChain([firstPart, 'optionalAccess', _83 => _83.measures, 'access', _84 => _84[0]]);
7158
- const attrs = _optionalChain([firstMeasure, 'optionalAccess', _85 => _85.attributes]);
7159
- const storedHeaderOrder = _optionalChain([score, 'access', _86 => _86.metadata, 'access', _87 => _87.miscellaneous, 'optionalAccess', _88 => _88.find, 'call', _89 => _89((m) => m.name === "abc-header-order"), 'optionalAccess', _90 => _90.value]);
7081
+ const firstMeasure = _optionalChain([firstPart, 'optionalAccess', _75 => _75.measures, 'access', _76 => _76[0]]);
7082
+ const attrs = _optionalChain([firstMeasure, 'optionalAccess', _77 => _77.attributes]);
7083
+ const storedHeaderOrder = _optionalChain([score, 'access', _78 => _78.metadata, 'access', _79 => _79.miscellaneous, 'optionalAccess', _80 => _80.find, 'call', _81 => _81((m) => m.name === "abc-header-order"), 'optionalAccess', _82 => _82.value]);
7160
7084
  if (storedHeaderOrder) {
7161
7085
  const headerOrder = JSON.parse(storedHeaderOrder);
7162
7086
  for (const field of headerOrder) {
7163
7087
  lines.push(field);
7164
7088
  }
7165
7089
  } else {
7166
- const storedRefNum = _optionalChain([score, 'access', _91 => _91.metadata, 'access', _92 => _92.miscellaneous, 'optionalAccess', _93 => _93.find, 'call', _94 => _94((m) => m.name === "abc-reference-number"), 'optionalAccess', _95 => _95.value]);
7090
+ const storedRefNum = _optionalChain([score, 'access', _83 => _83.metadata, 'access', _84 => _84.miscellaneous, 'optionalAccess', _85 => _85.find, 'call', _86 => _86((m) => m.name === "abc-reference-number"), 'optionalAccess', _87 => _87.value]);
7167
7091
  const refNum = storedRefNum ? parseInt(storedRefNum, 10) : opts.referenceNumber;
7168
7092
  lines.push(`X:${refNum}`);
7169
7093
  if (score.metadata.movementTitle) {
7170
7094
  lines.push(`T:${score.metadata.movementTitle}`);
7171
7095
  }
7172
- const composer = _optionalChain([score, 'access', _96 => _96.metadata, 'access', _97 => _97.creators, 'optionalAccess', _98 => _98.find, 'call', _99 => _99((c) => c.type === "composer")]);
7096
+ const composer = _optionalChain([score, 'access', _88 => _88.metadata, 'access', _89 => _89.creators, 'optionalAccess', _90 => _90.find, 'call', _91 => _91((c) => c.type === "composer")]);
7173
7097
  if (composer) {
7174
7098
  lines.push(`C:${composer.value}`);
7175
7099
  }
7176
- const rhythmFields = _optionalChain([score, 'access', _100 => _100.metadata, 'access', _101 => _101.miscellaneous, 'optionalAccess', _102 => _102.filter, 'call', _103 => _103((m) => m.name === "abc-R")]);
7100
+ const rhythmFields = _optionalChain([score, 'access', _92 => _92.metadata, 'access', _93 => _93.miscellaneous, 'optionalAccess', _94 => _94.filter, 'call', _95 => _95((m) => m.name === "abc-R")]);
7177
7101
  if (rhythmFields) {
7178
7102
  for (const rf of rhythmFields) lines.push(`R:${rf.value}`);
7179
7103
  }
7180
- const originCreators = _optionalChain([score, 'access', _104 => _104.metadata, 'access', _105 => _105.creators, 'optionalAccess', _106 => _106.filter, 'call', _107 => _107((c) => c.type === "origin")]);
7104
+ const originCreators = _optionalChain([score, 'access', _96 => _96.metadata, 'access', _97 => _97.creators, 'optionalAccess', _98 => _98.filter, 'call', _99 => _99((c) => c.type === "origin")]);
7181
7105
  if (originCreators) {
7182
7106
  for (const oc of originCreators) lines.push(`O:${oc.value}`);
7183
7107
  }
7184
7108
  if (score.metadata.source) {
7185
7109
  lines.push(`S:${score.metadata.source}`);
7186
7110
  }
7187
- const noteFields = _optionalChain([score, 'access', _108 => _108.metadata, 'access', _109 => _109.miscellaneous, 'optionalAccess', _110 => _110.filter, 'call', _111 => _111((m) => m.name === "abc-N")]);
7111
+ const noteFields = _optionalChain([score, 'access', _100 => _100.metadata, 'access', _101 => _101.miscellaneous, 'optionalAccess', _102 => _102.filter, 'call', _103 => _103((m) => m.name === "abc-N")]);
7188
7112
  if (noteFields) {
7189
7113
  for (const nf of noteFields) lines.push(`N:${nf.value}`);
7190
7114
  }
7191
- if (_optionalChain([score, 'access', _112 => _112.metadata, 'access', _113 => _113.encoding, 'optionalAccess', _114 => _114.encoder])) {
7115
+ if (_optionalChain([score, 'access', _104 => _104.metadata, 'access', _105 => _105.encoding, 'optionalAccess', _106 => _106.encoder])) {
7192
7116
  for (const enc of score.metadata.encoding.encoder) lines.push(`Z:${enc}`);
7193
7117
  }
7194
- const instrFields = _optionalChain([score, 'access', _115 => _115.metadata, 'access', _116 => _116.miscellaneous, 'optionalAccess', _117 => _117.filter, 'call', _118 => _118((m) => m.name === "abc-I")]);
7118
+ const instrFields = _optionalChain([score, 'access', _107 => _107.metadata, 'access', _108 => _108.miscellaneous, 'optionalAccess', _109 => _109.filter, 'call', _110 => _110((m) => m.name === "abc-I")]);
7195
7119
  if (instrFields) {
7196
7120
  for (const inf of instrFields) lines.push(`I:${inf.value}`);
7197
7121
  }
7198
- const fileFields = _optionalChain([score, 'access', _119 => _119.metadata, 'access', _120 => _120.miscellaneous, 'optionalAccess', _121 => _121.filter, 'call', _122 => _122((m) => m.name === "abc-F")]);
7122
+ const fileFields = _optionalChain([score, 'access', _111 => _111.metadata, 'access', _112 => _112.miscellaneous, 'optionalAccess', _113 => _113.filter, 'call', _114 => _114((m) => m.name === "abc-F")]);
7199
7123
  if (fileFields) {
7200
7124
  for (const ff of fileFields) lines.push(`F:${ff.value}`);
7201
7125
  }
7202
- if (_optionalChain([attrs, 'optionalAccess', _123 => _123.time])) {
7126
+ if (_optionalChain([attrs, 'optionalAccess', _115 => _115.time])) {
7203
7127
  lines.push(`M:${serializeTimeSignature(attrs.time)}`);
7204
7128
  }
7205
7129
  lines.push(`L:${unitNote.num}/${unitNote.den}`);
7206
- const storedTempo = _optionalChain([score, 'access', _124 => _124.metadata, 'access', _125 => _125.miscellaneous, 'optionalAccess', _126 => _126.find, 'call', _127 => _127((m) => m.name === "abc-tempo"), 'optionalAccess', _128 => _128.value]);
7130
+ const storedTempo = _optionalChain([score, 'access', _116 => _116.metadata, 'access', _117 => _117.miscellaneous, 'optionalAccess', _118 => _118.find, 'call', _119 => _119((m) => m.name === "abc-tempo"), 'optionalAccess', _120 => _120.value]);
7207
7131
  if (storedTempo) {
7208
7132
  lines.push(`Q:${storedTempo}`);
7209
7133
  } else {
@@ -7212,24 +7136,24 @@ function serializeAbc(score, options) {
7212
7136
  lines.push(`Q:${tempoStr}`);
7213
7137
  }
7214
7138
  }
7215
- if (_optionalChain([attrs, 'optionalAccess', _129 => _129.key])) {
7139
+ if (_optionalChain([attrs, 'optionalAccess', _121 => _121.key])) {
7216
7140
  lines.push(`K:${serializeKey2(attrs.key)}`);
7217
7141
  } else {
7218
7142
  lines.push("K:C");
7219
7143
  }
7220
7144
  }
7221
- const lineBreaksStr = _optionalChain([score, 'access', _130 => _130.metadata, 'access', _131 => _131.miscellaneous, 'optionalAccess', _132 => _132.find, 'call', _133 => _133((m) => m.name === "abc-line-breaks"), 'optionalAccess', _134 => _134.value]);
7145
+ const lineBreaksStr = _optionalChain([score, 'access', _122 => _122.metadata, 'access', _123 => _123.miscellaneous, 'optionalAccess', _124 => _124.find, 'call', _125 => _125((m) => m.name === "abc-line-breaks"), 'optionalAccess', _126 => _126.value]);
7222
7146
  const lineBreaks = lineBreaksStr ? JSON.parse(lineBreaksStr) : [];
7223
- const storedVoiceIdsStr = _optionalChain([score, 'access', _135 => _135.metadata, 'access', _136 => _136.miscellaneous, 'optionalAccess', _137 => _137.find, 'call', _138 => _138((m) => m.name === "abc-voice-ids"), 'optionalAccess', _139 => _139.value]);
7147
+ const storedVoiceIdsStr = _optionalChain([score, 'access', _127 => _127.metadata, 'access', _128 => _128.miscellaneous, 'optionalAccess', _129 => _129.find, 'call', _130 => _130((m) => m.name === "abc-voice-ids"), 'optionalAccess', _131 => _131.value]);
7224
7148
  const storedVoiceIds = storedVoiceIdsStr ? JSON.parse(storedVoiceIdsStr) : [];
7225
- const lyricsAfterAll = _optionalChain([score, 'access', _140 => _140.metadata, 'access', _141 => _141.miscellaneous, 'optionalAccess', _142 => _142.find, 'call', _143 => _143((m) => m.name === "abc-lyrics-after-all"), 'optionalAccess', _144 => _144.value]) === "true";
7226
- const lyricsLineCountsStr = _optionalChain([score, 'access', _145 => _145.metadata, 'access', _146 => _146.miscellaneous, 'optionalAccess', _147 => _147.find, 'call', _148 => _148((m) => m.name === "abc-lyrics-line-counts"), 'optionalAccess', _149 => _149.value]);
7149
+ const lyricsAfterAll = _optionalChain([score, 'access', _132 => _132.metadata, 'access', _133 => _133.miscellaneous, 'optionalAccess', _134 => _134.find, 'call', _135 => _135((m) => m.name === "abc-lyrics-after-all"), 'optionalAccess', _136 => _136.value]) === "true";
7150
+ const lyricsLineCountsStr = _optionalChain([score, 'access', _137 => _137.metadata, 'access', _138 => _138.miscellaneous, 'optionalAccess', _139 => _139.find, 'call', _140 => _140((m) => m.name === "abc-lyrics-line-counts"), 'optionalAccess', _141 => _141.value]);
7227
7151
  const lyricsLineCounts = lyricsLineCountsStr ? JSON.parse(lyricsLineCountsStr) : [];
7228
- const inlineVoiceMarkersStr = _optionalChain([score, 'access', _150 => _150.metadata, 'access', _151 => _151.miscellaneous, 'optionalAccess', _152 => _152.find, 'call', _153 => _153((m) => m.name === "abc-inline-voice-markers"), 'optionalAccess', _154 => _154.value]);
7152
+ const inlineVoiceMarkersStr = _optionalChain([score, 'access', _142 => _142.metadata, 'access', _143 => _143.miscellaneous, 'optionalAccess', _144 => _144.find, 'call', _145 => _145((m) => m.name === "abc-inline-voice-markers"), 'optionalAccess', _146 => _146.value]);
7229
7153
  const inlineVoiceMarkers = inlineVoiceMarkersStr ? JSON.parse(inlineVoiceMarkersStr) : {};
7230
7154
  const useInlineVoiceMarkers = Object.keys(inlineVoiceMarkers).length > 0;
7231
7155
  if (useInlineVoiceMarkers) {
7232
- const voiceDeclStr = _optionalChain([score, 'access', _155 => _155.metadata, 'access', _156 => _156.miscellaneous, 'optionalAccess', _157 => _157.find, 'call', _158 => _158((m) => m.name === "abc-voice-declaration-lines"), 'optionalAccess', _159 => _159.value]);
7156
+ const voiceDeclStr = _optionalChain([score, 'access', _147 => _147.metadata, 'access', _148 => _148.miscellaneous, 'optionalAccess', _149 => _149.find, 'call', _150 => _150((m) => m.name === "abc-voice-declaration-lines"), 'optionalAccess', _151 => _151.value]);
7233
7157
  if (voiceDeclStr) {
7234
7158
  const voiceDeclLines = JSON.parse(voiceDeclStr);
7235
7159
  for (const vl of voiceDeclLines) {
@@ -7237,23 +7161,23 @@ function serializeAbc(score, options) {
7237
7161
  }
7238
7162
  }
7239
7163
  }
7240
- const bodyCommentsStr = _optionalChain([score, 'access', _160 => _160.metadata, 'access', _161 => _161.miscellaneous, 'optionalAccess', _162 => _162.find, 'call', _163 => _163((m) => m.name === "abc-body-comments"), 'optionalAccess', _164 => _164.value]);
7164
+ const bodyCommentsStr = _optionalChain([score, 'access', _152 => _152.metadata, 'access', _153 => _153.miscellaneous, 'optionalAccess', _154 => _154.find, 'call', _155 => _155((m) => m.name === "abc-body-comments"), 'optionalAccess', _156 => _156.value]);
7241
7165
  const bodyComments = bodyCommentsStr ? JSON.parse(bodyCommentsStr) : [];
7242
- const bodyDirectivesStr = _optionalChain([score, 'access', _165 => _165.metadata, 'access', _166 => _166.miscellaneous, 'optionalAccess', _167 => _167.find, 'call', _168 => _168((m) => m.name === "abc-body-directives"), 'optionalAccess', _169 => _169.value]);
7166
+ const bodyDirectivesStr = _optionalChain([score, 'access', _157 => _157.metadata, 'access', _158 => _158.miscellaneous, 'optionalAccess', _159 => _159.find, 'call', _160 => _160((m) => m.name === "abc-body-directives"), 'optionalAccess', _161 => _161.value]);
7243
7167
  const bodyDirectives = bodyDirectivesStr ? JSON.parse(bodyDirectivesStr) : [];
7244
- const wFieldsStr = _optionalChain([score, 'access', _170 => _170.metadata, 'access', _171 => _171.miscellaneous, 'optionalAccess', _172 => _172.find, 'call', _173 => _173((m) => m.name === "abc-w-fields"), 'optionalAccess', _174 => _174.value]);
7168
+ const wFieldsStr = _optionalChain([score, 'access', _162 => _162.metadata, 'access', _163 => _163.miscellaneous, 'optionalAccess', _164 => _164.find, 'call', _165 => _165((m) => m.name === "abc-w-fields"), 'optionalAccess', _166 => _166.value]);
7245
7169
  const wFieldsList = wFieldsStr ? JSON.parse(wFieldsStr) : [];
7246
- const voiceInterleaveStr = _optionalChain([score, 'access', _175 => _175.metadata, 'access', _176 => _176.miscellaneous, 'optionalAccess', _177 => _177.find, 'call', _178 => _178((m) => m.name === "abc-voice-interleave"), 'optionalAccess', _179 => _179.value]);
7170
+ const voiceInterleaveStr = _optionalChain([score, 'access', _167 => _167.metadata, 'access', _168 => _168.miscellaneous, 'optionalAccess', _169 => _169.find, 'call', _170 => _170((m) => m.name === "abc-voice-interleave"), 'optionalAccess', _171 => _171.value]);
7247
7171
  const voiceInterleavePattern = voiceInterleaveStr ? JSON.parse(voiceInterleaveStr) : [];
7248
- const groupBarCountsStr = _optionalChain([score, 'access', _180 => _180.metadata, 'access', _181 => _181.miscellaneous, 'optionalAccess', _182 => _182.find, 'call', _183 => _183((m) => m.name === "abc-group-bar-counts"), 'optionalAccess', _184 => _184.value]);
7172
+ const groupBarCountsStr = _optionalChain([score, 'access', _172 => _172.metadata, 'access', _173 => _173.miscellaneous, 'optionalAccess', _174 => _174.find, 'call', _175 => _175((m) => m.name === "abc-group-bar-counts"), 'optionalAccess', _176 => _176.value]);
7249
7173
  const groupBarCounts = groupBarCountsStr ? JSON.parse(groupBarCountsStr) : [];
7250
- const bodyVoiceLinesStr = _optionalChain([score, 'access', _185 => _185.metadata, 'access', _186 => _186.miscellaneous, 'optionalAccess', _187 => _187.find, 'call', _188 => _188((m) => m.name === "abc-body-voice-lines"), 'optionalAccess', _189 => _189.value]);
7174
+ const bodyVoiceLinesStr = _optionalChain([score, 'access', _177 => _177.metadata, 'access', _178 => _178.miscellaneous, 'optionalAccess', _179 => _179.find, 'call', _180 => _180((m) => m.name === "abc-body-voice-lines"), 'optionalAccess', _181 => _181.value]);
7251
7175
  const bodyVoiceLines = bodyVoiceLinesStr ? JSON.parse(bodyVoiceLinesStr) : [];
7252
- const voiceFullLinesStr = _optionalChain([score, 'access', _190 => _190.metadata, 'access', _191 => _191.miscellaneous, 'optionalAccess', _192 => _192.find, 'call', _193 => _193((m) => m.name === "abc-voice-full-lines"), 'optionalAccess', _194 => _194.value]);
7176
+ const voiceFullLinesStr = _optionalChain([score, 'access', _182 => _182.metadata, 'access', _183 => _183.miscellaneous, 'optionalAccess', _184 => _184.find, 'call', _185 => _185((m) => m.name === "abc-voice-full-lines"), 'optionalAccess', _186 => _186.value]);
7253
7177
  const voiceFullLines = voiceFullLinesStr ? JSON.parse(voiceFullLinesStr) : {};
7254
- const voiceCommentsStr = _optionalChain([score, 'access', _195 => _195.metadata, 'access', _196 => _196.miscellaneous, 'optionalAccess', _197 => _197.find, 'call', _198 => _198((m) => m.name === "abc-voice-comments"), 'optionalAccess', _199 => _199.value]);
7178
+ const voiceCommentsStr = _optionalChain([score, 'access', _187 => _187.metadata, 'access', _188 => _188.miscellaneous, 'optionalAccess', _189 => _189.find, 'call', _190 => _190((m) => m.name === "abc-voice-comments"), 'optionalAccess', _191 => _191.value]);
7255
7179
  const voiceCommentsData = voiceCommentsStr ? JSON.parse(voiceCommentsStr) : {};
7256
- const preVoiceCommentsStr = _optionalChain([score, 'access', _200 => _200.metadata, 'access', _201 => _201.miscellaneous, 'optionalAccess', _202 => _202.find, 'call', _203 => _203((m) => m.name === "abc-pre-voice-comments"), 'optionalAccess', _204 => _204.value]);
7180
+ const preVoiceCommentsStr = _optionalChain([score, 'access', _192 => _192.metadata, 'access', _193 => _193.miscellaneous, 'optionalAccess', _194 => _194.find, 'call', _195 => _195((m) => m.name === "abc-pre-voice-comments"), 'optionalAccess', _196 => _196.value]);
7257
7181
  const preVoiceComments = preVoiceCommentsStr ? JSON.parse(preVoiceCommentsStr) : [];
7258
7182
  const multiVoice = score.parts.length > 1;
7259
7183
  const partMeasureStrings = [];
@@ -7264,38 +7188,38 @@ function serializeAbc(score, options) {
7264
7188
  partDivisions.push(divisions);
7265
7189
  const measStrings = [];
7266
7190
  let currentUnitNote = { ...unitNote };
7267
- let currentKey = _optionalChain([part, 'access', _205 => _205.measures, 'access', _206 => _206[0], 'optionalAccess', _207 => _207.attributes, 'optionalAccess', _208 => _208.key]);
7191
+ let currentKey = _optionalChain([part, 'access', _197 => _197.measures, 'access', _198 => _198[0], 'optionalAccess', _199 => _199.attributes, 'optionalAccess', _200 => _200.key]);
7268
7192
  for (let mi = 0; mi < part.measures.length; mi++) {
7269
7193
  const measure = part.measures[mi];
7270
- const measDivisions = _nullishCoalesce(_optionalChain([measure, 'access', _209 => _209.attributes, 'optionalAccess', _210 => _210.divisions]), () => ( divisions));
7194
+ const measDivisions = _nullishCoalesce(_optionalChain([measure, 'access', _201 => _201.attributes, 'optionalAccess', _202 => _202.divisions]), () => ( divisions));
7271
7195
  let measureStr = "";
7272
- if (mi > 0 && _optionalChain([measure, 'access', _211 => _211.attributes, 'optionalAccess', _212 => _212.key])) {
7196
+ if (mi > 0 && _optionalChain([measure, 'access', _203 => _203.attributes, 'optionalAccess', _204 => _204.key])) {
7273
7197
  const newKey = measure.attributes.key;
7274
7198
  if (currentKey === void 0 || newKey.fifths !== currentKey.fifths || (newKey.mode || "major") !== (currentKey.mode || "major")) {
7275
7199
  measureStr += "\nK:" + serializeKey2(newKey) + "\n";
7276
7200
  currentKey = newKey;
7277
7201
  }
7278
7202
  }
7279
- const leftBarline = _optionalChain([measure, 'access', _213 => _213.barlines, 'optionalAccess', _214 => _214.find, 'call', _215 => _215((b) => b.location === "left")]);
7203
+ const leftBarline = _optionalChain([measure, 'access', _205 => _205.barlines, 'optionalAccess', _206 => _206.find, 'call', _207 => _207((b) => b.location === "left")]);
7280
7204
  if (leftBarline) {
7281
7205
  measureStr += serializeBarline2(leftBarline);
7282
7206
  }
7283
7207
  const { noteStr, updatedUnitNote } = serializeMeasureEntries(measure, measDivisions, currentUnitNote, opts);
7284
7208
  if (updatedUnitNote) currentUnitNote = updatedUnitNote;
7285
7209
  measureStr += noteStr;
7286
- const rightBarline = _optionalChain([measure, 'access', _216 => _216.barlines, 'optionalAccess', _217 => _217.find, 'call', _218 => _218((b) => b.location === "right")]);
7210
+ const rightBarline = _optionalChain([measure, 'access', _208 => _208.barlines, 'optionalAccess', _209 => _209.find, 'call', _210 => _210((b) => b.location === "right")]);
7287
7211
  if (rightBarline) {
7288
7212
  measureStr += serializeBarline2(rightBarline);
7289
7213
  } else if (mi < part.measures.length - 1) {
7290
7214
  const nextMeasure = part.measures[mi + 1];
7291
- const nextLeftBarline = _optionalChain([nextMeasure, 'optionalAccess', _219 => _219.barlines, 'optionalAccess', _220 => _220.find, 'call', _221 => _221((b) => b.location === "left" && (b.barStyle || b.repeat))]);
7215
+ const nextLeftBarline = _optionalChain([nextMeasure, 'optionalAccess', _211 => _211.barlines, 'optionalAccess', _212 => _212.find, 'call', _213 => _213((b) => b.location === "left" && (b.barStyle || b.repeat))]);
7292
7216
  if (!nextLeftBarline) {
7293
7217
  measureStr += "|";
7294
7218
  }
7295
7219
  } else {
7296
7220
  const prevMeas = mi > 0 ? part.measures[mi - 1] : null;
7297
- const prevRightBl = _optionalChain([prevMeas, 'optionalAccess', _222 => _222.barlines, 'optionalAccess', _223 => _223.find, 'call', _224 => _224((b) => b.location === "right")]);
7298
- const prevWasFinal = _optionalChain([prevRightBl, 'optionalAccess', _225 => _225.barStyle]) === "light-heavy" && !prevRightBl.repeat;
7221
+ const prevRightBl = _optionalChain([prevMeas, 'optionalAccess', _214 => _214.barlines, 'optionalAccess', _215 => _215.find, 'call', _216 => _216((b) => b.location === "right")]);
7222
+ const prevWasFinal = _optionalChain([prevRightBl, 'optionalAccess', _217 => _217.barStyle]) === "light-heavy" && !prevRightBl.repeat;
7299
7223
  if (!prevWasFinal) {
7300
7224
  measureStr += "|";
7301
7225
  }
@@ -7337,7 +7261,7 @@ function serializeAbc(score, options) {
7337
7261
  } else if (voiceFullLines[voiceId]) {
7338
7262
  } else {
7339
7263
  let voiceLine = `V:${voiceId}`;
7340
- const partClef = _optionalChain([score, 'access', _226 => _226.parts, 'access', _227 => _227[partIdx], 'optionalAccess', _228 => _228.measures, 'access', _229 => _229[0], 'optionalAccess', _230 => _230.attributes, 'optionalAccess', _231 => _231.clef, 'optionalAccess', _232 => _232[0]]);
7264
+ const partClef = _optionalChain([score, 'access', _218 => _218.parts, 'access', _219 => _219[partIdx], 'optionalAccess', _220 => _220.measures, 'access', _221 => _221[0], 'optionalAccess', _222 => _222.attributes, 'optionalAccess', _223 => _223.clef, 'optionalAccess', _224 => _224[0]]);
7341
7265
  if (partClef) {
7342
7266
  const clefName = musicXmlClefToAbc(partClef);
7343
7267
  if (clefName && clefName !== "treble") {
@@ -7347,11 +7271,11 @@ function serializeAbc(score, options) {
7347
7271
  lines.push(voiceLine);
7348
7272
  }
7349
7273
  const voiceIdxInGroup = group.indexOf(voiceId);
7350
- const barCount = _nullishCoalesce(_optionalChain([groupBarCounts, 'access', _233 => _233[gi], 'optionalAccess', _234 => _234[voiceIdxInGroup]]), () => ( 0));
7351
- const measuresInGroup = barCount > 0 ? barCount : Math.ceil((_optionalChain([partMeasureStrings, 'access', _235 => _235[0], 'optionalAccess', _236 => _236.length]) || 0) / voiceInterleavePattern.length);
7274
+ const barCount = _nullishCoalesce(_optionalChain([groupBarCounts, 'access', _225 => _225[gi], 'optionalAccess', _226 => _226[voiceIdxInGroup]]), () => ( 0));
7275
+ const measuresInGroup = barCount > 0 ? barCount : Math.ceil((_optionalChain([partMeasureStrings, 'access', _227 => _227[0], 'optionalAccess', _228 => _228.length]) || 0) / voiceInterleavePattern.length);
7352
7276
  const startMeasure = voiceMeasureCursor[voiceId] || 0;
7353
7277
  const endMeasure = Math.min(startMeasure + measuresInGroup, measStrings.length);
7354
- const voiceLineBreaksStr = _optionalChain([score, 'access', _237 => _237.metadata, 'access', _238 => _238.miscellaneous, 'optionalAccess', _239 => _239.find, 'call', _240 => _240((m) => m.name === `abc-line-breaks-${partIdx}`), 'optionalAccess', _241 => _241.value]);
7278
+ const voiceLineBreaksStr = _optionalChain([score, 'access', _229 => _229.metadata, 'access', _230 => _230.miscellaneous, 'optionalAccess', _231 => _231.find, 'call', _232 => _232((m) => m.name === `abc-line-breaks-${partIdx}`), 'optionalAccess', _233 => _233.value]);
7355
7279
  const voiceLineBreaks = voiceLineBreaksStr ? JSON.parse(voiceLineBreaksStr) : lineBreaks;
7356
7280
  const voiceLineBreakSet = new Set(voiceLineBreaks.map((v) => Math.abs(v)));
7357
7281
  const voiceLineContinuationSet = new Set(voiceLineBreaks.filter((v) => v < 0).map((v) => Math.abs(v)));
@@ -7390,7 +7314,7 @@ function serializeAbc(score, options) {
7390
7314
  lines.push(voiceFullLines[voiceId]);
7391
7315
  } else {
7392
7316
  let voiceLine = `V:${voiceId}`;
7393
- const partClef = _optionalChain([part, 'access', _242 => _242.measures, 'access', _243 => _243[0], 'optionalAccess', _244 => _244.attributes, 'optionalAccess', _245 => _245.clef, 'optionalAccess', _246 => _246[0]]);
7317
+ const partClef = _optionalChain([part, 'access', _234 => _234.measures, 'access', _235 => _235[0], 'optionalAccess', _236 => _236.attributes, 'optionalAccess', _237 => _237.clef, 'optionalAccess', _238 => _238[0]]);
7394
7318
  if (partClef) {
7395
7319
  const clefName = musicXmlClefToAbc(partClef);
7396
7320
  if (clefName && clefName !== "treble") {
@@ -7420,7 +7344,7 @@ function serializeAbc(score, options) {
7420
7344
  for (const wField of wFieldsList) {
7421
7345
  lines.push(wField);
7422
7346
  }
7423
- const trailingCommentsStr = _optionalChain([score, 'access', _247 => _247.metadata, 'access', _248 => _248.miscellaneous, 'optionalAccess', _249 => _249.find, 'call', _250 => _250((m) => m.name === "abc-trailing-comments"), 'optionalAccess', _251 => _251.value]);
7347
+ const trailingCommentsStr = _optionalChain([score, 'access', _239 => _239.metadata, 'access', _240 => _240.miscellaneous, 'optionalAccess', _241 => _241.find, 'call', _242 => _242((m) => m.name === "abc-trailing-comments"), 'optionalAccess', _243 => _243.value]);
7424
7348
  const trailingComments = trailingCommentsStr ? JSON.parse(trailingCommentsStr) : [];
7425
7349
  for (const comment of trailingComments) {
7426
7350
  lines.push(comment);
@@ -7439,7 +7363,7 @@ function findTempoInMeasure(measure) {
7439
7363
  }
7440
7364
  function getPartDivisions(part) {
7441
7365
  for (const measure of part.measures) {
7442
- if (_optionalChain([measure, 'access', _252 => _252.attributes, 'optionalAccess', _253 => _253.divisions])) {
7366
+ if (_optionalChain([measure, 'access', _244 => _244.attributes, 'optionalAccess', _245 => _245.divisions])) {
7443
7367
  return measure.attributes.divisions;
7444
7368
  }
7445
7369
  for (const entry of measure.entries) {
@@ -7454,18 +7378,18 @@ function serializePartBody(part, divisions, initialUnitNote, opts, lineBreaks =
7454
7378
  let unitNote = { ...initialUnitNote };
7455
7379
  const musicParts = [];
7456
7380
  const allLyrics = /* @__PURE__ */ new Map();
7457
- let currentKey = _optionalChain([part, 'access', _254 => _254.measures, 'access', _255 => _255[0], 'optionalAccess', _256 => _256.attributes, 'optionalAccess', _257 => _257.key]);
7381
+ let currentKey = _optionalChain([part, 'access', _246 => _246.measures, 'access', _247 => _247[0], 'optionalAccess', _248 => _248.attributes, 'optionalAccess', _249 => _249.key]);
7458
7382
  for (let mi = 0; mi < part.measures.length; mi++) {
7459
7383
  const measure = part.measures[mi];
7460
- const measDivisions = _nullishCoalesce(_optionalChain([measure, 'access', _258 => _258.attributes, 'optionalAccess', _259 => _259.divisions]), () => ( divisions));
7461
- if (mi > 0 && _optionalChain([measure, 'access', _260 => _260.attributes, 'optionalAccess', _261 => _261.key])) {
7384
+ const measDivisions = _nullishCoalesce(_optionalChain([measure, 'access', _250 => _250.attributes, 'optionalAccess', _251 => _251.divisions]), () => ( divisions));
7385
+ if (mi > 0 && _optionalChain([measure, 'access', _252 => _252.attributes, 'optionalAccess', _253 => _253.key])) {
7462
7386
  const newKey = measure.attributes.key;
7463
7387
  if (currentKey === void 0 || newKey.fifths !== currentKey.fifths || (newKey.mode || "major") !== (currentKey.mode || "major")) {
7464
7388
  musicParts.push("\nK:" + serializeKey2(newKey) + "\n");
7465
7389
  currentKey = newKey;
7466
7390
  }
7467
7391
  }
7468
- const leftBarline = _optionalChain([measure, 'access', _262 => _262.barlines, 'optionalAccess', _263 => _263.find, 'call', _264 => _264((b) => b.location === "left")]);
7392
+ const leftBarline = _optionalChain([measure, 'access', _254 => _254.barlines, 'optionalAccess', _255 => _255.find, 'call', _256 => _256((b) => b.location === "left")]);
7469
7393
  if (leftBarline) {
7470
7394
  musicParts.push(serializeBarline2(leftBarline));
7471
7395
  }
@@ -7482,19 +7406,19 @@ function serializePartBody(part, divisions, initialUnitNote, opts, lineBreaks =
7482
7406
  if (lyrics.length > 0) {
7483
7407
  allLyrics.set(mi, lyrics);
7484
7408
  }
7485
- const rightBarline = _optionalChain([measure, 'access', _265 => _265.barlines, 'optionalAccess', _266 => _266.find, 'call', _267 => _267((b) => b.location === "right")]);
7409
+ const rightBarline = _optionalChain([measure, 'access', _257 => _257.barlines, 'optionalAccess', _258 => _258.find, 'call', _259 => _259((b) => b.location === "right")]);
7486
7410
  if (rightBarline) {
7487
7411
  musicParts.push(serializeBarline2(rightBarline));
7488
7412
  } else if (mi < part.measures.length - 1) {
7489
7413
  const nextMeas = part.measures[mi + 1];
7490
- const nextLeftBar = _optionalChain([nextMeas, 'optionalAccess', _268 => _268.barlines, 'optionalAccess', _269 => _269.find, 'call', _270 => _270((b) => b.location === "left" && (b.barStyle || b.repeat))]);
7414
+ const nextLeftBar = _optionalChain([nextMeas, 'optionalAccess', _260 => _260.barlines, 'optionalAccess', _261 => _261.find, 'call', _262 => _262((b) => b.location === "left" && (b.barStyle || b.repeat))]);
7491
7415
  if (!nextLeftBar) {
7492
7416
  musicParts.push("|");
7493
7417
  }
7494
7418
  } else {
7495
7419
  const prevMeas = mi > 0 ? part.measures[mi - 1] : null;
7496
- const prevRightBl = _optionalChain([prevMeas, 'optionalAccess', _271 => _271.barlines, 'optionalAccess', _272 => _272.find, 'call', _273 => _273((b) => b.location === "right")]);
7497
- const prevWasFinal = _optionalChain([prevRightBl, 'optionalAccess', _274 => _274.barStyle]) === "light-heavy" && !prevRightBl.repeat;
7420
+ const prevRightBl = _optionalChain([prevMeas, 'optionalAccess', _263 => _263.barlines, 'optionalAccess', _264 => _264.find, 'call', _265 => _265((b) => b.location === "right")]);
7421
+ const prevWasFinal = _optionalChain([prevRightBl, 'optionalAccess', _266 => _266.barStyle]) === "light-heavy" && !prevRightBl.repeat;
7498
7422
  if (!prevWasFinal) {
7499
7423
  musicParts.push("|");
7500
7424
  }
@@ -7633,7 +7557,7 @@ function serializeMeasureEntries(measure, divisions, unitNote, opts) {
7633
7557
  if (chordHasIndividualDurations) {
7634
7558
  chordNoteStr += serialized.duration;
7635
7559
  }
7636
- if (_optionalChain([note, 'access', _275 => _275.tie, 'optionalAccess', _276 => _276.type]) === "start" || _optionalChain([note, 'access', _277 => _277.ties, 'optionalAccess', _278 => _278.some, 'call', _279 => _279((t) => t.type === "start")])) {
7560
+ if (_optionalChain([note, 'access', _267 => _267.tie, 'optionalAccess', _268 => _268.type]) === "start" || _optionalChain([note, 'access', _269 => _269.ties, 'optionalAccess', _270 => _270.some, 'call', _271 => _271((t) => t.type === "start")])) {
7637
7561
  chordNoteStr += "-";
7638
7562
  }
7639
7563
  chordPitches.push(chordNoteStr);
@@ -7671,9 +7595,9 @@ function serializeMeasureEntries(measure, divisions, unitNote, opts) {
7671
7595
  const baseDuration = Math.round(note.duration * note.timeModification.actualNotes / note.timeModification.normalNotes);
7672
7596
  const { num, den } = durationToAbcFraction(baseDuration, divisions, currentUnitNote);
7673
7597
  const baseDurationStr = formatAbcDuration(num, den);
7674
- const pitchStr = serializePitch2(note.pitch, _optionalChain([note, 'access', _280 => _280.accidental, 'optionalAccess', _281 => _281.value]) === "natural");
7598
+ const pitchStr = serializePitch2(note.pitch, _optionalChain([note, 'access', _272 => _272.accidental, 'optionalAccess', _273 => _273.value]) === "natural");
7675
7599
  let tieStr = "";
7676
- if (_optionalChain([note, 'access', _282 => _282.tie, 'optionalAccess', _283 => _283.type]) === "start" || _optionalChain([note, 'access', _284 => _284.ties, 'optionalAccess', _285 => _285.some, 'call', _286 => _286((t) => t.type === "start")])) {
7600
+ if (_optionalChain([note, 'access', _274 => _274.tie, 'optionalAccess', _275 => _275.type]) === "start" || _optionalChain([note, 'access', _276 => _276.ties, 'optionalAccess', _277 => _277.some, 'call', _278 => _278((t) => t.type === "start")])) {
7677
7601
  tieStr = "-";
7678
7602
  }
7679
7603
  let slurStart = "";
@@ -7701,7 +7625,7 @@ function serializeMeasureEntries(measure, divisions, unitNote, opts) {
7701
7625
  const hasIndividualDur = detectChordIndividualDurations(measure.entries, ei);
7702
7626
  chordHasIndividualDurations = hasIndividualDur;
7703
7627
  const hasPerNoteTies = detectChordPerNoteTies(measure.entries, ei);
7704
- const firstNoteTie = _optionalChain([note, 'access', _287 => _287.tie, 'optionalAccess', _288 => _288.type]) === "start" || _optionalChain([note, 'access', _289 => _289.ties, 'optionalAccess', _290 => _290.some, 'call', _291 => _291((t) => t.type === "start")]);
7628
+ const firstNoteTie = _optionalChain([note, 'access', _279 => _279.tie, 'optionalAccess', _280 => _280.type]) === "start" || _optionalChain([note, 'access', _281 => _281.ties, 'optionalAccess', _282 => _282.some, 'call', _283 => _283((t) => t.type === "start")]);
7705
7629
  let firstNoteStr = hasIndividualDur ? effectiveSerialized.pitch + effectiveSerialized.duration : effectiveSerialized.pitch;
7706
7630
  if (hasPerNoteTies && firstNoteTie) {
7707
7631
  firstNoteStr += "-";
@@ -7767,9 +7691,9 @@ function serializeMeasureEntries(measure, divisions, unitNote, opts) {
7767
7691
  const slurE1 = effectiveSerialized.slurEnd;
7768
7692
  parts.push(tupletPrefix + slurS1 + pitchStr1 + baseDurStr1 + tie1 + brokenResult.marker);
7769
7693
  const note2 = brokenResult.nextNote;
7770
- const pitchStr2 = serializePitch2(note2.pitch, _optionalChain([note2, 'access', _292 => _292.accidental, 'optionalAccess', _293 => _293.value]) === "natural");
7694
+ const pitchStr2 = serializePitch2(note2.pitch, _optionalChain([note2, 'access', _284 => _284.accidental, 'optionalAccess', _285 => _285.value]) === "natural");
7771
7695
  let tieStr2 = "";
7772
- if (_optionalChain([note2, 'access', _294 => _294.tie, 'optionalAccess', _295 => _295.type]) === "start" || _optionalChain([note2, 'access', _296 => _296.ties, 'optionalAccess', _297 => _297.some, 'call', _298 => _298((t) => t.type === "start")])) tieStr2 = "-";
7696
+ if (_optionalChain([note2, 'access', _286 => _286.tie, 'optionalAccess', _287 => _287.type]) === "start" || _optionalChain([note2, 'access', _288 => _288.ties, 'optionalAccess', _289 => _289.some, 'call', _290 => _290((t) => t.type === "start")])) tieStr2 = "-";
7773
7697
  let slurEnd2 = "";
7774
7698
  if (note2.notations) {
7775
7699
  for (const notation of note2.notations) {
@@ -7890,14 +7814,14 @@ function detectChordPerNoteTies(entries, startIdx) {
7890
7814
  let totalCount = 1;
7891
7815
  const firstNote = entries[startIdx];
7892
7816
  if (firstNote.type === "note") {
7893
- const hasTieStart2 = _optionalChain([firstNote, 'access', _299 => _299.tie, 'optionalAccess', _300 => _300.type]) === "start" || _optionalChain([firstNote, 'access', _301 => _301.ties, 'optionalAccess', _302 => _302.some, 'call', _303 => _303((t) => t.type === "start")]);
7817
+ const hasTieStart2 = _optionalChain([firstNote, 'access', _291 => _291.tie, 'optionalAccess', _292 => _292.type]) === "start" || _optionalChain([firstNote, 'access', _293 => _293.ties, 'optionalAccess', _294 => _294.some, 'call', _295 => _295((t) => t.type === "start")]);
7894
7818
  if (hasTieStart2) tiedCount++;
7895
7819
  }
7896
7820
  for (let i = startIdx + 1; i < entries.length; i++) {
7897
7821
  const e = entries[i];
7898
7822
  if (e.type !== "note" || !e.chord) break;
7899
7823
  totalCount++;
7900
- const hasTieStart2 = _optionalChain([e, 'access', _304 => _304.tie, 'optionalAccess', _305 => _305.type]) === "start" || _optionalChain([e, 'access', _306 => _306.ties, 'optionalAccess', _307 => _307.some, 'call', _308 => _308((t) => t.type === "start")]);
7824
+ const hasTieStart2 = _optionalChain([e, 'access', _296 => _296.tie, 'optionalAccess', _297 => _297.type]) === "start" || _optionalChain([e, 'access', _298 => _298.ties, 'optionalAccess', _299 => _299.some, 'call', _300 => _300((t) => t.type === "start")]);
7901
7825
  if (hasTieStart2) tiedCount++;
7902
7826
  }
7903
7827
  return tiedCount > 1 || tiedCount > 0 && totalCount > 1;
@@ -7930,17 +7854,17 @@ function serializeNote2(note, divisions, unitNote, _inChord) {
7930
7854
  }
7931
7855
  } else if (note.grace) {
7932
7856
  if (note.pitch) {
7933
- pitchStr = serializePitch2(note.pitch, _optionalChain([note, 'access', _309 => _309.accidental, 'optionalAccess', _310 => _310.value]) === "natural");
7857
+ pitchStr = serializePitch2(note.pitch, _optionalChain([note, 'access', _301 => _301.accidental, 'optionalAccess', _302 => _302.value]) === "natural");
7934
7858
  }
7935
7859
  durationStr = "";
7936
7860
  } else if (note.pitch) {
7937
- pitchStr = serializePitch2(note.pitch, _optionalChain([note, 'access', _311 => _311.accidental, 'optionalAccess', _312 => _312.value]) === "natural");
7861
+ pitchStr = serializePitch2(note.pitch, _optionalChain([note, 'access', _303 => _303.accidental, 'optionalAccess', _304 => _304.value]) === "natural");
7938
7862
  const effectiveDuration = note.duration;
7939
7863
  const { num, den } = durationToAbcFraction(effectiveDuration, divisions, unitNote);
7940
7864
  durationStr = formatAbcDuration(num, den);
7941
7865
  }
7942
7866
  let tieStr = "";
7943
- if (_optionalChain([note, 'access', _313 => _313.tie, 'optionalAccess', _314 => _314.type]) === "start" || _optionalChain([note, 'access', _315 => _315.ties, 'optionalAccess', _316 => _316.some, 'call', _317 => _317((t) => t.type === "start")])) {
7867
+ if (_optionalChain([note, 'access', _305 => _305.tie, 'optionalAccess', _306 => _306.type]) === "start" || _optionalChain([note, 'access', _307 => _307.ties, 'optionalAccess', _308 => _308.some, 'call', _309 => _309((t) => t.type === "start")])) {
7944
7868
  tieStr = "-";
7945
7869
  }
7946
7870
  let slurStart = "";
@@ -7957,8 +7881,8 @@ function serializeNote2(note, divisions, unitNote, _inChord) {
7957
7881
  return { full, pitch: pitchStr, duration: durationStr, slurStart, slurEnd, tieStr };
7958
7882
  }
7959
7883
  function serializeBarline2(barline) {
7960
- const hasRepeatForward = _optionalChain([barline, 'access', _318 => _318.repeat, 'optionalAccess', _319 => _319.direction]) === "forward";
7961
- const hasRepeatBackward = _optionalChain([barline, 'access', _320 => _320.repeat, 'optionalAccess', _321 => _321.direction]) === "backward";
7884
+ const hasRepeatForward = _optionalChain([barline, 'access', _310 => _310.repeat, 'optionalAccess', _311 => _311.direction]) === "forward";
7885
+ const hasRepeatBackward = _optionalChain([barline, 'access', _312 => _312.repeat, 'optionalAccess', _313 => _313.direction]) === "backward";
7962
7886
  const hasEnding = barline.ending;
7963
7887
  let result = "";
7964
7888
  if (hasRepeatForward) {
@@ -8287,4 +8211,6 @@ async function serializeToFile(score, filePath, options = {}) {
8287
8211
 
8288
8212
 
8289
8213
 
8290
- exports.STEPS = _chunkCJZK2DGVjs.STEPS; exports.STEP_SEMITONES = _chunkCJZK2DGVjs.STEP_SEMITONES; exports.ValidationException = _chunkYCNKCOR2js.ValidationException; exports.addArticulation = _chunkYCNKCOR2js.addArticulation; exports.addBeam = _chunkYCNKCOR2js.addBeam; exports.addBowing = _chunkYCNKCOR2js.addBowing; exports.addBreathMark = _chunkYCNKCOR2js.addBreathMark; exports.addCaesura = _chunkYCNKCOR2js.addCaesura; exports.addChord = _chunkYCNKCOR2js.addChord; exports.addChordNote = _chunkYCNKCOR2js.addChordNote; exports.addChordNoteChecked = _chunkYCNKCOR2js.addChordNoteChecked; exports.addChordSymbol = _chunkYCNKCOR2js.addChordSymbol; exports.addCoda = _chunkYCNKCOR2js.addCoda; exports.addDaCapo = _chunkYCNKCOR2js.addDaCapo; exports.addDalSegno = _chunkYCNKCOR2js.addDalSegno; exports.addDynamics = _chunkYCNKCOR2js.addDynamics; exports.addEnding = _chunkYCNKCOR2js.addEnding; exports.addFermata = _chunkYCNKCOR2js.addFermata; exports.addFine = _chunkYCNKCOR2js.addFine; exports.addFingering = _chunkYCNKCOR2js.addFingering; exports.addGraceNote = _chunkYCNKCOR2js.addGraceNote; exports.addHarmony = _chunkYCNKCOR2js.addHarmony; exports.addLyric = _chunkYCNKCOR2js.addLyric; exports.addNote = _chunkYCNKCOR2js.addNote; exports.addNoteChecked = _chunkYCNKCOR2js.addNoteChecked; exports.addOctaveShift = _chunkYCNKCOR2js.addOctaveShift; exports.addOrnament = _chunkYCNKCOR2js.addOrnament; exports.addPart = _chunkYCNKCOR2js.addPart; exports.addPedal = _chunkYCNKCOR2js.addPedal; exports.addRehearsalMark = _chunkYCNKCOR2js.addRehearsalMark; exports.addRepeat = _chunkYCNKCOR2js.addRepeat; exports.addRepeatBarline = _chunkYCNKCOR2js.addRepeatBarline; exports.addSegno = _chunkYCNKCOR2js.addSegno; exports.addSlur = _chunkYCNKCOR2js.addSlur; exports.addStringNumber = _chunkYCNKCOR2js.addStringNumber; exports.addTempo = _chunkYCNKCOR2js.addTempo; exports.addText = _chunkYCNKCOR2js.addText; exports.addTextDirection = _chunkYCNKCOR2js.addTextDirection; exports.addTie = _chunkYCNKCOR2js.addTie; exports.addToCoda = _chunkYCNKCOR2js.addToCoda; exports.addVoice = _chunkYCNKCOR2js.addVoice; exports.addWedge = _chunkYCNKCOR2js.addWedge; exports.assertMeasureValid = _chunkYCNKCOR2js.assertMeasureValid; exports.assertValid = _chunkYCNKCOR2js.assertValid; exports.autoBeam = _chunkYCNKCOR2js.autoBeam; exports.buildVoiceToStaffMap = _chunkCJZK2DGVjs.buildVoiceToStaffMap; exports.buildVoiceToStaffMapForPart = _chunkCJZK2DGVjs.buildVoiceToStaffMapForPart; exports.changeBarline = _chunkYCNKCOR2js.changeBarline; exports.changeClef = _chunkYCNKCOR2js.changeClef; exports.changeKey = _chunkYCNKCOR2js.changeKey; exports.changeNoteDuration = _chunkYCNKCOR2js.changeNoteDuration; exports.changeTime = _chunkYCNKCOR2js.changeTime; exports.convertToGrace = _chunkYCNKCOR2js.convertToGrace; exports.copyNotes = _chunkYCNKCOR2js.copyNotes; exports.copyNotesMultiMeasure = _chunkYCNKCOR2js.copyNotesMultiMeasure; exports.countNotes = _chunkCJZK2DGVjs.countNotes; exports.createTuplet = _chunkYCNKCOR2js.createTuplet; exports.cutNotes = _chunkYCNKCOR2js.cutNotes; exports.decodeBuffer = decodeBuffer; exports.deleteMeasure = _chunkYCNKCOR2js.deleteMeasure; exports.deleteNote = _chunkYCNKCOR2js.deleteNote; exports.deleteNoteChecked = _chunkYCNKCOR2js.deleteNoteChecked; exports.duplicatePart = _chunkYCNKCOR2js.duplicatePart; exports.exportMidi = exportMidi; exports.extractPlaybackControls = _chunkCJZK2DGVjs.extractPlaybackControls; exports.findBarlines = _chunkCJZK2DGVjs.findBarlines; exports.findDirectionsByType = _chunkCJZK2DGVjs.findDirectionsByType; exports.findNotes = _chunkCJZK2DGVjs.findNotes; exports.findNotesWithNotation = _chunkCJZK2DGVjs.findNotesWithNotation; exports.formatLocation = _chunkYCNKCOR2js.formatLocation; exports.generateId = _chunkYCNKCOR2js.generateId; exports.generatePlaybackSequence = _chunkCJZK2DGVjs.generatePlaybackSequence; exports.getAbsolutePosition = _chunkCJZK2DGVjs.getAbsolutePosition; exports.getAdjacentNotes = _chunkCJZK2DGVjs.getAdjacentNotes; exports.getAllNotes = _chunkCJZK2DGVjs.getAllNotes; exports.getAllPartInfos = getAllPartInfos; exports.getAttributesAtMeasure = _chunkCJZK2DGVjs.getAttributesAtMeasure; exports.getBeamGroups = _chunkCJZK2DGVjs.getBeamGroups; exports.getChordProgression = _chunkCJZK2DGVjs.getChordProgression; exports.getChords = _chunkCJZK2DGVjs.getChords; exports.getClefChanges = _chunkCJZK2DGVjs.getClefChanges; exports.getClefForStaff = _chunkCJZK2DGVjs.getClefForStaff; exports.getDirectionOfKind = getDirectionOfKind; exports.getDirections = _chunkCJZK2DGVjs.getDirections; exports.getDirectionsAtPosition = _chunkCJZK2DGVjs.getDirectionsAtPosition; exports.getDirectionsOfKind = getDirectionsOfKind; exports.getDivisions = _chunkCJZK2DGVjs.getDivisions; exports.getDuration = _chunkCJZK2DGVjs.getDuration; exports.getDynamics = _chunkCJZK2DGVjs.getDynamics; exports.getEffectiveStaff = _chunkCJZK2DGVjs.getEffectiveStaff; exports.getEndings = _chunkCJZK2DGVjs.getEndings; exports.getEntriesAtPosition = _chunkCJZK2DGVjs.getEntriesAtPosition; exports.getEntriesForStaff = _chunkCJZK2DGVjs.getEntriesForStaff; exports.getEntriesInRange = _chunkCJZK2DGVjs.getEntriesInRange; exports.getHarmonies = _chunkCJZK2DGVjs.getHarmonies; exports.getHarmonyAtPosition = _chunkCJZK2DGVjs.getHarmonyAtPosition; exports.getKeyChanges = _chunkCJZK2DGVjs.getKeyChanges; exports.getLyricText = _chunkCJZK2DGVjs.getLyricText; exports.getLyrics = _chunkCJZK2DGVjs.getLyrics; exports.getMeasure = _chunkCJZK2DGVjs.getMeasure; exports.getMeasureByIndex = _chunkCJZK2DGVjs.getMeasureByIndex; exports.getMeasureContext = _chunkYCNKCOR2js.getMeasureContext; exports.getMeasureCount = _chunkCJZK2DGVjs.getMeasureCount; exports.getMeasureEndPosition = _chunkCJZK2DGVjs.getMeasureEndPosition; exports.getNextNote = _chunkCJZK2DGVjs.getNextNote; exports.getNormalizedDuration = _chunkCJZK2DGVjs.getNormalizedDuration; exports.getNormalizedPosition = _chunkCJZK2DGVjs.getNormalizedPosition; exports.getNotesAtPosition = _chunkCJZK2DGVjs.getNotesAtPosition; exports.getNotesForStaff = _chunkCJZK2DGVjs.getNotesForStaff; exports.getNotesForVoice = _chunkCJZK2DGVjs.getNotesForVoice; exports.getNotesInRange = _chunkCJZK2DGVjs.getNotesInRange; exports.getOctaveShifts = _chunkCJZK2DGVjs.getOctaveShifts; exports.getPartAbbreviation = getPartAbbreviation; exports.getPartById = _chunkCJZK2DGVjs.getPartById; exports.getPartByIndex = _chunkCJZK2DGVjs.getPartByIndex; exports.getPartCount = _chunkCJZK2DGVjs.getPartCount; exports.getPartIds = _chunkCJZK2DGVjs.getPartIds; exports.getPartIndex = _chunkCJZK2DGVjs.getPartIndex; exports.getPartInfo = getPartInfo; exports.getPartName = getPartName; exports.getPartNameMap = getPartNameMap; exports.getPedalMarkings = _chunkCJZK2DGVjs.getPedalMarkings; exports.getPrevNote = _chunkCJZK2DGVjs.getPrevNote; exports.getRepeatStructure = _chunkCJZK2DGVjs.getRepeatStructure; exports.getSlurSpans = _chunkCJZK2DGVjs.getSlurSpans; exports.getSoundDamperPedal = getSoundDamperPedal; exports.getSoundDynamics = getSoundDynamics; exports.getSoundSoftPedal = getSoundSoftPedal; exports.getSoundSostenutoPedal = getSoundSostenutoPedal; exports.getSoundTempo = getSoundTempo; exports.getStaffRange = _chunkCJZK2DGVjs.getStaffRange; exports.getStaveCount = _chunkCJZK2DGVjs.getStaveCount; exports.getStaves = _chunkCJZK2DGVjs.getStaves; exports.getStructuralChanges = _chunkCJZK2DGVjs.getStructuralChanges; exports.getTempoMarkings = _chunkCJZK2DGVjs.getTempoMarkings; exports.getTiedNoteGroups = _chunkCJZK2DGVjs.getTiedNoteGroups; exports.getTimeChanges = _chunkCJZK2DGVjs.getTimeChanges; exports.getTupletGroups = _chunkCJZK2DGVjs.getTupletGroups; exports.getVerseCount = _chunkCJZK2DGVjs.getVerseCount; exports.getVerticalSlice = _chunkCJZK2DGVjs.getVerticalSlice; exports.getVoiceLine = _chunkCJZK2DGVjs.getVoiceLine; exports.getVoiceLineInRange = _chunkCJZK2DGVjs.getVoiceLineInRange; exports.getVoices = _chunkCJZK2DGVjs.getVoices; exports.getVoicesForStaff = _chunkCJZK2DGVjs.getVoicesForStaff; exports.getWedges = _chunkCJZK2DGVjs.getWedges; exports.groupByStaff = _chunkCJZK2DGVjs.groupByStaff; exports.groupByVoice = _chunkCJZK2DGVjs.groupByVoice; exports.hasBeam = hasBeam; exports.hasDirectionOfKind = hasDirectionOfKind; exports.hasLyrics = hasLyrics; exports.hasMultipleStaves = _chunkCJZK2DGVjs.hasMultipleStaves; exports.hasNotations = hasNotations; exports.hasNotes = _chunkCJZK2DGVjs.hasNotes; exports.hasPlaybackControls = _chunkCJZK2DGVjs.hasPlaybackControls; exports.hasTie = hasTie; exports.hasTieStart = hasTieStart; exports.hasTieStop = hasTieStop; exports.hasTuplet = hasTuplet; exports.inferStaff = _chunkCJZK2DGVjs.inferStaff; exports.insertClefChange = _chunkYCNKCOR2js.insertClefChange; exports.insertMeasure = _chunkYCNKCOR2js.insertMeasure; exports.insertNote = _chunkYCNKCOR2js.insertNote; exports.isChordNote = isChordNote; exports.isCompressed = isCompressed; exports.isCueNote = isCueNote; exports.isGraceNote = isGraceNote; exports.isPartInfo = isPartInfo; exports.isPitchedNote = isPitchedNote; exports.isRest = isRest; exports.isRestMeasure = _chunkCJZK2DGVjs.isRestMeasure; exports.isUnpitchedNote = isUnpitchedNote; exports.isValid = _chunkYCNKCOR2js.isValid; exports.iterateEntries = _chunkCJZK2DGVjs.iterateEntries; exports.iterateNotes = _chunkCJZK2DGVjs.iterateNotes; exports.lowerAccidental = _chunkYCNKCOR2js.lowerAccidental; exports.measureRoundtrip = _chunkCJZK2DGVjs.measureRoundtrip; exports.modifyDynamics = _chunkYCNKCOR2js.modifyDynamics; exports.modifyNoteDuration = _chunkYCNKCOR2js.modifyNoteDuration; exports.modifyNoteDurationChecked = _chunkYCNKCOR2js.modifyNoteDurationChecked; exports.modifyNotePitch = _chunkYCNKCOR2js.modifyNotePitch; exports.modifyNotePitchChecked = _chunkYCNKCOR2js.modifyNotePitchChecked; exports.modifyTempo = _chunkYCNKCOR2js.modifyTempo; exports.moveNoteToStaff = _chunkYCNKCOR2js.moveNoteToStaff; exports.parse = parse; exports.parseAbc = parseAbc; exports.parseAuto = parseAuto; exports.parseCompressed = parseCompressed; exports.parseFile = parseFile; exports.pasteNotes = _chunkYCNKCOR2js.pasteNotes; exports.pasteNotesMultiMeasure = _chunkYCNKCOR2js.pasteNotesMultiMeasure; exports.pitchToSemitone = _chunkCJZK2DGVjs.pitchToSemitone; exports.raiseAccidental = _chunkYCNKCOR2js.raiseAccidental; exports.removeArticulation = _chunkYCNKCOR2js.removeArticulation; exports.removeBeam = _chunkYCNKCOR2js.removeBeam; exports.removeBowing = _chunkYCNKCOR2js.removeBowing; exports.removeBreathMark = _chunkYCNKCOR2js.removeBreathMark; exports.removeCaesura = _chunkYCNKCOR2js.removeCaesura; exports.removeChordSymbol = _chunkYCNKCOR2js.removeChordSymbol; exports.removeDynamics = _chunkYCNKCOR2js.removeDynamics; exports.removeEnding = _chunkYCNKCOR2js.removeEnding; exports.removeFermata = _chunkYCNKCOR2js.removeFermata; exports.removeFingering = _chunkYCNKCOR2js.removeFingering; exports.removeGraceNote = _chunkYCNKCOR2js.removeGraceNote; exports.removeHarmony = _chunkYCNKCOR2js.removeHarmony; exports.removeLyric = _chunkYCNKCOR2js.removeLyric; exports.removeNote = _chunkYCNKCOR2js.removeNote; exports.removeOctaveShift = _chunkYCNKCOR2js.removeOctaveShift; exports.removeOrnament = _chunkYCNKCOR2js.removeOrnament; exports.removePart = _chunkYCNKCOR2js.removePart; exports.removePedal = _chunkYCNKCOR2js.removePedal; exports.removeRepeat = _chunkYCNKCOR2js.removeRepeat; exports.removeRepeatBarline = _chunkYCNKCOR2js.removeRepeatBarline; exports.removeSlur = _chunkYCNKCOR2js.removeSlur; exports.removeStringNumber = _chunkYCNKCOR2js.removeStringNumber; exports.removeTempo = _chunkYCNKCOR2js.removeTempo; exports.removeTie = _chunkYCNKCOR2js.removeTie; exports.removeTuplet = _chunkYCNKCOR2js.removeTuplet; exports.removeWedge = _chunkYCNKCOR2js.removeWedge; exports.scoresEqual = _chunkCJZK2DGVjs.scoresEqual; exports.serialize = serialize; exports.serializeAbc = serializeAbc; exports.serializeCompressed = serializeCompressed; exports.serializeToFile = serializeToFile; exports.setBarline = _chunkYCNKCOR2js.setBarline; exports.setBeaming = _chunkYCNKCOR2js.setBeaming; exports.setNotePitch = _chunkYCNKCOR2js.setNotePitch; exports.setNotePitchBySemitone = _chunkYCNKCOR2js.setNotePitchBySemitone; exports.setStaves = _chunkYCNKCOR2js.setStaves; exports.shiftNotePitch = _chunkYCNKCOR2js.shiftNotePitch; exports.stopOctaveShift = _chunkYCNKCOR2js.stopOctaveShift; exports.transpose = _chunkYCNKCOR2js.transpose; exports.transposeChecked = _chunkYCNKCOR2js.transposeChecked; exports.updateChordSymbol = _chunkYCNKCOR2js.updateChordSymbol; exports.updateHarmony = _chunkYCNKCOR2js.updateHarmony; exports.updateLyric = _chunkYCNKCOR2js.updateLyric; exports.validate = _chunkYCNKCOR2js.validate; exports.validateBackupForward = _chunkYCNKCOR2js.validateBackupForward; exports.validateBeams = _chunkYCNKCOR2js.validateBeams; exports.validateDivisions = _chunkYCNKCOR2js.validateDivisions; exports.validateMeasureDuration = _chunkYCNKCOR2js.validateMeasureDuration; exports.validateMeasureLocal = _chunkYCNKCOR2js.validateMeasureLocal; exports.validatePartReferences = _chunkYCNKCOR2js.validatePartReferences; exports.validatePartStructure = _chunkYCNKCOR2js.validatePartStructure; exports.validateSlurs = _chunkYCNKCOR2js.validateSlurs; exports.validateSlursAcrossMeasures = _chunkYCNKCOR2js.validateSlursAcrossMeasures; exports.validateStaffStructure = _chunkYCNKCOR2js.validateStaffStructure; exports.validateTies = _chunkYCNKCOR2js.validateTies; exports.validateTiesAcrossMeasures = _chunkYCNKCOR2js.validateTiesAcrossMeasures; exports.validateTuplets = _chunkYCNKCOR2js.validateTuplets; exports.validateVoiceStaff = _chunkYCNKCOR2js.validateVoiceStaff; exports.withAbsolutePositions = _chunkCJZK2DGVjs.withAbsolutePositions;
8214
+
8215
+
8216
+ exports.STEPS = _chunkCHMV7XWYjs.STEPS; exports.STEP_SEMITONES = _chunkCHMV7XWYjs.STEP_SEMITONES; exports.ValidationException = _chunkS5MWUJU2js.ValidationException; exports.addArticulation = _chunkS5MWUJU2js.addArticulation; exports.addBeam = _chunkS5MWUJU2js.addBeam; exports.addBowing = _chunkS5MWUJU2js.addBowing; exports.addBreathMark = _chunkS5MWUJU2js.addBreathMark; exports.addCaesura = _chunkS5MWUJU2js.addCaesura; exports.addChord = _chunkS5MWUJU2js.addChord; exports.addChordNote = _chunkS5MWUJU2js.addChordNote; exports.addChordNoteChecked = _chunkS5MWUJU2js.addChordNoteChecked; exports.addChordSymbol = _chunkS5MWUJU2js.addChordSymbol; exports.addCoda = _chunkS5MWUJU2js.addCoda; exports.addDaCapo = _chunkS5MWUJU2js.addDaCapo; exports.addDalSegno = _chunkS5MWUJU2js.addDalSegno; exports.addDynamics = _chunkS5MWUJU2js.addDynamics; exports.addEnding = _chunkS5MWUJU2js.addEnding; exports.addFermata = _chunkS5MWUJU2js.addFermata; exports.addFine = _chunkS5MWUJU2js.addFine; exports.addFingering = _chunkS5MWUJU2js.addFingering; exports.addGraceNote = _chunkS5MWUJU2js.addGraceNote; exports.addHarmony = _chunkS5MWUJU2js.addHarmony; exports.addLyric = _chunkS5MWUJU2js.addLyric; exports.addNote = _chunkS5MWUJU2js.addNote; exports.addNoteChecked = _chunkS5MWUJU2js.addNoteChecked; exports.addOctaveShift = _chunkS5MWUJU2js.addOctaveShift; exports.addOrnament = _chunkS5MWUJU2js.addOrnament; exports.addPart = _chunkS5MWUJU2js.addPart; exports.addPedal = _chunkS5MWUJU2js.addPedal; exports.addRehearsalMark = _chunkS5MWUJU2js.addRehearsalMark; exports.addRepeat = _chunkS5MWUJU2js.addRepeat; exports.addRepeatBarline = _chunkS5MWUJU2js.addRepeatBarline; exports.addSegno = _chunkS5MWUJU2js.addSegno; exports.addSlur = _chunkS5MWUJU2js.addSlur; exports.addStringNumber = _chunkS5MWUJU2js.addStringNumber; exports.addTempo = _chunkS5MWUJU2js.addTempo; exports.addText = _chunkS5MWUJU2js.addText; exports.addTextDirection = _chunkS5MWUJU2js.addTextDirection; exports.addTie = _chunkS5MWUJU2js.addTie; exports.addToCoda = _chunkS5MWUJU2js.addToCoda; exports.addVoice = _chunkS5MWUJU2js.addVoice; exports.addWedge = _chunkS5MWUJU2js.addWedge; exports.assertMeasureValid = _chunkS5MWUJU2js.assertMeasureValid; exports.assertValid = _chunkS5MWUJU2js.assertValid; exports.autoBeam = _chunkS5MWUJU2js.autoBeam; exports.buildVoiceToStaffMap = _chunkCHMV7XWYjs.buildVoiceToStaffMap; exports.buildVoiceToStaffMapForPart = _chunkCHMV7XWYjs.buildVoiceToStaffMapForPart; exports.changeBarline = _chunkS5MWUJU2js.changeBarline; exports.changeClef = _chunkS5MWUJU2js.changeClef; exports.changeKey = _chunkS5MWUJU2js.changeKey; exports.changeNoteDuration = _chunkS5MWUJU2js.changeNoteDuration; exports.changeTime = _chunkS5MWUJU2js.changeTime; exports.convertToGrace = _chunkS5MWUJU2js.convertToGrace; exports.copyNotes = _chunkS5MWUJU2js.copyNotes; exports.copyNotesMultiMeasure = _chunkS5MWUJU2js.copyNotesMultiMeasure; exports.countNotes = _chunkCHMV7XWYjs.countNotes; exports.createTuplet = _chunkS5MWUJU2js.createTuplet; exports.cutNotes = _chunkS5MWUJU2js.cutNotes; exports.decodeBuffer = decodeBuffer; exports.deleteMeasure = _chunkS5MWUJU2js.deleteMeasure; exports.deleteNote = _chunkS5MWUJU2js.deleteNote; exports.deleteNoteChecked = _chunkS5MWUJU2js.deleteNoteChecked; exports.duplicatePart = _chunkS5MWUJU2js.duplicatePart; exports.exportMidi = exportMidi; exports.exportMidiWithTimingMap = exportMidiWithTimingMap; exports.extractPlaybackControls = _chunkCHMV7XWYjs.extractPlaybackControls; exports.findBarlines = _chunkCHMV7XWYjs.findBarlines; exports.findDirectionsByType = _chunkCHMV7XWYjs.findDirectionsByType; exports.findNotes = _chunkCHMV7XWYjs.findNotes; exports.findNotesWithNotation = _chunkCHMV7XWYjs.findNotesWithNotation; exports.formatLocation = _chunkS5MWUJU2js.formatLocation; exports.generateId = _chunkS5MWUJU2js.generateId; exports.generatePlaybackSequence = _chunkCHMV7XWYjs.generatePlaybackSequence; exports.generatePlaybackTimeline = _chunkCHMV7XWYjs.generatePlaybackTimeline; exports.getAbsolutePosition = _chunkCHMV7XWYjs.getAbsolutePosition; exports.getAdjacentNotes = _chunkCHMV7XWYjs.getAdjacentNotes; exports.getAllNotes = _chunkCHMV7XWYjs.getAllNotes; exports.getAllPartInfos = getAllPartInfos; exports.getAttributesAtMeasure = _chunkCHMV7XWYjs.getAttributesAtMeasure; exports.getBeamGroups = _chunkCHMV7XWYjs.getBeamGroups; exports.getChordProgression = _chunkCHMV7XWYjs.getChordProgression; exports.getChords = _chunkCHMV7XWYjs.getChords; exports.getClefChanges = _chunkCHMV7XWYjs.getClefChanges; exports.getClefForStaff = _chunkCHMV7XWYjs.getClefForStaff; exports.getDirectionOfKind = getDirectionOfKind; exports.getDirections = _chunkCHMV7XWYjs.getDirections; exports.getDirectionsAtPosition = _chunkCHMV7XWYjs.getDirectionsAtPosition; exports.getDirectionsOfKind = getDirectionsOfKind; exports.getDivisions = _chunkCHMV7XWYjs.getDivisions; exports.getDuration = _chunkCHMV7XWYjs.getDuration; exports.getDynamics = _chunkCHMV7XWYjs.getDynamics; exports.getEffectiveStaff = _chunkCHMV7XWYjs.getEffectiveStaff; exports.getEndings = _chunkCHMV7XWYjs.getEndings; exports.getEntriesAtPosition = _chunkCHMV7XWYjs.getEntriesAtPosition; exports.getEntriesForStaff = _chunkCHMV7XWYjs.getEntriesForStaff; exports.getEntriesInRange = _chunkCHMV7XWYjs.getEntriesInRange; exports.getHarmonies = _chunkCHMV7XWYjs.getHarmonies; exports.getHarmonyAtPosition = _chunkCHMV7XWYjs.getHarmonyAtPosition; exports.getKeyChanges = _chunkCHMV7XWYjs.getKeyChanges; exports.getLyricText = _chunkCHMV7XWYjs.getLyricText; exports.getLyrics = _chunkCHMV7XWYjs.getLyrics; exports.getMeasure = _chunkCHMV7XWYjs.getMeasure; exports.getMeasureByIndex = _chunkCHMV7XWYjs.getMeasureByIndex; exports.getMeasureContext = _chunkS5MWUJU2js.getMeasureContext; exports.getMeasureCount = _chunkCHMV7XWYjs.getMeasureCount; exports.getMeasureEndPosition = _chunkCHMV7XWYjs.getMeasureEndPosition; exports.getNextNote = _chunkCHMV7XWYjs.getNextNote; exports.getNormalizedDuration = _chunkCHMV7XWYjs.getNormalizedDuration; exports.getNormalizedPosition = _chunkCHMV7XWYjs.getNormalizedPosition; exports.getNotesAtPosition = _chunkCHMV7XWYjs.getNotesAtPosition; exports.getNotesForStaff = _chunkCHMV7XWYjs.getNotesForStaff; exports.getNotesForVoice = _chunkCHMV7XWYjs.getNotesForVoice; exports.getNotesInRange = _chunkCHMV7XWYjs.getNotesInRange; exports.getOctaveShifts = _chunkCHMV7XWYjs.getOctaveShifts; exports.getPartAbbreviation = getPartAbbreviation; exports.getPartById = _chunkCHMV7XWYjs.getPartById; exports.getPartByIndex = _chunkCHMV7XWYjs.getPartByIndex; exports.getPartCount = _chunkCHMV7XWYjs.getPartCount; exports.getPartIds = _chunkCHMV7XWYjs.getPartIds; exports.getPartIndex = _chunkCHMV7XWYjs.getPartIndex; exports.getPartInfo = getPartInfo; exports.getPartName = getPartName; exports.getPartNameMap = getPartNameMap; exports.getPedalMarkings = _chunkCHMV7XWYjs.getPedalMarkings; exports.getPrevNote = _chunkCHMV7XWYjs.getPrevNote; exports.getRepeatStructure = _chunkCHMV7XWYjs.getRepeatStructure; exports.getSlurSpans = _chunkCHMV7XWYjs.getSlurSpans; exports.getSoundDamperPedal = getSoundDamperPedal; exports.getSoundDynamics = getSoundDynamics; exports.getSoundSoftPedal = getSoundSoftPedal; exports.getSoundSostenutoPedal = getSoundSostenutoPedal; exports.getSoundTempo = getSoundTempo; exports.getStaffRange = _chunkCHMV7XWYjs.getStaffRange; exports.getStaveCount = _chunkCHMV7XWYjs.getStaveCount; exports.getStaves = _chunkCHMV7XWYjs.getStaves; exports.getStructuralChanges = _chunkCHMV7XWYjs.getStructuralChanges; exports.getTempoMarkings = _chunkCHMV7XWYjs.getTempoMarkings; exports.getTiedNoteGroups = _chunkCHMV7XWYjs.getTiedNoteGroups; exports.getTimeChanges = _chunkCHMV7XWYjs.getTimeChanges; exports.getTupletGroups = _chunkCHMV7XWYjs.getTupletGroups; exports.getVerseCount = _chunkCHMV7XWYjs.getVerseCount; exports.getVerticalSlice = _chunkCHMV7XWYjs.getVerticalSlice; exports.getVoiceLine = _chunkCHMV7XWYjs.getVoiceLine; exports.getVoiceLineInRange = _chunkCHMV7XWYjs.getVoiceLineInRange; exports.getVoices = _chunkCHMV7XWYjs.getVoices; exports.getVoicesForStaff = _chunkCHMV7XWYjs.getVoicesForStaff; exports.getWedges = _chunkCHMV7XWYjs.getWedges; exports.groupByStaff = _chunkCHMV7XWYjs.groupByStaff; exports.groupByVoice = _chunkCHMV7XWYjs.groupByVoice; exports.hasBeam = hasBeam; exports.hasDirectionOfKind = hasDirectionOfKind; exports.hasLyrics = hasLyrics; exports.hasMultipleStaves = _chunkCHMV7XWYjs.hasMultipleStaves; exports.hasNotations = hasNotations; exports.hasNotes = _chunkCHMV7XWYjs.hasNotes; exports.hasPlaybackControls = _chunkCHMV7XWYjs.hasPlaybackControls; exports.hasTie = hasTie; exports.hasTieStart = hasTieStart; exports.hasTieStop = hasTieStop; exports.hasTuplet = hasTuplet; exports.inferStaff = _chunkCHMV7XWYjs.inferStaff; exports.insertClefChange = _chunkS5MWUJU2js.insertClefChange; exports.insertMeasure = _chunkS5MWUJU2js.insertMeasure; exports.insertNote = _chunkS5MWUJU2js.insertNote; exports.isChordNote = isChordNote; exports.isCompressed = isCompressed; exports.isCueNote = isCueNote; exports.isGraceNote = isGraceNote; exports.isPartInfo = isPartInfo; exports.isPitchedNote = isPitchedNote; exports.isRest = isRest; exports.isRestMeasure = _chunkCHMV7XWYjs.isRestMeasure; exports.isUnpitchedNote = isUnpitchedNote; exports.isValid = _chunkS5MWUJU2js.isValid; exports.iterateEntries = _chunkCHMV7XWYjs.iterateEntries; exports.iterateNotes = _chunkCHMV7XWYjs.iterateNotes; exports.lowerAccidental = _chunkS5MWUJU2js.lowerAccidental; exports.measureRoundtrip = _chunkCHMV7XWYjs.measureRoundtrip; exports.modifyDynamics = _chunkS5MWUJU2js.modifyDynamics; exports.modifyNoteDuration = _chunkS5MWUJU2js.modifyNoteDuration; exports.modifyNoteDurationChecked = _chunkS5MWUJU2js.modifyNoteDurationChecked; exports.modifyNotePitch = _chunkS5MWUJU2js.modifyNotePitch; exports.modifyNotePitchChecked = _chunkS5MWUJU2js.modifyNotePitchChecked; exports.modifyTempo = _chunkS5MWUJU2js.modifyTempo; exports.moveNoteToStaff = _chunkS5MWUJU2js.moveNoteToStaff; exports.parse = parse; exports.parseAbc = parseAbc; exports.parseAuto = parseAuto; exports.parseCompressed = parseCompressed; exports.parseFile = parseFile; exports.pasteNotes = _chunkS5MWUJU2js.pasteNotes; exports.pasteNotesMultiMeasure = _chunkS5MWUJU2js.pasteNotesMultiMeasure; exports.pitchToSemitone = _chunkCHMV7XWYjs.pitchToSemitone; exports.raiseAccidental = _chunkS5MWUJU2js.raiseAccidental; exports.removeArticulation = _chunkS5MWUJU2js.removeArticulation; exports.removeBeam = _chunkS5MWUJU2js.removeBeam; exports.removeBowing = _chunkS5MWUJU2js.removeBowing; exports.removeBreathMark = _chunkS5MWUJU2js.removeBreathMark; exports.removeCaesura = _chunkS5MWUJU2js.removeCaesura; exports.removeChordSymbol = _chunkS5MWUJU2js.removeChordSymbol; exports.removeDynamics = _chunkS5MWUJU2js.removeDynamics; exports.removeEnding = _chunkS5MWUJU2js.removeEnding; exports.removeFermata = _chunkS5MWUJU2js.removeFermata; exports.removeFingering = _chunkS5MWUJU2js.removeFingering; exports.removeGraceNote = _chunkS5MWUJU2js.removeGraceNote; exports.removeHarmony = _chunkS5MWUJU2js.removeHarmony; exports.removeLyric = _chunkS5MWUJU2js.removeLyric; exports.removeNote = _chunkS5MWUJU2js.removeNote; exports.removeOctaveShift = _chunkS5MWUJU2js.removeOctaveShift; exports.removeOrnament = _chunkS5MWUJU2js.removeOrnament; exports.removePart = _chunkS5MWUJU2js.removePart; exports.removePedal = _chunkS5MWUJU2js.removePedal; exports.removeRepeat = _chunkS5MWUJU2js.removeRepeat; exports.removeRepeatBarline = _chunkS5MWUJU2js.removeRepeatBarline; exports.removeSlur = _chunkS5MWUJU2js.removeSlur; exports.removeStringNumber = _chunkS5MWUJU2js.removeStringNumber; exports.removeTempo = _chunkS5MWUJU2js.removeTempo; exports.removeTie = _chunkS5MWUJU2js.removeTie; exports.removeTuplet = _chunkS5MWUJU2js.removeTuplet; exports.removeWedge = _chunkS5MWUJU2js.removeWedge; exports.scoresEqual = _chunkCHMV7XWYjs.scoresEqual; exports.serialize = serialize; exports.serializeAbc = serializeAbc; exports.serializeCompressed = serializeCompressed; exports.serializeToFile = serializeToFile; exports.setBarline = _chunkS5MWUJU2js.setBarline; exports.setBeaming = _chunkS5MWUJU2js.setBeaming; exports.setNotePitch = _chunkS5MWUJU2js.setNotePitch; exports.setNotePitchBySemitone = _chunkS5MWUJU2js.setNotePitchBySemitone; exports.setStaves = _chunkS5MWUJU2js.setStaves; exports.shiftNotePitch = _chunkS5MWUJU2js.shiftNotePitch; exports.stopOctaveShift = _chunkS5MWUJU2js.stopOctaveShift; exports.transpose = _chunkS5MWUJU2js.transpose; exports.transposeChecked = _chunkS5MWUJU2js.transposeChecked; exports.updateChordSymbol = _chunkS5MWUJU2js.updateChordSymbol; exports.updateHarmony = _chunkS5MWUJU2js.updateHarmony; exports.updateLyric = _chunkS5MWUJU2js.updateLyric; exports.validate = _chunkS5MWUJU2js.validate; exports.validateBackupForward = _chunkS5MWUJU2js.validateBackupForward; exports.validateBeams = _chunkS5MWUJU2js.validateBeams; exports.validateDivisions = _chunkS5MWUJU2js.validateDivisions; exports.validateMeasureDuration = _chunkS5MWUJU2js.validateMeasureDuration; exports.validateMeasureLocal = _chunkS5MWUJU2js.validateMeasureLocal; exports.validatePartReferences = _chunkS5MWUJU2js.validatePartReferences; exports.validatePartStructure = _chunkS5MWUJU2js.validatePartStructure; exports.validateSlurs = _chunkS5MWUJU2js.validateSlurs; exports.validateSlursAcrossMeasures = _chunkS5MWUJU2js.validateSlursAcrossMeasures; exports.validateStaffStructure = _chunkS5MWUJU2js.validateStaffStructure; exports.validateTies = _chunkS5MWUJU2js.validateTies; exports.validateTiesAcrossMeasures = _chunkS5MWUJU2js.validateTiesAcrossMeasures; exports.validateTuplets = _chunkS5MWUJU2js.validateTuplets; exports.validateVoiceStaff = _chunkS5MWUJU2js.validateVoiceStaff; exports.withAbsolutePositions = _chunkCHMV7XWYjs.withAbsolutePositions;