musicxml-io 0.10.2 → 0.11.0
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/README.md +9 -7
- package/dist/browser.js +2 -2
- package/dist/browser.mjs +1 -1
- package/dist/{chunk-OWCMKOT4.js → chunk-O7G4CNSU.js} +170 -72
- package/dist/{chunk-5UYE6FMH.mjs → chunk-YICQ3O7V.mjs} +162 -64
- package/dist/index.js +10 -10
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -476,17 +476,19 @@ import { isRest, getPartName } from 'musicxml-io/accessors';
|
|
|
476
476
|
```
|
|
477
477
|
|
|
478
478
|
The package declares `"sideEffects": false`, so bundlers can drop everything
|
|
479
|
-
you don't import — pulling in only `parse` costs roughly
|
|
480
|
-
(~
|
|
479
|
+
you don't import — pulling in only `parse` costs roughly 51 KB minified
|
|
480
|
+
(~14 KB gzip).
|
|
481
481
|
|
|
482
|
-
Approximate cost of common imports (minified / gzipped
|
|
482
|
+
Approximate cost of common imports (minified / gzipped, measured with
|
|
483
|
+
esbuild against the published ESM build):
|
|
483
484
|
|
|
484
485
|
| Import | Size |
|
|
485
486
|
|--------|------|
|
|
486
|
-
| `parse` (.xml only) | ~
|
|
487
|
-
| `parseAuto` (.xml + .mxl, adds fflate's unzip) | ~
|
|
488
|
-
| `
|
|
489
|
-
|
|
|
487
|
+
| `parse` (.xml only) | ~51 KB / ~14 KB |
|
|
488
|
+
| `parseAuto` (.xml + .mxl, adds fflate's unzip) | ~57 KB / ~17 KB |
|
|
489
|
+
| `serialize` (includes the validator behind `validate: true`) | ~62 KB / ~15 KB |
|
|
490
|
+
| `parse` + `serialize` | ~109 KB / ~28 KB |
|
|
491
|
+
| everything | ~316 KB / ~78 KB |
|
|
490
492
|
|
|
491
493
|
The ABC notation codecs (`parseAbc`, `serializeAbc`), MIDI export, query
|
|
492
494
|
helpers, operations, and the validator are all separate modules — they only
|
package/dist/browser.js
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
var
|
|
14
|
+
var _chunkO7G4CNSUjs = require('./chunk-O7G4CNSU.js');
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
|
|
@@ -517,4 +517,4 @@ var _chunkEWLB5X64js = require('./chunk-EWLB5X64.js');
|
|
|
517
517
|
|
|
518
518
|
|
|
519
519
|
|
|
520
|
-
exports.ALL_COLOR_TARGETS = _chunkK7W4FSFVjs.ALL_COLOR_TARGETS; exports.STEPS = _chunkEWLB5X64js.STEPS; exports.STEP_SEMITONES = _chunkEWLB5X64js.STEP_SEMITONES; exports.ValidationException = _chunkK7W4FSFVjs.ValidationException; exports.addArticulation = _chunkK7W4FSFVjs.addArticulation; exports.addBeam = _chunkK7W4FSFVjs.addBeam; exports.addBowing = _chunkK7W4FSFVjs.addBowing; exports.addBreathMark = _chunkK7W4FSFVjs.addBreathMark; exports.addCaesura = _chunkK7W4FSFVjs.addCaesura; exports.addChord = _chunkK7W4FSFVjs.addChord; exports.addChordNote = _chunkK7W4FSFVjs.addChordNote; exports.addChordNoteChecked = _chunkK7W4FSFVjs.addChordNoteChecked; exports.addChordSymbol = _chunkK7W4FSFVjs.addChordSymbol; exports.addCoda = _chunkK7W4FSFVjs.addCoda; exports.addDaCapo = _chunkK7W4FSFVjs.addDaCapo; exports.addDalSegno = _chunkK7W4FSFVjs.addDalSegno; exports.addDynamics = _chunkK7W4FSFVjs.addDynamics; exports.addEnding = _chunkK7W4FSFVjs.addEnding; exports.addFermata = _chunkK7W4FSFVjs.addFermata; exports.addFine = _chunkK7W4FSFVjs.addFine; exports.addFingering = _chunkK7W4FSFVjs.addFingering; exports.addGraceNote = _chunkK7W4FSFVjs.addGraceNote; exports.addHarmony = _chunkK7W4FSFVjs.addHarmony; exports.addLyric = _chunkK7W4FSFVjs.addLyric; exports.addNote = _chunkK7W4FSFVjs.addNote; exports.addNoteChecked = _chunkK7W4FSFVjs.addNoteChecked; exports.addOctaveShift = _chunkK7W4FSFVjs.addOctaveShift; exports.addOrnament = _chunkK7W4FSFVjs.addOrnament; exports.addPart = _chunkK7W4FSFVjs.addPart; exports.addPedal = _chunkK7W4FSFVjs.addPedal; exports.addRehearsalMark = _chunkK7W4FSFVjs.addRehearsalMark; exports.addRepeat = _chunkK7W4FSFVjs.addRepeat; exports.addRepeatBarline = _chunkK7W4FSFVjs.addRepeatBarline; exports.addSegno = _chunkK7W4FSFVjs.addSegno; exports.addSlur = _chunkK7W4FSFVjs.addSlur; exports.addStringNumber = _chunkK7W4FSFVjs.addStringNumber; exports.addTempo = _chunkK7W4FSFVjs.addTempo; exports.addText = _chunkK7W4FSFVjs.addText; exports.addTextDirection = _chunkK7W4FSFVjs.addTextDirection; exports.addTie = _chunkK7W4FSFVjs.addTie; exports.addToCoda = _chunkK7W4FSFVjs.addToCoda; exports.addVoice = _chunkK7W4FSFVjs.addVoice; exports.addWedge = _chunkK7W4FSFVjs.addWedge; exports.assertMeasureValid = _chunkK7W4FSFVjs.assertMeasureValid; exports.assertValid = _chunkK7W4FSFVjs.assertValid; exports.autoBeam = _chunkK7W4FSFVjs.autoBeam; exports.buildVoiceToStaffMap = _chunkEWLB5X64js.buildVoiceToStaffMap; exports.buildVoiceToStaffMapForPart = _chunkEWLB5X64js.buildVoiceToStaffMapForPart; exports.changeBarline = _chunkK7W4FSFVjs.changeBarline; exports.changeClef = _chunkK7W4FSFVjs.changeClef; exports.changeKey = _chunkK7W4FSFVjs.changeKey; exports.changeNoteDuration = _chunkK7W4FSFVjs.changeNoteDuration; exports.changeTime = _chunkK7W4FSFVjs.changeTime; exports.clearColors = _chunkK7W4FSFVjs.clearColors; exports.convertToGrace = _chunkK7W4FSFVjs.convertToGrace; exports.copyNotes = _chunkK7W4FSFVjs.copyNotes; exports.copyNotesMultiMeasure = _chunkK7W4FSFVjs.copyNotesMultiMeasure; exports.countNotes = _chunkEWLB5X64js.countNotes; exports.createTuplet = _chunkK7W4FSFVjs.createTuplet; exports.cutNotes = _chunkK7W4FSFVjs.cutNotes; exports.deleteMeasure = _chunkK7W4FSFVjs.deleteMeasure; exports.deleteNote = _chunkK7W4FSFVjs.deleteNote; exports.deleteNoteChecked = _chunkK7W4FSFVjs.deleteNoteChecked; exports.duplicatePart = _chunkK7W4FSFVjs.duplicatePart; exports.exportMidi = _chunkOWCMKOT4js.exportMidi; exports.exportMidiWithTimingMap = _chunkOWCMKOT4js.exportMidiWithTimingMap; exports.extractPlaybackControls = _chunkEWLB5X64js.extractPlaybackControls; exports.findBarlines = _chunkEWLB5X64js.findBarlines; exports.findDirectionsByType = _chunkEWLB5X64js.findDirectionsByType; exports.findNotes = _chunkEWLB5X64js.findNotes; exports.findNotesWithNotation = _chunkEWLB5X64js.findNotesWithNotation; exports.formatLocation = _chunkK7W4FSFVjs.formatLocation; exports.generateId = _chunkK7W4FSFVjs.generateId; exports.generatePlaybackSequence = _chunkEWLB5X64js.generatePlaybackSequence; exports.generatePlaybackTimeline = _chunkEWLB5X64js.generatePlaybackTimeline; exports.getAbsolutePosition = _chunkEWLB5X64js.getAbsolutePosition; exports.getAdjacentNotes = _chunkEWLB5X64js.getAdjacentNotes; exports.getAllNotes = _chunkEWLB5X64js.getAllNotes; exports.getAllPartInfos = _chunkOEX7NVZNjs.getAllPartInfos; exports.getAttributesAtMeasure = _chunkEWLB5X64js.getAttributesAtMeasure; exports.getBeamGroups = _chunkEWLB5X64js.getBeamGroups; exports.getChordProgression = _chunkEWLB5X64js.getChordProgression; exports.getChords = _chunkEWLB5X64js.getChords; exports.getClefChanges = _chunkEWLB5X64js.getClefChanges; exports.getClefForStaff = _chunkEWLB5X64js.getClefForStaff; exports.getDirectionOfKind = _chunkOEX7NVZNjs.getDirectionOfKind; exports.getDirections = _chunkEWLB5X64js.getDirections; exports.getDirectionsAtPosition = _chunkEWLB5X64js.getDirectionsAtPosition; exports.getDirectionsOfKind = _chunkOEX7NVZNjs.getDirectionsOfKind; exports.getDivisions = _chunkEWLB5X64js.getDivisions; exports.getDuration = _chunkEWLB5X64js.getDuration; exports.getDynamics = _chunkEWLB5X64js.getDynamics; exports.getEffectiveStaff = _chunkEWLB5X64js.getEffectiveStaff; exports.getEndings = _chunkEWLB5X64js.getEndings; exports.getEntriesAtPosition = _chunkEWLB5X64js.getEntriesAtPosition; exports.getEntriesForStaff = _chunkEWLB5X64js.getEntriesForStaff; exports.getEntriesInRange = _chunkEWLB5X64js.getEntriesInRange; exports.getHarmonies = _chunkEWLB5X64js.getHarmonies; exports.getHarmonyAtPosition = _chunkEWLB5X64js.getHarmonyAtPosition; exports.getKeyChanges = _chunkEWLB5X64js.getKeyChanges; exports.getLyricText = _chunkEWLB5X64js.getLyricText; exports.getLyrics = _chunkEWLB5X64js.getLyrics; exports.getMeasure = _chunkEWLB5X64js.getMeasure; exports.getMeasureByIndex = _chunkEWLB5X64js.getMeasureByIndex; exports.getMeasureContext = _chunkK7W4FSFVjs.getMeasureContext; exports.getMeasureCount = _chunkEWLB5X64js.getMeasureCount; exports.getMeasureEndPosition = _chunkEWLB5X64js.getMeasureEndPosition; exports.getNextNote = _chunkEWLB5X64js.getNextNote; exports.getNormalizedDuration = _chunkEWLB5X64js.getNormalizedDuration; exports.getNormalizedPosition = _chunkEWLB5X64js.getNormalizedPosition; exports.getNotesAtPosition = _chunkEWLB5X64js.getNotesAtPosition; exports.getNotesForStaff = _chunkEWLB5X64js.getNotesForStaff; exports.getNotesForVoice = _chunkEWLB5X64js.getNotesForVoice; exports.getNotesInRange = _chunkEWLB5X64js.getNotesInRange; exports.getOctaveShifts = _chunkEWLB5X64js.getOctaveShifts; exports.getPartAbbreviation = _chunkOEX7NVZNjs.getPartAbbreviation; exports.getPartById = _chunkEWLB5X64js.getPartById; exports.getPartByIndex = _chunkEWLB5X64js.getPartByIndex; exports.getPartCount = _chunkEWLB5X64js.getPartCount; exports.getPartIds = _chunkEWLB5X64js.getPartIds; exports.getPartIndex = _chunkEWLB5X64js.getPartIndex; exports.getPartInfo = _chunkOEX7NVZNjs.getPartInfo; exports.getPartName = _chunkOEX7NVZNjs.getPartName; exports.getPartNameMap = _chunkOEX7NVZNjs.getPartNameMap; exports.getPedalMarkings = _chunkEWLB5X64js.getPedalMarkings; exports.getPrevNote = _chunkEWLB5X64js.getPrevNote; exports.getRepeatStructure = _chunkEWLB5X64js.getRepeatStructure; exports.getSlurSpans = _chunkEWLB5X64js.getSlurSpans; exports.getSoundDamperPedal = _chunkOEX7NVZNjs.getSoundDamperPedal; exports.getSoundDynamics = _chunkOEX7NVZNjs.getSoundDynamics; exports.getSoundSoftPedal = _chunkOEX7NVZNjs.getSoundSoftPedal; exports.getSoundSostenutoPedal = _chunkOEX7NVZNjs.getSoundSostenutoPedal; exports.getSoundTempo = _chunkOEX7NVZNjs.getSoundTempo; exports.getStaffRange = _chunkEWLB5X64js.getStaffRange; exports.getStaveCount = _chunkEWLB5X64js.getStaveCount; exports.getStaves = _chunkEWLB5X64js.getStaves; exports.getStructuralChanges = _chunkEWLB5X64js.getStructuralChanges; exports.getTempoMarkings = _chunkEWLB5X64js.getTempoMarkings; exports.getTiedNoteGroups = _chunkEWLB5X64js.getTiedNoteGroups; exports.getTimeChanges = _chunkEWLB5X64js.getTimeChanges; exports.getTupletGroups = _chunkEWLB5X64js.getTupletGroups; exports.getVerseCount = _chunkEWLB5X64js.getVerseCount; exports.getVerticalSlice = _chunkEWLB5X64js.getVerticalSlice; exports.getVoiceLine = _chunkEWLB5X64js.getVoiceLine; exports.getVoiceLineInRange = _chunkEWLB5X64js.getVoiceLineInRange; exports.getVoices = _chunkEWLB5X64js.getVoices; exports.getVoicesForStaff = _chunkEWLB5X64js.getVoicesForStaff; exports.getWedges = _chunkEWLB5X64js.getWedges; exports.groupByStaff = _chunkEWLB5X64js.groupByStaff; exports.groupByVoice = _chunkEWLB5X64js.groupByVoice; exports.hasBeam = _chunkOEX7NVZNjs.hasBeam; exports.hasDirectionOfKind = _chunkOEX7NVZNjs.hasDirectionOfKind; exports.hasLyrics = _chunkOEX7NVZNjs.hasLyrics; exports.hasMultipleStaves = _chunkEWLB5X64js.hasMultipleStaves; exports.hasNotations = _chunkOEX7NVZNjs.hasNotations; exports.hasNotes = _chunkEWLB5X64js.hasNotes; exports.hasPlaybackControls = _chunkEWLB5X64js.hasPlaybackControls; exports.hasTie = _chunkOEX7NVZNjs.hasTie; exports.hasTieStart = _chunkOEX7NVZNjs.hasTieStart; exports.hasTieStop = _chunkOEX7NVZNjs.hasTieStop; exports.hasTuplet = _chunkOEX7NVZNjs.hasTuplet; exports.inferStaff = _chunkEWLB5X64js.inferStaff; exports.insertClefChange = _chunkK7W4FSFVjs.insertClefChange; exports.insertMeasure = _chunkK7W4FSFVjs.insertMeasure; exports.insertNote = _chunkK7W4FSFVjs.insertNote; exports.isChordNote = _chunkOEX7NVZNjs.isChordNote; exports.isCompressed = _chunkOWCMKOT4js.isCompressed; exports.isCueNote = _chunkOEX7NVZNjs.isCueNote; exports.isGraceNote = _chunkOEX7NVZNjs.isGraceNote; exports.isPartInfo = _chunkOEX7NVZNjs.isPartInfo; exports.isPitchedNote = _chunkOEX7NVZNjs.isPitchedNote; exports.isRest = _chunkOEX7NVZNjs.isRest; exports.isRestMeasure = _chunkEWLB5X64js.isRestMeasure; exports.isUnpitchedNote = _chunkOEX7NVZNjs.isUnpitchedNote; exports.isValid = _chunkK7W4FSFVjs.isValid; exports.iterateEntries = _chunkEWLB5X64js.iterateEntries; exports.iterateNotes = _chunkEWLB5X64js.iterateNotes; exports.lowerAccidental = _chunkK7W4FSFVjs.lowerAccidental; exports.measureRoundtrip = _chunkEWLB5X64js.measureRoundtrip; exports.modifyDynamics = _chunkK7W4FSFVjs.modifyDynamics; exports.modifyNoteDuration = _chunkK7W4FSFVjs.modifyNoteDuration; exports.modifyNoteDurationChecked = _chunkK7W4FSFVjs.modifyNoteDurationChecked; exports.modifyNotePitch = _chunkK7W4FSFVjs.modifyNotePitch; exports.modifyNotePitchChecked = _chunkK7W4FSFVjs.modifyNotePitchChecked; exports.modifyTempo = _chunkK7W4FSFVjs.modifyTempo; exports.moveNoteToStaff = _chunkK7W4FSFVjs.moveNoteToStaff; exports.parse = _chunkOWCMKOT4js.parse; exports.parseAbc = _chunkOWCMKOT4js.parseAbc; exports.parseAbcTunes = _chunkOWCMKOT4js.parseAbcTunes; exports.parseAuto = _chunkOWCMKOT4js.parseAuto; exports.parseCompressed = _chunkOWCMKOT4js.parseCompressed; exports.pasteNotes = _chunkK7W4FSFVjs.pasteNotes; exports.pasteNotesMultiMeasure = _chunkK7W4FSFVjs.pasteNotesMultiMeasure; exports.pitchToSemitone = _chunkEWLB5X64js.pitchToSemitone; exports.raiseAccidental = _chunkK7W4FSFVjs.raiseAccidental; exports.removeArticulation = _chunkK7W4FSFVjs.removeArticulation; exports.removeBeam = _chunkK7W4FSFVjs.removeBeam; exports.removeBowing = _chunkK7W4FSFVjs.removeBowing; exports.removeBreathMark = _chunkK7W4FSFVjs.removeBreathMark; exports.removeCaesura = _chunkK7W4FSFVjs.removeCaesura; exports.removeChordSymbol = _chunkK7W4FSFVjs.removeChordSymbol; exports.removeDynamics = _chunkK7W4FSFVjs.removeDynamics; exports.removeEnding = _chunkK7W4FSFVjs.removeEnding; exports.removeFermata = _chunkK7W4FSFVjs.removeFermata; exports.removeFingering = _chunkK7W4FSFVjs.removeFingering; exports.removeGraceNote = _chunkK7W4FSFVjs.removeGraceNote; exports.removeHarmony = _chunkK7W4FSFVjs.removeHarmony; exports.removeLyric = _chunkK7W4FSFVjs.removeLyric; exports.removeNote = _chunkK7W4FSFVjs.removeNote; exports.removeOctaveShift = _chunkK7W4FSFVjs.removeOctaveShift; exports.removeOrnament = _chunkK7W4FSFVjs.removeOrnament; exports.removePart = _chunkK7W4FSFVjs.removePart; exports.removePedal = _chunkK7W4FSFVjs.removePedal; exports.removeRepeat = _chunkK7W4FSFVjs.removeRepeat; exports.removeRepeatBarline = _chunkK7W4FSFVjs.removeRepeatBarline; exports.removeSlur = _chunkK7W4FSFVjs.removeSlur; exports.removeStringNumber = _chunkK7W4FSFVjs.removeStringNumber; exports.removeTempo = _chunkK7W4FSFVjs.removeTempo; exports.removeTie = _chunkK7W4FSFVjs.removeTie; exports.removeTuplet = _chunkK7W4FSFVjs.removeTuplet; exports.removeWedge = _chunkK7W4FSFVjs.removeWedge; exports.scoresEqual = _chunkEWLB5X64js.scoresEqual; exports.serialize = _chunkOWCMKOT4js.serialize; exports.serializeAbc = _chunkOWCMKOT4js.serializeAbc; exports.serializeAbcTunes = _chunkOWCMKOT4js.serializeAbcTunes; exports.serializeCompressed = _chunkOWCMKOT4js.serializeCompressed; exports.setBarline = _chunkK7W4FSFVjs.setBarline; exports.setBeaming = _chunkK7W4FSFVjs.setBeaming; exports.setColor = _chunkK7W4FSFVjs.setColor; exports.setNotePitch = _chunkK7W4FSFVjs.setNotePitch; exports.setNotePitchBySemitone = _chunkK7W4FSFVjs.setNotePitchBySemitone; exports.setStaves = _chunkK7W4FSFVjs.setStaves; exports.shiftNotePitch = _chunkK7W4FSFVjs.shiftNotePitch; exports.stopOctaveShift = _chunkK7W4FSFVjs.stopOctaveShift; exports.transpose = _chunkK7W4FSFVjs.transpose; exports.transposeChecked = _chunkK7W4FSFVjs.transposeChecked; exports.updateChordSymbol = _chunkK7W4FSFVjs.updateChordSymbol; exports.updateHarmony = _chunkK7W4FSFVjs.updateHarmony; exports.updateLyric = _chunkK7W4FSFVjs.updateLyric; exports.validate = _chunkK7W4FSFVjs.validate; exports.validateBackupForward = _chunkK7W4FSFVjs.validateBackupForward; exports.validateBeams = _chunkK7W4FSFVjs.validateBeams; exports.validateDivisions = _chunkK7W4FSFVjs.validateDivisions; exports.validateMeasureDuration = _chunkK7W4FSFVjs.validateMeasureDuration; exports.validateMeasureLocal = _chunkK7W4FSFVjs.validateMeasureLocal; exports.validatePartReferences = _chunkK7W4FSFVjs.validatePartReferences; exports.validatePartStructure = _chunkK7W4FSFVjs.validatePartStructure; exports.validateSlurs = _chunkK7W4FSFVjs.validateSlurs; exports.validateSlursAcrossMeasures = _chunkK7W4FSFVjs.validateSlursAcrossMeasures; exports.validateStaffStructure = _chunkK7W4FSFVjs.validateStaffStructure; exports.validateTies = _chunkK7W4FSFVjs.validateTies; exports.validateTiesAcrossMeasures = _chunkK7W4FSFVjs.validateTiesAcrossMeasures; exports.validateTuplets = _chunkK7W4FSFVjs.validateTuplets; exports.validateVoiceStaff = _chunkK7W4FSFVjs.validateVoiceStaff; exports.withAbsolutePositions = _chunkEWLB5X64js.withAbsolutePositions;
|
|
520
|
+
exports.ALL_COLOR_TARGETS = _chunkK7W4FSFVjs.ALL_COLOR_TARGETS; exports.STEPS = _chunkEWLB5X64js.STEPS; exports.STEP_SEMITONES = _chunkEWLB5X64js.STEP_SEMITONES; exports.ValidationException = _chunkK7W4FSFVjs.ValidationException; exports.addArticulation = _chunkK7W4FSFVjs.addArticulation; exports.addBeam = _chunkK7W4FSFVjs.addBeam; exports.addBowing = _chunkK7W4FSFVjs.addBowing; exports.addBreathMark = _chunkK7W4FSFVjs.addBreathMark; exports.addCaesura = _chunkK7W4FSFVjs.addCaesura; exports.addChord = _chunkK7W4FSFVjs.addChord; exports.addChordNote = _chunkK7W4FSFVjs.addChordNote; exports.addChordNoteChecked = _chunkK7W4FSFVjs.addChordNoteChecked; exports.addChordSymbol = _chunkK7W4FSFVjs.addChordSymbol; exports.addCoda = _chunkK7W4FSFVjs.addCoda; exports.addDaCapo = _chunkK7W4FSFVjs.addDaCapo; exports.addDalSegno = _chunkK7W4FSFVjs.addDalSegno; exports.addDynamics = _chunkK7W4FSFVjs.addDynamics; exports.addEnding = _chunkK7W4FSFVjs.addEnding; exports.addFermata = _chunkK7W4FSFVjs.addFermata; exports.addFine = _chunkK7W4FSFVjs.addFine; exports.addFingering = _chunkK7W4FSFVjs.addFingering; exports.addGraceNote = _chunkK7W4FSFVjs.addGraceNote; exports.addHarmony = _chunkK7W4FSFVjs.addHarmony; exports.addLyric = _chunkK7W4FSFVjs.addLyric; exports.addNote = _chunkK7W4FSFVjs.addNote; exports.addNoteChecked = _chunkK7W4FSFVjs.addNoteChecked; exports.addOctaveShift = _chunkK7W4FSFVjs.addOctaveShift; exports.addOrnament = _chunkK7W4FSFVjs.addOrnament; exports.addPart = _chunkK7W4FSFVjs.addPart; exports.addPedal = _chunkK7W4FSFVjs.addPedal; exports.addRehearsalMark = _chunkK7W4FSFVjs.addRehearsalMark; exports.addRepeat = _chunkK7W4FSFVjs.addRepeat; exports.addRepeatBarline = _chunkK7W4FSFVjs.addRepeatBarline; exports.addSegno = _chunkK7W4FSFVjs.addSegno; exports.addSlur = _chunkK7W4FSFVjs.addSlur; exports.addStringNumber = _chunkK7W4FSFVjs.addStringNumber; exports.addTempo = _chunkK7W4FSFVjs.addTempo; exports.addText = _chunkK7W4FSFVjs.addText; exports.addTextDirection = _chunkK7W4FSFVjs.addTextDirection; exports.addTie = _chunkK7W4FSFVjs.addTie; exports.addToCoda = _chunkK7W4FSFVjs.addToCoda; exports.addVoice = _chunkK7W4FSFVjs.addVoice; exports.addWedge = _chunkK7W4FSFVjs.addWedge; exports.assertMeasureValid = _chunkK7W4FSFVjs.assertMeasureValid; exports.assertValid = _chunkK7W4FSFVjs.assertValid; exports.autoBeam = _chunkK7W4FSFVjs.autoBeam; exports.buildVoiceToStaffMap = _chunkEWLB5X64js.buildVoiceToStaffMap; exports.buildVoiceToStaffMapForPart = _chunkEWLB5X64js.buildVoiceToStaffMapForPart; exports.changeBarline = _chunkK7W4FSFVjs.changeBarline; exports.changeClef = _chunkK7W4FSFVjs.changeClef; exports.changeKey = _chunkK7W4FSFVjs.changeKey; exports.changeNoteDuration = _chunkK7W4FSFVjs.changeNoteDuration; exports.changeTime = _chunkK7W4FSFVjs.changeTime; exports.clearColors = _chunkK7W4FSFVjs.clearColors; exports.convertToGrace = _chunkK7W4FSFVjs.convertToGrace; exports.copyNotes = _chunkK7W4FSFVjs.copyNotes; exports.copyNotesMultiMeasure = _chunkK7W4FSFVjs.copyNotesMultiMeasure; exports.countNotes = _chunkEWLB5X64js.countNotes; exports.createTuplet = _chunkK7W4FSFVjs.createTuplet; exports.cutNotes = _chunkK7W4FSFVjs.cutNotes; exports.deleteMeasure = _chunkK7W4FSFVjs.deleteMeasure; exports.deleteNote = _chunkK7W4FSFVjs.deleteNote; exports.deleteNoteChecked = _chunkK7W4FSFVjs.deleteNoteChecked; exports.duplicatePart = _chunkK7W4FSFVjs.duplicatePart; exports.exportMidi = _chunkO7G4CNSUjs.exportMidi; exports.exportMidiWithTimingMap = _chunkO7G4CNSUjs.exportMidiWithTimingMap; exports.extractPlaybackControls = _chunkEWLB5X64js.extractPlaybackControls; exports.findBarlines = _chunkEWLB5X64js.findBarlines; exports.findDirectionsByType = _chunkEWLB5X64js.findDirectionsByType; exports.findNotes = _chunkEWLB5X64js.findNotes; exports.findNotesWithNotation = _chunkEWLB5X64js.findNotesWithNotation; exports.formatLocation = _chunkK7W4FSFVjs.formatLocation; exports.generateId = _chunkK7W4FSFVjs.generateId; exports.generatePlaybackSequence = _chunkEWLB5X64js.generatePlaybackSequence; exports.generatePlaybackTimeline = _chunkEWLB5X64js.generatePlaybackTimeline; exports.getAbsolutePosition = _chunkEWLB5X64js.getAbsolutePosition; exports.getAdjacentNotes = _chunkEWLB5X64js.getAdjacentNotes; exports.getAllNotes = _chunkEWLB5X64js.getAllNotes; exports.getAllPartInfos = _chunkOEX7NVZNjs.getAllPartInfos; exports.getAttributesAtMeasure = _chunkEWLB5X64js.getAttributesAtMeasure; exports.getBeamGroups = _chunkEWLB5X64js.getBeamGroups; exports.getChordProgression = _chunkEWLB5X64js.getChordProgression; exports.getChords = _chunkEWLB5X64js.getChords; exports.getClefChanges = _chunkEWLB5X64js.getClefChanges; exports.getClefForStaff = _chunkEWLB5X64js.getClefForStaff; exports.getDirectionOfKind = _chunkOEX7NVZNjs.getDirectionOfKind; exports.getDirections = _chunkEWLB5X64js.getDirections; exports.getDirectionsAtPosition = _chunkEWLB5X64js.getDirectionsAtPosition; exports.getDirectionsOfKind = _chunkOEX7NVZNjs.getDirectionsOfKind; exports.getDivisions = _chunkEWLB5X64js.getDivisions; exports.getDuration = _chunkEWLB5X64js.getDuration; exports.getDynamics = _chunkEWLB5X64js.getDynamics; exports.getEffectiveStaff = _chunkEWLB5X64js.getEffectiveStaff; exports.getEndings = _chunkEWLB5X64js.getEndings; exports.getEntriesAtPosition = _chunkEWLB5X64js.getEntriesAtPosition; exports.getEntriesForStaff = _chunkEWLB5X64js.getEntriesForStaff; exports.getEntriesInRange = _chunkEWLB5X64js.getEntriesInRange; exports.getHarmonies = _chunkEWLB5X64js.getHarmonies; exports.getHarmonyAtPosition = _chunkEWLB5X64js.getHarmonyAtPosition; exports.getKeyChanges = _chunkEWLB5X64js.getKeyChanges; exports.getLyricText = _chunkEWLB5X64js.getLyricText; exports.getLyrics = _chunkEWLB5X64js.getLyrics; exports.getMeasure = _chunkEWLB5X64js.getMeasure; exports.getMeasureByIndex = _chunkEWLB5X64js.getMeasureByIndex; exports.getMeasureContext = _chunkK7W4FSFVjs.getMeasureContext; exports.getMeasureCount = _chunkEWLB5X64js.getMeasureCount; exports.getMeasureEndPosition = _chunkEWLB5X64js.getMeasureEndPosition; exports.getNextNote = _chunkEWLB5X64js.getNextNote; exports.getNormalizedDuration = _chunkEWLB5X64js.getNormalizedDuration; exports.getNormalizedPosition = _chunkEWLB5X64js.getNormalizedPosition; exports.getNotesAtPosition = _chunkEWLB5X64js.getNotesAtPosition; exports.getNotesForStaff = _chunkEWLB5X64js.getNotesForStaff; exports.getNotesForVoice = _chunkEWLB5X64js.getNotesForVoice; exports.getNotesInRange = _chunkEWLB5X64js.getNotesInRange; exports.getOctaveShifts = _chunkEWLB5X64js.getOctaveShifts; exports.getPartAbbreviation = _chunkOEX7NVZNjs.getPartAbbreviation; exports.getPartById = _chunkEWLB5X64js.getPartById; exports.getPartByIndex = _chunkEWLB5X64js.getPartByIndex; exports.getPartCount = _chunkEWLB5X64js.getPartCount; exports.getPartIds = _chunkEWLB5X64js.getPartIds; exports.getPartIndex = _chunkEWLB5X64js.getPartIndex; exports.getPartInfo = _chunkOEX7NVZNjs.getPartInfo; exports.getPartName = _chunkOEX7NVZNjs.getPartName; exports.getPartNameMap = _chunkOEX7NVZNjs.getPartNameMap; exports.getPedalMarkings = _chunkEWLB5X64js.getPedalMarkings; exports.getPrevNote = _chunkEWLB5X64js.getPrevNote; exports.getRepeatStructure = _chunkEWLB5X64js.getRepeatStructure; exports.getSlurSpans = _chunkEWLB5X64js.getSlurSpans; exports.getSoundDamperPedal = _chunkOEX7NVZNjs.getSoundDamperPedal; exports.getSoundDynamics = _chunkOEX7NVZNjs.getSoundDynamics; exports.getSoundSoftPedal = _chunkOEX7NVZNjs.getSoundSoftPedal; exports.getSoundSostenutoPedal = _chunkOEX7NVZNjs.getSoundSostenutoPedal; exports.getSoundTempo = _chunkOEX7NVZNjs.getSoundTempo; exports.getStaffRange = _chunkEWLB5X64js.getStaffRange; exports.getStaveCount = _chunkEWLB5X64js.getStaveCount; exports.getStaves = _chunkEWLB5X64js.getStaves; exports.getStructuralChanges = _chunkEWLB5X64js.getStructuralChanges; exports.getTempoMarkings = _chunkEWLB5X64js.getTempoMarkings; exports.getTiedNoteGroups = _chunkEWLB5X64js.getTiedNoteGroups; exports.getTimeChanges = _chunkEWLB5X64js.getTimeChanges; exports.getTupletGroups = _chunkEWLB5X64js.getTupletGroups; exports.getVerseCount = _chunkEWLB5X64js.getVerseCount; exports.getVerticalSlice = _chunkEWLB5X64js.getVerticalSlice; exports.getVoiceLine = _chunkEWLB5X64js.getVoiceLine; exports.getVoiceLineInRange = _chunkEWLB5X64js.getVoiceLineInRange; exports.getVoices = _chunkEWLB5X64js.getVoices; exports.getVoicesForStaff = _chunkEWLB5X64js.getVoicesForStaff; exports.getWedges = _chunkEWLB5X64js.getWedges; exports.groupByStaff = _chunkEWLB5X64js.groupByStaff; exports.groupByVoice = _chunkEWLB5X64js.groupByVoice; exports.hasBeam = _chunkOEX7NVZNjs.hasBeam; exports.hasDirectionOfKind = _chunkOEX7NVZNjs.hasDirectionOfKind; exports.hasLyrics = _chunkOEX7NVZNjs.hasLyrics; exports.hasMultipleStaves = _chunkEWLB5X64js.hasMultipleStaves; exports.hasNotations = _chunkOEX7NVZNjs.hasNotations; exports.hasNotes = _chunkEWLB5X64js.hasNotes; exports.hasPlaybackControls = _chunkEWLB5X64js.hasPlaybackControls; exports.hasTie = _chunkOEX7NVZNjs.hasTie; exports.hasTieStart = _chunkOEX7NVZNjs.hasTieStart; exports.hasTieStop = _chunkOEX7NVZNjs.hasTieStop; exports.hasTuplet = _chunkOEX7NVZNjs.hasTuplet; exports.inferStaff = _chunkEWLB5X64js.inferStaff; exports.insertClefChange = _chunkK7W4FSFVjs.insertClefChange; exports.insertMeasure = _chunkK7W4FSFVjs.insertMeasure; exports.insertNote = _chunkK7W4FSFVjs.insertNote; exports.isChordNote = _chunkOEX7NVZNjs.isChordNote; exports.isCompressed = _chunkO7G4CNSUjs.isCompressed; exports.isCueNote = _chunkOEX7NVZNjs.isCueNote; exports.isGraceNote = _chunkOEX7NVZNjs.isGraceNote; exports.isPartInfo = _chunkOEX7NVZNjs.isPartInfo; exports.isPitchedNote = _chunkOEX7NVZNjs.isPitchedNote; exports.isRest = _chunkOEX7NVZNjs.isRest; exports.isRestMeasure = _chunkEWLB5X64js.isRestMeasure; exports.isUnpitchedNote = _chunkOEX7NVZNjs.isUnpitchedNote; exports.isValid = _chunkK7W4FSFVjs.isValid; exports.iterateEntries = _chunkEWLB5X64js.iterateEntries; exports.iterateNotes = _chunkEWLB5X64js.iterateNotes; exports.lowerAccidental = _chunkK7W4FSFVjs.lowerAccidental; exports.measureRoundtrip = _chunkEWLB5X64js.measureRoundtrip; exports.modifyDynamics = _chunkK7W4FSFVjs.modifyDynamics; exports.modifyNoteDuration = _chunkK7W4FSFVjs.modifyNoteDuration; exports.modifyNoteDurationChecked = _chunkK7W4FSFVjs.modifyNoteDurationChecked; exports.modifyNotePitch = _chunkK7W4FSFVjs.modifyNotePitch; exports.modifyNotePitchChecked = _chunkK7W4FSFVjs.modifyNotePitchChecked; exports.modifyTempo = _chunkK7W4FSFVjs.modifyTempo; exports.moveNoteToStaff = _chunkK7W4FSFVjs.moveNoteToStaff; exports.parse = _chunkO7G4CNSUjs.parse; exports.parseAbc = _chunkO7G4CNSUjs.parseAbc; exports.parseAbcTunes = _chunkO7G4CNSUjs.parseAbcTunes; exports.parseAuto = _chunkO7G4CNSUjs.parseAuto; exports.parseCompressed = _chunkO7G4CNSUjs.parseCompressed; exports.pasteNotes = _chunkK7W4FSFVjs.pasteNotes; exports.pasteNotesMultiMeasure = _chunkK7W4FSFVjs.pasteNotesMultiMeasure; exports.pitchToSemitone = _chunkEWLB5X64js.pitchToSemitone; exports.raiseAccidental = _chunkK7W4FSFVjs.raiseAccidental; exports.removeArticulation = _chunkK7W4FSFVjs.removeArticulation; exports.removeBeam = _chunkK7W4FSFVjs.removeBeam; exports.removeBowing = _chunkK7W4FSFVjs.removeBowing; exports.removeBreathMark = _chunkK7W4FSFVjs.removeBreathMark; exports.removeCaesura = _chunkK7W4FSFVjs.removeCaesura; exports.removeChordSymbol = _chunkK7W4FSFVjs.removeChordSymbol; exports.removeDynamics = _chunkK7W4FSFVjs.removeDynamics; exports.removeEnding = _chunkK7W4FSFVjs.removeEnding; exports.removeFermata = _chunkK7W4FSFVjs.removeFermata; exports.removeFingering = _chunkK7W4FSFVjs.removeFingering; exports.removeGraceNote = _chunkK7W4FSFVjs.removeGraceNote; exports.removeHarmony = _chunkK7W4FSFVjs.removeHarmony; exports.removeLyric = _chunkK7W4FSFVjs.removeLyric; exports.removeNote = _chunkK7W4FSFVjs.removeNote; exports.removeOctaveShift = _chunkK7W4FSFVjs.removeOctaveShift; exports.removeOrnament = _chunkK7W4FSFVjs.removeOrnament; exports.removePart = _chunkK7W4FSFVjs.removePart; exports.removePedal = _chunkK7W4FSFVjs.removePedal; exports.removeRepeat = _chunkK7W4FSFVjs.removeRepeat; exports.removeRepeatBarline = _chunkK7W4FSFVjs.removeRepeatBarline; exports.removeSlur = _chunkK7W4FSFVjs.removeSlur; exports.removeStringNumber = _chunkK7W4FSFVjs.removeStringNumber; exports.removeTempo = _chunkK7W4FSFVjs.removeTempo; exports.removeTie = _chunkK7W4FSFVjs.removeTie; exports.removeTuplet = _chunkK7W4FSFVjs.removeTuplet; exports.removeWedge = _chunkK7W4FSFVjs.removeWedge; exports.scoresEqual = _chunkEWLB5X64js.scoresEqual; exports.serialize = _chunkO7G4CNSUjs.serialize; exports.serializeAbc = _chunkO7G4CNSUjs.serializeAbc; exports.serializeAbcTunes = _chunkO7G4CNSUjs.serializeAbcTunes; exports.serializeCompressed = _chunkO7G4CNSUjs.serializeCompressed; exports.setBarline = _chunkK7W4FSFVjs.setBarline; exports.setBeaming = _chunkK7W4FSFVjs.setBeaming; exports.setColor = _chunkK7W4FSFVjs.setColor; exports.setNotePitch = _chunkK7W4FSFVjs.setNotePitch; exports.setNotePitchBySemitone = _chunkK7W4FSFVjs.setNotePitchBySemitone; exports.setStaves = _chunkK7W4FSFVjs.setStaves; exports.shiftNotePitch = _chunkK7W4FSFVjs.shiftNotePitch; exports.stopOctaveShift = _chunkK7W4FSFVjs.stopOctaveShift; exports.transpose = _chunkK7W4FSFVjs.transpose; exports.transposeChecked = _chunkK7W4FSFVjs.transposeChecked; exports.updateChordSymbol = _chunkK7W4FSFVjs.updateChordSymbol; exports.updateHarmony = _chunkK7W4FSFVjs.updateHarmony; exports.updateLyric = _chunkK7W4FSFVjs.updateLyric; exports.validate = _chunkK7W4FSFVjs.validate; exports.validateBackupForward = _chunkK7W4FSFVjs.validateBackupForward; exports.validateBeams = _chunkK7W4FSFVjs.validateBeams; exports.validateDivisions = _chunkK7W4FSFVjs.validateDivisions; exports.validateMeasureDuration = _chunkK7W4FSFVjs.validateMeasureDuration; exports.validateMeasureLocal = _chunkK7W4FSFVjs.validateMeasureLocal; exports.validatePartReferences = _chunkK7W4FSFVjs.validatePartReferences; exports.validatePartStructure = _chunkK7W4FSFVjs.validatePartStructure; exports.validateSlurs = _chunkK7W4FSFVjs.validateSlurs; exports.validateSlursAcrossMeasures = _chunkK7W4FSFVjs.validateSlursAcrossMeasures; exports.validateStaffStructure = _chunkK7W4FSFVjs.validateStaffStructure; exports.validateTies = _chunkK7W4FSFVjs.validateTies; exports.validateTiesAcrossMeasures = _chunkK7W4FSFVjs.validateTiesAcrossMeasures; exports.validateTuplets = _chunkK7W4FSFVjs.validateTuplets; exports.validateVoiceStaff = _chunkK7W4FSFVjs.validateVoiceStaff; exports.withAbsolutePositions = _chunkEWLB5X64js.withAbsolutePositions;
|
package/dist/browser.mjs
CHANGED
|
@@ -33,6 +33,7 @@ function decodeXmlEntities(s) {
|
|
|
33
33
|
return INVALID_XML_CHARS_TEST.test(decoded) ? decoded.replace(INVALID_XML_CHARS_RE, "") : decoded;
|
|
34
34
|
}
|
|
35
35
|
var EMPTY_ATTRS = Object.freeze({});
|
|
36
|
+
var EMPTY_CHILDREN = Object.freeze([]);
|
|
36
37
|
var GT = 62;
|
|
37
38
|
var SLASH = 47;
|
|
38
39
|
var BANG = 33;
|
|
@@ -57,7 +58,8 @@ function parseXml(xml) {
|
|
|
57
58
|
if (lt > pos) {
|
|
58
59
|
let whitespaceOnly = true;
|
|
59
60
|
for (let i = pos; i < lt; i++) {
|
|
60
|
-
|
|
61
|
+
const ch = xml.charCodeAt(i);
|
|
62
|
+
if (ch !== 32 && ch !== 10 && ch !== 9 && ch !== 13) {
|
|
61
63
|
whitespaceOnly = false;
|
|
62
64
|
break;
|
|
63
65
|
}
|
|
@@ -70,6 +72,16 @@ function parseXml(xml) {
|
|
|
70
72
|
}
|
|
71
73
|
const c = xml.charCodeAt(lt + 1);
|
|
72
74
|
if (c === SLASH) {
|
|
75
|
+
const top = stack.length > 0 ? stack[stack.length - 1] : void 0;
|
|
76
|
+
if (top !== void 0 && xml.startsWith(top.tagName, lt + 2)) {
|
|
77
|
+
const after = lt + 2 + top.tagName.length;
|
|
78
|
+
if (xml.charCodeAt(after) === GT) {
|
|
79
|
+
stack.pop();
|
|
80
|
+
children = stack.length > 0 ? stack[stack.length - 1].children : root;
|
|
81
|
+
pos = after + 1;
|
|
82
|
+
continue;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
73
85
|
const gt = xml.indexOf(">", lt + 2);
|
|
74
86
|
if (gt === -1) break;
|
|
75
87
|
let end = gt;
|
|
@@ -77,7 +89,7 @@ function parseXml(xml) {
|
|
|
77
89
|
const name = xml.slice(lt + 2, end);
|
|
78
90
|
for (let i = stack.length - 1; i >= 0; i--) {
|
|
79
91
|
if (stack[i].tagName === name) {
|
|
80
|
-
stack.length
|
|
92
|
+
while (stack.length > i) stack.pop();
|
|
81
93
|
break;
|
|
82
94
|
}
|
|
83
95
|
}
|
|
@@ -162,9 +174,11 @@ function parseXml(xml) {
|
|
|
162
174
|
attributes[attrName] = "";
|
|
163
175
|
}
|
|
164
176
|
}
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
177
|
+
if (selfClosing) {
|
|
178
|
+
children.push({ tagName, attributes, children: EMPTY_CHILDREN });
|
|
179
|
+
} else {
|
|
180
|
+
const node = { tagName, attributes, children: [] };
|
|
181
|
+
children.push(node);
|
|
168
182
|
stack.push(node);
|
|
169
183
|
children = node.children;
|
|
170
184
|
}
|
|
@@ -190,14 +204,15 @@ function parse(input) {
|
|
|
190
204
|
let xmlString;
|
|
191
205
|
if (typeof input !== "string") {
|
|
192
206
|
xmlString = decodeXmlBytes(input);
|
|
193
|
-
} else if (input.includes("\0")) {
|
|
194
|
-
throw new Error(
|
|
195
|
-
"parse() received a string containing NUL bytes, which indicates a UTF-16 encoded MusicXML file was read without proper encoding detection. Pass a Buffer or Uint8Array instead so the encoding is handled automatically:\n parse(fs.readFileSync(path)) // Node.js\n parse(new Uint8Array(arrayBuffer)) // Browser"
|
|
196
|
-
);
|
|
197
207
|
} else {
|
|
198
208
|
xmlString = input;
|
|
199
209
|
}
|
|
200
210
|
if (INVALID_XML_CHARS_TEST.test(xmlString)) {
|
|
211
|
+
if (typeof input === "string" && input.includes("\0")) {
|
|
212
|
+
throw new Error(
|
|
213
|
+
"parse() received a string containing NUL bytes, which indicates a UTF-16 encoded MusicXML file was read without proper encoding detection. Pass a Buffer or Uint8Array instead so the encoding is handled automatically:\n parse(fs.readFileSync(path)) // Node.js\n parse(new Uint8Array(arrayBuffer)) // Browser"
|
|
214
|
+
);
|
|
215
|
+
}
|
|
201
216
|
xmlString = xmlString.replace(INVALID_XML_CHARS_RE, "");
|
|
202
217
|
}
|
|
203
218
|
const parsed = parseXml(xmlString);
|
|
@@ -4151,6 +4166,12 @@ function buildMeasures(tokens, unitNote, keySignature, timeSignature, measureDur
|
|
|
4151
4166
|
let pendingTimeChange = null;
|
|
4152
4167
|
const lineBreaks = [];
|
|
4153
4168
|
let pendingMultipleRest = null;
|
|
4169
|
+
let beamBreak = false;
|
|
4170
|
+
const beamBreakBefore = /* @__PURE__ */ new WeakSet();
|
|
4171
|
+
function markBeamBreak(entry) {
|
|
4172
|
+
if (beamBreak) beamBreakBefore.add(entry);
|
|
4173
|
+
beamBreak = false;
|
|
4174
|
+
}
|
|
4154
4175
|
function flushPendingPreNoteItems() {
|
|
4155
4176
|
for (const item of pendingPreNoteItems) {
|
|
4156
4177
|
currentEntries.push(item);
|
|
@@ -4169,6 +4190,7 @@ function buildMeasures(tokens, unitNote, keySignature, timeSignature, measureDur
|
|
|
4169
4190
|
number: String(measureNumber),
|
|
4170
4191
|
entries: currentEntries
|
|
4171
4192
|
};
|
|
4193
|
+
assignAbcBeams(currentEntries, beamBreakBefore);
|
|
4172
4194
|
if (isFirstMeasure) {
|
|
4173
4195
|
measure.attributes = {
|
|
4174
4196
|
_id: _chunkK7W4FSFVjs.generateId.call(void 0, ),
|
|
@@ -4276,6 +4298,7 @@ function buildMeasures(tokens, unitNote, keySignature, timeSignature, measureDur
|
|
|
4276
4298
|
noteCountForLyrics++;
|
|
4277
4299
|
}
|
|
4278
4300
|
if (!inGrace) {
|
|
4301
|
+
markBeamBreak(entry);
|
|
4279
4302
|
currentEntries.push(entry);
|
|
4280
4303
|
currentPosition += entry.duration;
|
|
4281
4304
|
if (tupletState) {
|
|
@@ -4364,6 +4387,7 @@ function buildMeasures(tokens, unitNote, keySignature, timeSignature, measureDur
|
|
|
4364
4387
|
if (!entry.notations) entry.notations = [];
|
|
4365
4388
|
entry.notations.push({ type: "tied", tiedType: "start" });
|
|
4366
4389
|
}
|
|
4390
|
+
if (ci === 0 && !inGrace) markBeamBreak(entry);
|
|
4367
4391
|
currentEntries.push(entry);
|
|
4368
4392
|
if (ci === 0) {
|
|
4369
4393
|
currentPosition += entry.duration;
|
|
@@ -4493,6 +4517,7 @@ function buildMeasures(tokens, unitNote, keySignature, timeSignature, measureDur
|
|
|
4493
4517
|
}
|
|
4494
4518
|
}
|
|
4495
4519
|
pendingBrokenRhythm = token.value;
|
|
4520
|
+
beamBreak = false;
|
|
4496
4521
|
break;
|
|
4497
4522
|
}
|
|
4498
4523
|
case "tuplet":
|
|
@@ -4588,8 +4613,10 @@ function buildMeasures(tokens, unitNote, keySignature, timeSignature, measureDur
|
|
|
4588
4613
|
break;
|
|
4589
4614
|
}
|
|
4590
4615
|
case "space":
|
|
4616
|
+
if (!pendingBrokenRhythm) beamBreak = true;
|
|
4591
4617
|
break;
|
|
4592
4618
|
case "line_break": {
|
|
4619
|
+
beamBreak = true;
|
|
4593
4620
|
flushPendingPreNoteItems();
|
|
4594
4621
|
if (currentEntries.length > 0) {
|
|
4595
4622
|
const breakText = token.value === "\\\n" ? "__abc_line_cont__" : "__abc_line_break__";
|
|
@@ -4651,6 +4678,65 @@ function applyLyricsToNotes(targetNotes, syllables, verse) {
|
|
|
4651
4678
|
note.lyrics.push({ number: verse, text, syllabic });
|
|
4652
4679
|
}
|
|
4653
4680
|
}
|
|
4681
|
+
var BEAM_LEVELS = {
|
|
4682
|
+
eighth: 1,
|
|
4683
|
+
"16th": 2,
|
|
4684
|
+
"32nd": 3,
|
|
4685
|
+
"64th": 4,
|
|
4686
|
+
"128th": 5,
|
|
4687
|
+
"256th": 6,
|
|
4688
|
+
"512th": 7,
|
|
4689
|
+
"1024th": 8
|
|
4690
|
+
};
|
|
4691
|
+
function assignAbcBeams(entries, breakBefore) {
|
|
4692
|
+
const groups = [];
|
|
4693
|
+
let group = [];
|
|
4694
|
+
const close = () => {
|
|
4695
|
+
if (group.length >= 2) groups.push(group);
|
|
4696
|
+
group = [];
|
|
4697
|
+
};
|
|
4698
|
+
for (const e of entries) {
|
|
4699
|
+
if (e.type === "backup" || e.type === "forward") {
|
|
4700
|
+
close();
|
|
4701
|
+
continue;
|
|
4702
|
+
}
|
|
4703
|
+
if (e.type !== "note" || e.grace || e.chord) continue;
|
|
4704
|
+
const level = e.rest || !e.noteType ? 0 : _nullishCoalesce(BEAM_LEVELS[e.noteType], () => ( 0));
|
|
4705
|
+
if (level === 0) {
|
|
4706
|
+
close();
|
|
4707
|
+
continue;
|
|
4708
|
+
}
|
|
4709
|
+
if (breakBefore.has(e)) close();
|
|
4710
|
+
group.push(e);
|
|
4711
|
+
}
|
|
4712
|
+
close();
|
|
4713
|
+
for (const g of groups) {
|
|
4714
|
+
const levels = g.map((n) => BEAM_LEVELS[n.noteType]);
|
|
4715
|
+
const beams = g.map(() => []);
|
|
4716
|
+
const maxLevel = Math.max(...levels);
|
|
4717
|
+
for (let lv = 1; lv <= maxLevel; lv++) {
|
|
4718
|
+
for (let i = 0; i < g.length; ) {
|
|
4719
|
+
if (levels[i] < lv) {
|
|
4720
|
+
i++;
|
|
4721
|
+
continue;
|
|
4722
|
+
}
|
|
4723
|
+
let j = i;
|
|
4724
|
+
while (j + 1 < g.length && levels[j + 1] >= lv) j++;
|
|
4725
|
+
if (i === j) {
|
|
4726
|
+
beams[i].push({ number: lv, type: i === g.length - 1 ? "backward hook" : "forward hook" });
|
|
4727
|
+
} else {
|
|
4728
|
+
for (let k = i; k <= j; k++) {
|
|
4729
|
+
beams[k].push({ number: lv, type: k === i ? "begin" : k === j ? "end" : "continue" });
|
|
4730
|
+
}
|
|
4731
|
+
}
|
|
4732
|
+
i = j + 1;
|
|
4733
|
+
}
|
|
4734
|
+
}
|
|
4735
|
+
g.forEach((n, i) => {
|
|
4736
|
+
n.beam = beams[i];
|
|
4737
|
+
});
|
|
4738
|
+
}
|
|
4739
|
+
}
|
|
4654
4740
|
function applyTieStops(measures) {
|
|
4655
4741
|
const allNotes = [];
|
|
4656
4742
|
for (const measure of measures) {
|
|
@@ -4693,7 +4779,7 @@ function createNoteEntry(token, unitNote, _hasTieStop, isGrace, tupletState, gra
|
|
|
4693
4779
|
duration = Math.round(duration * tupletState.q / tupletState.p);
|
|
4694
4780
|
}
|
|
4695
4781
|
}
|
|
4696
|
-
const { noteType, dots } = durationToNoteType(
|
|
4782
|
+
const { noteType, dots } = durationToNoteType(lengthToDuration(num, den, unitNote));
|
|
4697
4783
|
const pitch = token.pitch && octaveShift !== 0 ? { ...token.pitch, octave: token.pitch.octave + octaveShift } : token.pitch;
|
|
4698
4784
|
const entry = {
|
|
4699
4785
|
_id: _chunkK7W4FSFVjs.generateId.call(void 0, ),
|
|
@@ -4753,7 +4839,7 @@ function createRestEntry(token, unitNote, tupletState, measureDuration) {
|
|
|
4753
4839
|
duration = Math.round(duration * tupletState.q / tupletState.p);
|
|
4754
4840
|
}
|
|
4755
4841
|
}
|
|
4756
|
-
const { noteType, dots } = durationToNoteType(duration);
|
|
4842
|
+
const { noteType, dots } = durationToNoteType(isWholeMeasure ? duration : lengthToDuration(num, den, unitNote));
|
|
4757
4843
|
const entry = {
|
|
4758
4844
|
_id: _chunkK7W4FSFVjs.generateId.call(void 0, ),
|
|
4759
4845
|
type: "note",
|
|
@@ -5720,18 +5806,13 @@ function serializeEntry(entry, indent, out) {
|
|
|
5720
5806
|
}
|
|
5721
5807
|
}
|
|
5722
5808
|
function serializeNote(note, indent, out) {
|
|
5723
|
-
|
|
5724
|
-
|
|
5725
|
-
|
|
5726
|
-
|
|
5727
|
-
|
|
5728
|
-
|
|
5729
|
-
|
|
5730
|
-
"print-object": note.printObject === false ? false : void 0,
|
|
5731
|
-
"print-dot": note.printDot !== void 0 ? note.printDot : void 0,
|
|
5732
|
-
"print-spacing": note.printSpacing,
|
|
5733
|
-
"color": note.color
|
|
5734
|
-
});
|
|
5809
|
+
let noteAttrs = note._id !== void 0 ? ` id="${escapeXml(note._id)}"` : "";
|
|
5810
|
+
noteAttrs += positionAttrs(note);
|
|
5811
|
+
if (note.dynamics !== void 0) noteAttrs += ` dynamics="${note.dynamics}"`;
|
|
5812
|
+
if (note.printObject === false) noteAttrs += ' print-object="no"';
|
|
5813
|
+
if (note.printDot !== void 0) noteAttrs += ` print-dot="${note.printDot ? "yes" : "no"}"`;
|
|
5814
|
+
if (note.printSpacing !== void 0) noteAttrs += ` print-spacing="${note.printSpacing ? "yes" : "no"}"`;
|
|
5815
|
+
noteAttrs += colorAttr(note.color);
|
|
5735
5816
|
out.push(`${indent}<note${noteAttrs}>`);
|
|
5736
5817
|
if (note.grace) {
|
|
5737
5818
|
const graceAttrs = buildAttrs({
|
|
@@ -5794,10 +5875,7 @@ function serializeNote(note, indent, out) {
|
|
|
5794
5875
|
out.push(`${indent} <voice>${note.voice}</voice>`);
|
|
5795
5876
|
}
|
|
5796
5877
|
if (note.noteType) {
|
|
5797
|
-
const typeAttrs =
|
|
5798
|
-
"size": note.noteTypeSize,
|
|
5799
|
-
"color": note.noteTypeColor
|
|
5800
|
-
});
|
|
5878
|
+
const typeAttrs = (note.noteTypeSize !== void 0 ? ` size="${escapeXml(note.noteTypeSize)}"` : "") + colorAttr(note.noteTypeColor);
|
|
5801
5879
|
out.push(`${indent} <type${typeAttrs}>${note.noteType}</type>`);
|
|
5802
5880
|
}
|
|
5803
5881
|
if (note.dots) {
|
|
@@ -5837,19 +5915,13 @@ function serializeNote(note, indent, out) {
|
|
|
5837
5915
|
out.push(`${indent} </time-modification>`);
|
|
5838
5916
|
}
|
|
5839
5917
|
if (note.stem) {
|
|
5840
|
-
const stemAttrs =
|
|
5841
|
-
"default-x": note.stem.defaultX,
|
|
5842
|
-
"default-y": note.stem.defaultY,
|
|
5843
|
-
"color": note.stem.color
|
|
5844
|
-
});
|
|
5918
|
+
const stemAttrs = positionAttrs(note.stem) + colorAttr(note.stem.color);
|
|
5845
5919
|
out.push(`${indent} <stem${stemAttrs}>${note.stem.value}</stem>`);
|
|
5846
5920
|
}
|
|
5847
5921
|
if (note.notehead) {
|
|
5848
|
-
|
|
5849
|
-
|
|
5850
|
-
|
|
5851
|
-
"color": note.notehead.color
|
|
5852
|
-
});
|
|
5922
|
+
let nhAttrs = note.notehead.filled !== void 0 ? ` filled="${note.notehead.filled ? "yes" : "no"}"` : "";
|
|
5923
|
+
if (note.notehead.parentheses) nhAttrs += ' parentheses="yes"';
|
|
5924
|
+
nhAttrs += colorAttr(note.notehead.color);
|
|
5853
5925
|
out.push(`${indent} <notehead${nhAttrs}>${note.notehead.value}</notehead>`);
|
|
5854
5926
|
}
|
|
5855
5927
|
if (note.staff !== void 0) {
|
|
@@ -6579,22 +6651,22 @@ function colorAttr(color) {
|
|
|
6579
6651
|
return color ? ` color="${escapeXml(color)}"` : "";
|
|
6580
6652
|
}
|
|
6581
6653
|
function positionAttrs(p) {
|
|
6582
|
-
|
|
6583
|
-
|
|
6584
|
-
|
|
6585
|
-
|
|
6586
|
-
|
|
6587
|
-
|
|
6654
|
+
let result = "";
|
|
6655
|
+
if (p.defaultX !== void 0) result += ` default-x="${p.defaultX}"`;
|
|
6656
|
+
if (p.defaultY !== void 0) result += ` default-y="${p.defaultY}"`;
|
|
6657
|
+
if (p.relativeX !== void 0) result += ` relative-x="${p.relativeX}"`;
|
|
6658
|
+
if (p.relativeY !== void 0) result += ` relative-y="${p.relativeY}"`;
|
|
6659
|
+
return result;
|
|
6588
6660
|
}
|
|
6589
6661
|
function bezierAttrs(b) {
|
|
6590
|
-
|
|
6591
|
-
|
|
6592
|
-
|
|
6593
|
-
|
|
6594
|
-
|
|
6595
|
-
|
|
6596
|
-
|
|
6597
|
-
|
|
6662
|
+
let result = "";
|
|
6663
|
+
if (b.bezierX !== void 0) result += ` bezier-x="${b.bezierX}"`;
|
|
6664
|
+
if (b.bezierY !== void 0) result += ` bezier-y="${b.bezierY}"`;
|
|
6665
|
+
if (b.bezierX2 !== void 0) result += ` bezier-x2="${b.bezierX2}"`;
|
|
6666
|
+
if (b.bezierY2 !== void 0) result += ` bezier-y2="${b.bezierY2}"`;
|
|
6667
|
+
if (b.bezierOffset !== void 0) result += ` bezier-offset="${b.bezierOffset}"`;
|
|
6668
|
+
if (b.bezierOffset2 !== void 0) result += ` bezier-offset2="${b.bezierOffset2}"`;
|
|
6669
|
+
return result;
|
|
6598
6670
|
}
|
|
6599
6671
|
function buildAttrs(attrs) {
|
|
6600
6672
|
let result = "";
|
|
@@ -8109,8 +8181,22 @@ function serializeMeasureEntries(measure, divisions, unitNote, opts) {
|
|
|
8109
8181
|
let inChord = false;
|
|
8110
8182
|
let chordHasIndividualDurations = false;
|
|
8111
8183
|
let tupletRemaining = 0;
|
|
8184
|
+
let prev = null;
|
|
8185
|
+
let prevEnd = 0;
|
|
8186
|
+
const flushChord = () => {
|
|
8187
|
+
parts.push("[" + chordPitches.join("") + "]" + chordDurationStr + chordTieStr + chordSlurEnd);
|
|
8188
|
+
if (prevEnd === -1) prevEnd = parts.length;
|
|
8189
|
+
inChord = false;
|
|
8190
|
+
chordHasIndividualDurations = false;
|
|
8191
|
+
chordPitches = [];
|
|
8192
|
+
chordDurationStr = "";
|
|
8193
|
+
chordTieStr = "";
|
|
8194
|
+
chordSlurStart = "";
|
|
8195
|
+
chordSlurEnd = "";
|
|
8196
|
+
};
|
|
8112
8197
|
for (let ei = 0; ei < measure.entries.length; ei++) {
|
|
8113
8198
|
const entry = measure.entries[ei];
|
|
8199
|
+
if (inChord && !(entry.type === "note" && entry.chord && !entry.grace)) flushChord();
|
|
8114
8200
|
switch (entry.type) {
|
|
8115
8201
|
case "note": {
|
|
8116
8202
|
const note = entry;
|
|
@@ -8157,16 +8243,8 @@ function serializeMeasureEntries(measure, divisions, unitNote, opts) {
|
|
|
8157
8243
|
chordPitches.push(chordNoteStr);
|
|
8158
8244
|
break;
|
|
8159
8245
|
}
|
|
8160
|
-
if (
|
|
8161
|
-
|
|
8162
|
-
inChord = false;
|
|
8163
|
-
chordHasIndividualDurations = false;
|
|
8164
|
-
chordPitches = [];
|
|
8165
|
-
chordDurationStr = "";
|
|
8166
|
-
chordTieStr = "";
|
|
8167
|
-
chordSlurStart = "";
|
|
8168
|
-
chordSlurEnd = "";
|
|
8169
|
-
}
|
|
8246
|
+
if (prev && breaksBeam(prev, note)) parts.splice(prevEnd, 0, " ");
|
|
8247
|
+
prev = note;
|
|
8170
8248
|
if (note.lyrics && note.lyrics.length > 0 && opts.includeLyrics) {
|
|
8171
8249
|
for (const lyric of note.lyrics) {
|
|
8172
8250
|
if (!lyric.text) continue;
|
|
@@ -8258,10 +8336,12 @@ function serializeMeasureEntries(measure, divisions, unitNote, opts) {
|
|
|
8258
8336
|
if (insertIdx < parts.length) {
|
|
8259
8337
|
parts.splice(insertIdx, 0, chordSlurStart);
|
|
8260
8338
|
parts.push(tupletPrefix + effectiveSerialized.decorations);
|
|
8339
|
+
prevEnd = -1;
|
|
8261
8340
|
break;
|
|
8262
8341
|
}
|
|
8263
8342
|
}
|
|
8264
8343
|
parts.push(tupletPrefix + chordSlurStart + effectiveSerialized.decorations);
|
|
8344
|
+
prevEnd = -1;
|
|
8265
8345
|
break;
|
|
8266
8346
|
}
|
|
8267
8347
|
if (effectiveSerialized.slurStart) {
|
|
@@ -8278,6 +8358,7 @@ function serializeMeasureEntries(measure, divisions, unitNote, opts) {
|
|
|
8278
8358
|
parts.splice(insertIdx, 0, effectiveSerialized.slurStart);
|
|
8279
8359
|
const noteOnly = effectiveSerialized.decorations + effectiveSerialized.pitch + effectiveSerialized.duration + effectiveSerialized.tieStr + effectiveSerialized.slurEnd;
|
|
8280
8360
|
parts.push(tupletPrefix + noteOnly);
|
|
8361
|
+
prevEnd = parts.length;
|
|
8281
8362
|
break;
|
|
8282
8363
|
}
|
|
8283
8364
|
}
|
|
@@ -8301,9 +8382,12 @@ function serializeMeasureEntries(measure, divisions, unitNote, opts) {
|
|
|
8301
8382
|
}
|
|
8302
8383
|
parts.push(pitchStr2 + baseDurStr1 + tieStr2 + slurEnd2 + slurE1);
|
|
8303
8384
|
ei = brokenResult.nextIndex;
|
|
8385
|
+
prev = note2;
|
|
8386
|
+
prevEnd = parts.length;
|
|
8304
8387
|
break;
|
|
8305
8388
|
}
|
|
8306
8389
|
parts.push(tupletPrefix + effectiveSerialized.full);
|
|
8390
|
+
prevEnd = parts.length;
|
|
8307
8391
|
break;
|
|
8308
8392
|
}
|
|
8309
8393
|
case "harmony": {
|
|
@@ -8318,16 +8402,19 @@ function serializeMeasureEntries(measure, divisions, unitNote, opts) {
|
|
|
8318
8402
|
if (dt.kind !== "words") continue;
|
|
8319
8403
|
if (dt.text === "__abc_line_cont__") {
|
|
8320
8404
|
parts.push("\\\n");
|
|
8405
|
+
prev = null;
|
|
8321
8406
|
handledAsSpecial = true;
|
|
8322
8407
|
break;
|
|
8323
8408
|
}
|
|
8324
8409
|
if (dt.text === "__abc_line_break__") {
|
|
8325
8410
|
parts.push("\n");
|
|
8411
|
+
prev = null;
|
|
8326
8412
|
handledAsSpecial = true;
|
|
8327
8413
|
break;
|
|
8328
8414
|
}
|
|
8329
8415
|
if (dt.text.startsWith(ABC_BODY_FIELD_MARKER)) {
|
|
8330
8416
|
parts.push("\n" + dt.text.slice(ABC_BODY_FIELD_MARKER.length));
|
|
8417
|
+
prev = null;
|
|
8331
8418
|
handledAsSpecial = true;
|
|
8332
8419
|
break;
|
|
8333
8420
|
}
|
|
@@ -8355,21 +8442,32 @@ function serializeMeasureEntries(measure, divisions, unitNote, opts) {
|
|
|
8355
8442
|
}
|
|
8356
8443
|
case "backup":
|
|
8357
8444
|
parts.push(" & ");
|
|
8445
|
+
prev = null;
|
|
8358
8446
|
break;
|
|
8359
8447
|
case "forward":
|
|
8448
|
+
prev = null;
|
|
8360
8449
|
break;
|
|
8361
8450
|
default:
|
|
8362
8451
|
break;
|
|
8363
8452
|
}
|
|
8364
8453
|
}
|
|
8365
|
-
if (inChord && chordPitches.length > 0)
|
|
8366
|
-
parts.push("[" + chordPitches.join("") + "]" + chordDurationStr + chordTieStr + chordSlurEnd);
|
|
8367
|
-
}
|
|
8454
|
+
if (inChord && chordPitches.length > 0) flushChord();
|
|
8368
8455
|
const unitNoteChanged = currentUnitNote.num !== unitNote.num || currentUnitNote.den !== unitNote.den;
|
|
8369
8456
|
return { noteStr: parts.join(""), lyrics, updatedUnitNote: unitNoteChanged ? currentUnitNote : void 0 };
|
|
8370
8457
|
}
|
|
8458
|
+
var BEAMABLE_TYPES = /* @__PURE__ */ new Set(["eighth", "16th", "32nd", "64th", "128th", "256th", "512th", "1024th"]);
|
|
8459
|
+
function breaksBeam(prev, cur) {
|
|
8460
|
+
if (prev.rest || cur.rest) return false;
|
|
8461
|
+
const beamable = (n) => n.noteType !== void 0 && BEAMABLE_TYPES.has(n.noteType);
|
|
8462
|
+
const p = _optionalChain([prev, 'access', _292 => _292.beam, 'optionalAccess', _293 => _293.find, 'call', _294 => _294((b) => b.number === 1), 'optionalAccess', _295 => _295.type]);
|
|
8463
|
+
const c = _optionalChain([cur, 'access', _296 => _296.beam, 'optionalAccess', _297 => _297.find, 'call', _298 => _298((b) => b.number === 1), 'optionalAccess', _299 => _299.type]);
|
|
8464
|
+
if (beamable(prev) && beamable(cur)) {
|
|
8465
|
+
return !(p === "begin" || p === "continue" || c === "continue" || c === "end");
|
|
8466
|
+
}
|
|
8467
|
+
return p !== void 0 || c !== void 0;
|
|
8468
|
+
}
|
|
8371
8469
|
function multipleRestCount(measure) {
|
|
8372
|
-
const styles = _optionalChain([measure, 'access',
|
|
8470
|
+
const styles = _optionalChain([measure, 'access', _300 => _300.attributes, 'optionalAccess', _301 => _301.measureStyle]);
|
|
8373
8471
|
if (!styles) return 0;
|
|
8374
8472
|
for (const style of styles) {
|
|
8375
8473
|
if (style.multipleRest && style.multipleRest > 1) return style.multipleRest;
|
|
@@ -8434,14 +8532,14 @@ function detectChordPerNoteTies(entries, startIdx) {
|
|
|
8434
8532
|
let totalCount = 1;
|
|
8435
8533
|
const firstNote = entries[startIdx];
|
|
8436
8534
|
if (firstNote.type === "note") {
|
|
8437
|
-
const hasTieStart2 = _optionalChain([firstNote, 'access',
|
|
8535
|
+
const hasTieStart2 = _optionalChain([firstNote, 'access', _302 => _302.tie, 'optionalAccess', _303 => _303.type]) === "start" || _optionalChain([firstNote, 'access', _304 => _304.ties, 'optionalAccess', _305 => _305.some, 'call', _306 => _306((t) => t.type === "start")]);
|
|
8438
8536
|
if (hasTieStart2) tiedCount++;
|
|
8439
8537
|
}
|
|
8440
8538
|
for (let i = startIdx + 1; i < entries.length; i++) {
|
|
8441
8539
|
const e = entries[i];
|
|
8442
8540
|
if (e.type !== "note" || !e.chord) break;
|
|
8443
8541
|
totalCount++;
|
|
8444
|
-
const hasTieStart2 = _optionalChain([e, 'access',
|
|
8542
|
+
const hasTieStart2 = _optionalChain([e, 'access', _307 => _307.tie, 'optionalAccess', _308 => _308.type]) === "start" || _optionalChain([e, 'access', _309 => _309.ties, 'optionalAccess', _310 => _310.some, 'call', _311 => _311((t) => t.type === "start")]);
|
|
8445
8543
|
if (hasTieStart2) tiedCount++;
|
|
8446
8544
|
}
|
|
8447
8545
|
return tiedCount > 1 || tiedCount > 0 && totalCount > 1;
|
|
@@ -8474,17 +8572,17 @@ function serializeNote2(note, divisions, unitNote, _inChord) {
|
|
|
8474
8572
|
}
|
|
8475
8573
|
} else if (note.grace) {
|
|
8476
8574
|
if (note.pitch) {
|
|
8477
|
-
pitchStr = serializePitch2(note.pitch, _optionalChain([note, 'access',
|
|
8575
|
+
pitchStr = serializePitch2(note.pitch, _optionalChain([note, 'access', _312 => _312.accidental, 'optionalAccess', _313 => _313.value]) === "natural");
|
|
8478
8576
|
}
|
|
8479
8577
|
durationStr = "";
|
|
8480
8578
|
} else if (note.pitch) {
|
|
8481
|
-
pitchStr = serializePitch2(note.pitch, _optionalChain([note, 'access',
|
|
8579
|
+
pitchStr = serializePitch2(note.pitch, _optionalChain([note, 'access', _314 => _314.accidental, 'optionalAccess', _315 => _315.value]) === "natural");
|
|
8482
8580
|
const effectiveDuration = note.duration;
|
|
8483
8581
|
const { num, den } = durationToAbcFraction(effectiveDuration, divisions, unitNote);
|
|
8484
8582
|
durationStr = formatAbcDuration(num, den);
|
|
8485
8583
|
}
|
|
8486
8584
|
let tieStr = "";
|
|
8487
|
-
if (_optionalChain([note, 'access',
|
|
8585
|
+
if (_optionalChain([note, 'access', _316 => _316.tie, 'optionalAccess', _317 => _317.type]) === "start" || _optionalChain([note, 'access', _318 => _318.ties, 'optionalAccess', _319 => _319.some, 'call', _320 => _320((t) => t.type === "start")])) {
|
|
8488
8586
|
tieStr = "-";
|
|
8489
8587
|
}
|
|
8490
8588
|
let slurStart = "";
|
|
@@ -8502,8 +8600,8 @@ function serializeNote2(note, divisions, unitNote, _inChord) {
|
|
|
8502
8600
|
return { full, pitch: pitchStr, duration: durationStr, slurStart, slurEnd, tieStr, decorations };
|
|
8503
8601
|
}
|
|
8504
8602
|
function serializeBarline2(barline) {
|
|
8505
|
-
const hasRepeatForward = _optionalChain([barline, 'access',
|
|
8506
|
-
const hasRepeatBackward = _optionalChain([barline, 'access',
|
|
8603
|
+
const hasRepeatForward = _optionalChain([barline, 'access', _321 => _321.repeat, 'optionalAccess', _322 => _322.direction]) === "forward";
|
|
8604
|
+
const hasRepeatBackward = _optionalChain([barline, 'access', _323 => _323.repeat, 'optionalAccess', _324 => _324.direction]) === "backward";
|
|
8507
8605
|
const hasEnding = barline.ending;
|
|
8508
8606
|
let result = "";
|
|
8509
8607
|
if (hasRepeatForward) {
|
|
@@ -33,6 +33,7 @@ function decodeXmlEntities(s) {
|
|
|
33
33
|
return INVALID_XML_CHARS_TEST.test(decoded) ? decoded.replace(INVALID_XML_CHARS_RE, "") : decoded;
|
|
34
34
|
}
|
|
35
35
|
var EMPTY_ATTRS = Object.freeze({});
|
|
36
|
+
var EMPTY_CHILDREN = Object.freeze([]);
|
|
36
37
|
var GT = 62;
|
|
37
38
|
var SLASH = 47;
|
|
38
39
|
var BANG = 33;
|
|
@@ -57,7 +58,8 @@ function parseXml(xml) {
|
|
|
57
58
|
if (lt > pos) {
|
|
58
59
|
let whitespaceOnly = true;
|
|
59
60
|
for (let i = pos; i < lt; i++) {
|
|
60
|
-
|
|
61
|
+
const ch = xml.charCodeAt(i);
|
|
62
|
+
if (ch !== 32 && ch !== 10 && ch !== 9 && ch !== 13) {
|
|
61
63
|
whitespaceOnly = false;
|
|
62
64
|
break;
|
|
63
65
|
}
|
|
@@ -70,6 +72,16 @@ function parseXml(xml) {
|
|
|
70
72
|
}
|
|
71
73
|
const c = xml.charCodeAt(lt + 1);
|
|
72
74
|
if (c === SLASH) {
|
|
75
|
+
const top = stack.length > 0 ? stack[stack.length - 1] : void 0;
|
|
76
|
+
if (top !== void 0 && xml.startsWith(top.tagName, lt + 2)) {
|
|
77
|
+
const after = lt + 2 + top.tagName.length;
|
|
78
|
+
if (xml.charCodeAt(after) === GT) {
|
|
79
|
+
stack.pop();
|
|
80
|
+
children = stack.length > 0 ? stack[stack.length - 1].children : root;
|
|
81
|
+
pos = after + 1;
|
|
82
|
+
continue;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
73
85
|
const gt = xml.indexOf(">", lt + 2);
|
|
74
86
|
if (gt === -1) break;
|
|
75
87
|
let end = gt;
|
|
@@ -77,7 +89,7 @@ function parseXml(xml) {
|
|
|
77
89
|
const name = xml.slice(lt + 2, end);
|
|
78
90
|
for (let i = stack.length - 1; i >= 0; i--) {
|
|
79
91
|
if (stack[i].tagName === name) {
|
|
80
|
-
stack.length
|
|
92
|
+
while (stack.length > i) stack.pop();
|
|
81
93
|
break;
|
|
82
94
|
}
|
|
83
95
|
}
|
|
@@ -162,9 +174,11 @@ function parseXml(xml) {
|
|
|
162
174
|
attributes[attrName] = "";
|
|
163
175
|
}
|
|
164
176
|
}
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
177
|
+
if (selfClosing) {
|
|
178
|
+
children.push({ tagName, attributes, children: EMPTY_CHILDREN });
|
|
179
|
+
} else {
|
|
180
|
+
const node = { tagName, attributes, children: [] };
|
|
181
|
+
children.push(node);
|
|
168
182
|
stack.push(node);
|
|
169
183
|
children = node.children;
|
|
170
184
|
}
|
|
@@ -190,14 +204,15 @@ function parse(input) {
|
|
|
190
204
|
let xmlString;
|
|
191
205
|
if (typeof input !== "string") {
|
|
192
206
|
xmlString = decodeXmlBytes(input);
|
|
193
|
-
} else if (input.includes("\0")) {
|
|
194
|
-
throw new Error(
|
|
195
|
-
"parse() received a string containing NUL bytes, which indicates a UTF-16 encoded MusicXML file was read without proper encoding detection. Pass a Buffer or Uint8Array instead so the encoding is handled automatically:\n parse(fs.readFileSync(path)) // Node.js\n parse(new Uint8Array(arrayBuffer)) // Browser"
|
|
196
|
-
);
|
|
197
207
|
} else {
|
|
198
208
|
xmlString = input;
|
|
199
209
|
}
|
|
200
210
|
if (INVALID_XML_CHARS_TEST.test(xmlString)) {
|
|
211
|
+
if (typeof input === "string" && input.includes("\0")) {
|
|
212
|
+
throw new Error(
|
|
213
|
+
"parse() received a string containing NUL bytes, which indicates a UTF-16 encoded MusicXML file was read without proper encoding detection. Pass a Buffer or Uint8Array instead so the encoding is handled automatically:\n parse(fs.readFileSync(path)) // Node.js\n parse(new Uint8Array(arrayBuffer)) // Browser"
|
|
214
|
+
);
|
|
215
|
+
}
|
|
201
216
|
xmlString = xmlString.replace(INVALID_XML_CHARS_RE, "");
|
|
202
217
|
}
|
|
203
218
|
const parsed = parseXml(xmlString);
|
|
@@ -4151,6 +4166,12 @@ function buildMeasures(tokens, unitNote, keySignature, timeSignature, measureDur
|
|
|
4151
4166
|
let pendingTimeChange = null;
|
|
4152
4167
|
const lineBreaks = [];
|
|
4153
4168
|
let pendingMultipleRest = null;
|
|
4169
|
+
let beamBreak = false;
|
|
4170
|
+
const beamBreakBefore = /* @__PURE__ */ new WeakSet();
|
|
4171
|
+
function markBeamBreak(entry) {
|
|
4172
|
+
if (beamBreak) beamBreakBefore.add(entry);
|
|
4173
|
+
beamBreak = false;
|
|
4174
|
+
}
|
|
4154
4175
|
function flushPendingPreNoteItems() {
|
|
4155
4176
|
for (const item of pendingPreNoteItems) {
|
|
4156
4177
|
currentEntries.push(item);
|
|
@@ -4169,6 +4190,7 @@ function buildMeasures(tokens, unitNote, keySignature, timeSignature, measureDur
|
|
|
4169
4190
|
number: String(measureNumber),
|
|
4170
4191
|
entries: currentEntries
|
|
4171
4192
|
};
|
|
4193
|
+
assignAbcBeams(currentEntries, beamBreakBefore);
|
|
4172
4194
|
if (isFirstMeasure) {
|
|
4173
4195
|
measure.attributes = {
|
|
4174
4196
|
_id: generateId(),
|
|
@@ -4276,6 +4298,7 @@ function buildMeasures(tokens, unitNote, keySignature, timeSignature, measureDur
|
|
|
4276
4298
|
noteCountForLyrics++;
|
|
4277
4299
|
}
|
|
4278
4300
|
if (!inGrace) {
|
|
4301
|
+
markBeamBreak(entry);
|
|
4279
4302
|
currentEntries.push(entry);
|
|
4280
4303
|
currentPosition += entry.duration;
|
|
4281
4304
|
if (tupletState) {
|
|
@@ -4364,6 +4387,7 @@ function buildMeasures(tokens, unitNote, keySignature, timeSignature, measureDur
|
|
|
4364
4387
|
if (!entry.notations) entry.notations = [];
|
|
4365
4388
|
entry.notations.push({ type: "tied", tiedType: "start" });
|
|
4366
4389
|
}
|
|
4390
|
+
if (ci === 0 && !inGrace) markBeamBreak(entry);
|
|
4367
4391
|
currentEntries.push(entry);
|
|
4368
4392
|
if (ci === 0) {
|
|
4369
4393
|
currentPosition += entry.duration;
|
|
@@ -4493,6 +4517,7 @@ function buildMeasures(tokens, unitNote, keySignature, timeSignature, measureDur
|
|
|
4493
4517
|
}
|
|
4494
4518
|
}
|
|
4495
4519
|
pendingBrokenRhythm = token.value;
|
|
4520
|
+
beamBreak = false;
|
|
4496
4521
|
break;
|
|
4497
4522
|
}
|
|
4498
4523
|
case "tuplet":
|
|
@@ -4588,8 +4613,10 @@ function buildMeasures(tokens, unitNote, keySignature, timeSignature, measureDur
|
|
|
4588
4613
|
break;
|
|
4589
4614
|
}
|
|
4590
4615
|
case "space":
|
|
4616
|
+
if (!pendingBrokenRhythm) beamBreak = true;
|
|
4591
4617
|
break;
|
|
4592
4618
|
case "line_break": {
|
|
4619
|
+
beamBreak = true;
|
|
4593
4620
|
flushPendingPreNoteItems();
|
|
4594
4621
|
if (currentEntries.length > 0) {
|
|
4595
4622
|
const breakText = token.value === "\\\n" ? "__abc_line_cont__" : "__abc_line_break__";
|
|
@@ -4651,6 +4678,65 @@ function applyLyricsToNotes(targetNotes, syllables, verse) {
|
|
|
4651
4678
|
note.lyrics.push({ number: verse, text, syllabic });
|
|
4652
4679
|
}
|
|
4653
4680
|
}
|
|
4681
|
+
var BEAM_LEVELS = {
|
|
4682
|
+
eighth: 1,
|
|
4683
|
+
"16th": 2,
|
|
4684
|
+
"32nd": 3,
|
|
4685
|
+
"64th": 4,
|
|
4686
|
+
"128th": 5,
|
|
4687
|
+
"256th": 6,
|
|
4688
|
+
"512th": 7,
|
|
4689
|
+
"1024th": 8
|
|
4690
|
+
};
|
|
4691
|
+
function assignAbcBeams(entries, breakBefore) {
|
|
4692
|
+
const groups = [];
|
|
4693
|
+
let group = [];
|
|
4694
|
+
const close = () => {
|
|
4695
|
+
if (group.length >= 2) groups.push(group);
|
|
4696
|
+
group = [];
|
|
4697
|
+
};
|
|
4698
|
+
for (const e of entries) {
|
|
4699
|
+
if (e.type === "backup" || e.type === "forward") {
|
|
4700
|
+
close();
|
|
4701
|
+
continue;
|
|
4702
|
+
}
|
|
4703
|
+
if (e.type !== "note" || e.grace || e.chord) continue;
|
|
4704
|
+
const level = e.rest || !e.noteType ? 0 : BEAM_LEVELS[e.noteType] ?? 0;
|
|
4705
|
+
if (level === 0) {
|
|
4706
|
+
close();
|
|
4707
|
+
continue;
|
|
4708
|
+
}
|
|
4709
|
+
if (breakBefore.has(e)) close();
|
|
4710
|
+
group.push(e);
|
|
4711
|
+
}
|
|
4712
|
+
close();
|
|
4713
|
+
for (const g of groups) {
|
|
4714
|
+
const levels = g.map((n) => BEAM_LEVELS[n.noteType]);
|
|
4715
|
+
const beams = g.map(() => []);
|
|
4716
|
+
const maxLevel = Math.max(...levels);
|
|
4717
|
+
for (let lv = 1; lv <= maxLevel; lv++) {
|
|
4718
|
+
for (let i = 0; i < g.length; ) {
|
|
4719
|
+
if (levels[i] < lv) {
|
|
4720
|
+
i++;
|
|
4721
|
+
continue;
|
|
4722
|
+
}
|
|
4723
|
+
let j = i;
|
|
4724
|
+
while (j + 1 < g.length && levels[j + 1] >= lv) j++;
|
|
4725
|
+
if (i === j) {
|
|
4726
|
+
beams[i].push({ number: lv, type: i === g.length - 1 ? "backward hook" : "forward hook" });
|
|
4727
|
+
} else {
|
|
4728
|
+
for (let k = i; k <= j; k++) {
|
|
4729
|
+
beams[k].push({ number: lv, type: k === i ? "begin" : k === j ? "end" : "continue" });
|
|
4730
|
+
}
|
|
4731
|
+
}
|
|
4732
|
+
i = j + 1;
|
|
4733
|
+
}
|
|
4734
|
+
}
|
|
4735
|
+
g.forEach((n, i) => {
|
|
4736
|
+
n.beam = beams[i];
|
|
4737
|
+
});
|
|
4738
|
+
}
|
|
4739
|
+
}
|
|
4654
4740
|
function applyTieStops(measures) {
|
|
4655
4741
|
const allNotes = [];
|
|
4656
4742
|
for (const measure of measures) {
|
|
@@ -4693,7 +4779,7 @@ function createNoteEntry(token, unitNote, _hasTieStop, isGrace, tupletState, gra
|
|
|
4693
4779
|
duration = Math.round(duration * tupletState.q / tupletState.p);
|
|
4694
4780
|
}
|
|
4695
4781
|
}
|
|
4696
|
-
const { noteType, dots } = durationToNoteType(
|
|
4782
|
+
const { noteType, dots } = durationToNoteType(lengthToDuration(num, den, unitNote));
|
|
4697
4783
|
const pitch = token.pitch && octaveShift !== 0 ? { ...token.pitch, octave: token.pitch.octave + octaveShift } : token.pitch;
|
|
4698
4784
|
const entry = {
|
|
4699
4785
|
_id: generateId(),
|
|
@@ -4753,7 +4839,7 @@ function createRestEntry(token, unitNote, tupletState, measureDuration) {
|
|
|
4753
4839
|
duration = Math.round(duration * tupletState.q / tupletState.p);
|
|
4754
4840
|
}
|
|
4755
4841
|
}
|
|
4756
|
-
const { noteType, dots } = durationToNoteType(duration);
|
|
4842
|
+
const { noteType, dots } = durationToNoteType(isWholeMeasure ? duration : lengthToDuration(num, den, unitNote));
|
|
4757
4843
|
const entry = {
|
|
4758
4844
|
_id: generateId(),
|
|
4759
4845
|
type: "note",
|
|
@@ -5720,18 +5806,13 @@ function serializeEntry(entry, indent, out) {
|
|
|
5720
5806
|
}
|
|
5721
5807
|
}
|
|
5722
5808
|
function serializeNote(note, indent, out) {
|
|
5723
|
-
|
|
5724
|
-
|
|
5725
|
-
|
|
5726
|
-
|
|
5727
|
-
|
|
5728
|
-
|
|
5729
|
-
|
|
5730
|
-
"print-object": note.printObject === false ? false : void 0,
|
|
5731
|
-
"print-dot": note.printDot !== void 0 ? note.printDot : void 0,
|
|
5732
|
-
"print-spacing": note.printSpacing,
|
|
5733
|
-
"color": note.color
|
|
5734
|
-
});
|
|
5809
|
+
let noteAttrs = note._id !== void 0 ? ` id="${escapeXml(note._id)}"` : "";
|
|
5810
|
+
noteAttrs += positionAttrs(note);
|
|
5811
|
+
if (note.dynamics !== void 0) noteAttrs += ` dynamics="${note.dynamics}"`;
|
|
5812
|
+
if (note.printObject === false) noteAttrs += ' print-object="no"';
|
|
5813
|
+
if (note.printDot !== void 0) noteAttrs += ` print-dot="${note.printDot ? "yes" : "no"}"`;
|
|
5814
|
+
if (note.printSpacing !== void 0) noteAttrs += ` print-spacing="${note.printSpacing ? "yes" : "no"}"`;
|
|
5815
|
+
noteAttrs += colorAttr(note.color);
|
|
5735
5816
|
out.push(`${indent}<note${noteAttrs}>`);
|
|
5736
5817
|
if (note.grace) {
|
|
5737
5818
|
const graceAttrs = buildAttrs({
|
|
@@ -5794,10 +5875,7 @@ function serializeNote(note, indent, out) {
|
|
|
5794
5875
|
out.push(`${indent} <voice>${note.voice}</voice>`);
|
|
5795
5876
|
}
|
|
5796
5877
|
if (note.noteType) {
|
|
5797
|
-
const typeAttrs =
|
|
5798
|
-
"size": note.noteTypeSize,
|
|
5799
|
-
"color": note.noteTypeColor
|
|
5800
|
-
});
|
|
5878
|
+
const typeAttrs = (note.noteTypeSize !== void 0 ? ` size="${escapeXml(note.noteTypeSize)}"` : "") + colorAttr(note.noteTypeColor);
|
|
5801
5879
|
out.push(`${indent} <type${typeAttrs}>${note.noteType}</type>`);
|
|
5802
5880
|
}
|
|
5803
5881
|
if (note.dots) {
|
|
@@ -5837,19 +5915,13 @@ function serializeNote(note, indent, out) {
|
|
|
5837
5915
|
out.push(`${indent} </time-modification>`);
|
|
5838
5916
|
}
|
|
5839
5917
|
if (note.stem) {
|
|
5840
|
-
const stemAttrs =
|
|
5841
|
-
"default-x": note.stem.defaultX,
|
|
5842
|
-
"default-y": note.stem.defaultY,
|
|
5843
|
-
"color": note.stem.color
|
|
5844
|
-
});
|
|
5918
|
+
const stemAttrs = positionAttrs(note.stem) + colorAttr(note.stem.color);
|
|
5845
5919
|
out.push(`${indent} <stem${stemAttrs}>${note.stem.value}</stem>`);
|
|
5846
5920
|
}
|
|
5847
5921
|
if (note.notehead) {
|
|
5848
|
-
|
|
5849
|
-
|
|
5850
|
-
|
|
5851
|
-
"color": note.notehead.color
|
|
5852
|
-
});
|
|
5922
|
+
let nhAttrs = note.notehead.filled !== void 0 ? ` filled="${note.notehead.filled ? "yes" : "no"}"` : "";
|
|
5923
|
+
if (note.notehead.parentheses) nhAttrs += ' parentheses="yes"';
|
|
5924
|
+
nhAttrs += colorAttr(note.notehead.color);
|
|
5853
5925
|
out.push(`${indent} <notehead${nhAttrs}>${note.notehead.value}</notehead>`);
|
|
5854
5926
|
}
|
|
5855
5927
|
if (note.staff !== void 0) {
|
|
@@ -6579,22 +6651,22 @@ function colorAttr(color) {
|
|
|
6579
6651
|
return color ? ` color="${escapeXml(color)}"` : "";
|
|
6580
6652
|
}
|
|
6581
6653
|
function positionAttrs(p) {
|
|
6582
|
-
|
|
6583
|
-
|
|
6584
|
-
|
|
6585
|
-
|
|
6586
|
-
|
|
6587
|
-
|
|
6654
|
+
let result = "";
|
|
6655
|
+
if (p.defaultX !== void 0) result += ` default-x="${p.defaultX}"`;
|
|
6656
|
+
if (p.defaultY !== void 0) result += ` default-y="${p.defaultY}"`;
|
|
6657
|
+
if (p.relativeX !== void 0) result += ` relative-x="${p.relativeX}"`;
|
|
6658
|
+
if (p.relativeY !== void 0) result += ` relative-y="${p.relativeY}"`;
|
|
6659
|
+
return result;
|
|
6588
6660
|
}
|
|
6589
6661
|
function bezierAttrs(b) {
|
|
6590
|
-
|
|
6591
|
-
|
|
6592
|
-
|
|
6593
|
-
|
|
6594
|
-
|
|
6595
|
-
|
|
6596
|
-
|
|
6597
|
-
|
|
6662
|
+
let result = "";
|
|
6663
|
+
if (b.bezierX !== void 0) result += ` bezier-x="${b.bezierX}"`;
|
|
6664
|
+
if (b.bezierY !== void 0) result += ` bezier-y="${b.bezierY}"`;
|
|
6665
|
+
if (b.bezierX2 !== void 0) result += ` bezier-x2="${b.bezierX2}"`;
|
|
6666
|
+
if (b.bezierY2 !== void 0) result += ` bezier-y2="${b.bezierY2}"`;
|
|
6667
|
+
if (b.bezierOffset !== void 0) result += ` bezier-offset="${b.bezierOffset}"`;
|
|
6668
|
+
if (b.bezierOffset2 !== void 0) result += ` bezier-offset2="${b.bezierOffset2}"`;
|
|
6669
|
+
return result;
|
|
6598
6670
|
}
|
|
6599
6671
|
function buildAttrs(attrs) {
|
|
6600
6672
|
let result = "";
|
|
@@ -8109,8 +8181,22 @@ function serializeMeasureEntries(measure, divisions, unitNote, opts) {
|
|
|
8109
8181
|
let inChord = false;
|
|
8110
8182
|
let chordHasIndividualDurations = false;
|
|
8111
8183
|
let tupletRemaining = 0;
|
|
8184
|
+
let prev = null;
|
|
8185
|
+
let prevEnd = 0;
|
|
8186
|
+
const flushChord = () => {
|
|
8187
|
+
parts.push("[" + chordPitches.join("") + "]" + chordDurationStr + chordTieStr + chordSlurEnd);
|
|
8188
|
+
if (prevEnd === -1) prevEnd = parts.length;
|
|
8189
|
+
inChord = false;
|
|
8190
|
+
chordHasIndividualDurations = false;
|
|
8191
|
+
chordPitches = [];
|
|
8192
|
+
chordDurationStr = "";
|
|
8193
|
+
chordTieStr = "";
|
|
8194
|
+
chordSlurStart = "";
|
|
8195
|
+
chordSlurEnd = "";
|
|
8196
|
+
};
|
|
8112
8197
|
for (let ei = 0; ei < measure.entries.length; ei++) {
|
|
8113
8198
|
const entry = measure.entries[ei];
|
|
8199
|
+
if (inChord && !(entry.type === "note" && entry.chord && !entry.grace)) flushChord();
|
|
8114
8200
|
switch (entry.type) {
|
|
8115
8201
|
case "note": {
|
|
8116
8202
|
const note = entry;
|
|
@@ -8157,16 +8243,8 @@ function serializeMeasureEntries(measure, divisions, unitNote, opts) {
|
|
|
8157
8243
|
chordPitches.push(chordNoteStr);
|
|
8158
8244
|
break;
|
|
8159
8245
|
}
|
|
8160
|
-
if (
|
|
8161
|
-
|
|
8162
|
-
inChord = false;
|
|
8163
|
-
chordHasIndividualDurations = false;
|
|
8164
|
-
chordPitches = [];
|
|
8165
|
-
chordDurationStr = "";
|
|
8166
|
-
chordTieStr = "";
|
|
8167
|
-
chordSlurStart = "";
|
|
8168
|
-
chordSlurEnd = "";
|
|
8169
|
-
}
|
|
8246
|
+
if (prev && breaksBeam(prev, note)) parts.splice(prevEnd, 0, " ");
|
|
8247
|
+
prev = note;
|
|
8170
8248
|
if (note.lyrics && note.lyrics.length > 0 && opts.includeLyrics) {
|
|
8171
8249
|
for (const lyric of note.lyrics) {
|
|
8172
8250
|
if (!lyric.text) continue;
|
|
@@ -8258,10 +8336,12 @@ function serializeMeasureEntries(measure, divisions, unitNote, opts) {
|
|
|
8258
8336
|
if (insertIdx < parts.length) {
|
|
8259
8337
|
parts.splice(insertIdx, 0, chordSlurStart);
|
|
8260
8338
|
parts.push(tupletPrefix + effectiveSerialized.decorations);
|
|
8339
|
+
prevEnd = -1;
|
|
8261
8340
|
break;
|
|
8262
8341
|
}
|
|
8263
8342
|
}
|
|
8264
8343
|
parts.push(tupletPrefix + chordSlurStart + effectiveSerialized.decorations);
|
|
8344
|
+
prevEnd = -1;
|
|
8265
8345
|
break;
|
|
8266
8346
|
}
|
|
8267
8347
|
if (effectiveSerialized.slurStart) {
|
|
@@ -8278,6 +8358,7 @@ function serializeMeasureEntries(measure, divisions, unitNote, opts) {
|
|
|
8278
8358
|
parts.splice(insertIdx, 0, effectiveSerialized.slurStart);
|
|
8279
8359
|
const noteOnly = effectiveSerialized.decorations + effectiveSerialized.pitch + effectiveSerialized.duration + effectiveSerialized.tieStr + effectiveSerialized.slurEnd;
|
|
8280
8360
|
parts.push(tupletPrefix + noteOnly);
|
|
8361
|
+
prevEnd = parts.length;
|
|
8281
8362
|
break;
|
|
8282
8363
|
}
|
|
8283
8364
|
}
|
|
@@ -8301,9 +8382,12 @@ function serializeMeasureEntries(measure, divisions, unitNote, opts) {
|
|
|
8301
8382
|
}
|
|
8302
8383
|
parts.push(pitchStr2 + baseDurStr1 + tieStr2 + slurEnd2 + slurE1);
|
|
8303
8384
|
ei = brokenResult.nextIndex;
|
|
8385
|
+
prev = note2;
|
|
8386
|
+
prevEnd = parts.length;
|
|
8304
8387
|
break;
|
|
8305
8388
|
}
|
|
8306
8389
|
parts.push(tupletPrefix + effectiveSerialized.full);
|
|
8390
|
+
prevEnd = parts.length;
|
|
8307
8391
|
break;
|
|
8308
8392
|
}
|
|
8309
8393
|
case "harmony": {
|
|
@@ -8318,16 +8402,19 @@ function serializeMeasureEntries(measure, divisions, unitNote, opts) {
|
|
|
8318
8402
|
if (dt.kind !== "words") continue;
|
|
8319
8403
|
if (dt.text === "__abc_line_cont__") {
|
|
8320
8404
|
parts.push("\\\n");
|
|
8405
|
+
prev = null;
|
|
8321
8406
|
handledAsSpecial = true;
|
|
8322
8407
|
break;
|
|
8323
8408
|
}
|
|
8324
8409
|
if (dt.text === "__abc_line_break__") {
|
|
8325
8410
|
parts.push("\n");
|
|
8411
|
+
prev = null;
|
|
8326
8412
|
handledAsSpecial = true;
|
|
8327
8413
|
break;
|
|
8328
8414
|
}
|
|
8329
8415
|
if (dt.text.startsWith(ABC_BODY_FIELD_MARKER)) {
|
|
8330
8416
|
parts.push("\n" + dt.text.slice(ABC_BODY_FIELD_MARKER.length));
|
|
8417
|
+
prev = null;
|
|
8331
8418
|
handledAsSpecial = true;
|
|
8332
8419
|
break;
|
|
8333
8420
|
}
|
|
@@ -8355,19 +8442,30 @@ function serializeMeasureEntries(measure, divisions, unitNote, opts) {
|
|
|
8355
8442
|
}
|
|
8356
8443
|
case "backup":
|
|
8357
8444
|
parts.push(" & ");
|
|
8445
|
+
prev = null;
|
|
8358
8446
|
break;
|
|
8359
8447
|
case "forward":
|
|
8448
|
+
prev = null;
|
|
8360
8449
|
break;
|
|
8361
8450
|
default:
|
|
8362
8451
|
break;
|
|
8363
8452
|
}
|
|
8364
8453
|
}
|
|
8365
|
-
if (inChord && chordPitches.length > 0)
|
|
8366
|
-
parts.push("[" + chordPitches.join("") + "]" + chordDurationStr + chordTieStr + chordSlurEnd);
|
|
8367
|
-
}
|
|
8454
|
+
if (inChord && chordPitches.length > 0) flushChord();
|
|
8368
8455
|
const unitNoteChanged = currentUnitNote.num !== unitNote.num || currentUnitNote.den !== unitNote.den;
|
|
8369
8456
|
return { noteStr: parts.join(""), lyrics, updatedUnitNote: unitNoteChanged ? currentUnitNote : void 0 };
|
|
8370
8457
|
}
|
|
8458
|
+
var BEAMABLE_TYPES = /* @__PURE__ */ new Set(["eighth", "16th", "32nd", "64th", "128th", "256th", "512th", "1024th"]);
|
|
8459
|
+
function breaksBeam(prev, cur) {
|
|
8460
|
+
if (prev.rest || cur.rest) return false;
|
|
8461
|
+
const beamable = (n) => n.noteType !== void 0 && BEAMABLE_TYPES.has(n.noteType);
|
|
8462
|
+
const p = prev.beam?.find((b) => b.number === 1)?.type;
|
|
8463
|
+
const c = cur.beam?.find((b) => b.number === 1)?.type;
|
|
8464
|
+
if (beamable(prev) && beamable(cur)) {
|
|
8465
|
+
return !(p === "begin" || p === "continue" || c === "continue" || c === "end");
|
|
8466
|
+
}
|
|
8467
|
+
return p !== void 0 || c !== void 0;
|
|
8468
|
+
}
|
|
8371
8469
|
function multipleRestCount(measure) {
|
|
8372
8470
|
const styles = measure.attributes?.measureStyle;
|
|
8373
8471
|
if (!styles) return 0;
|
package/dist/index.js
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
var
|
|
14
|
+
var _chunkO7G4CNSUjs = require('./chunk-O7G4CNSU.js');
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
|
|
@@ -268,14 +268,14 @@ async function parseFile(filePath) {
|
|
|
268
268
|
const lowerPath = filePath.toLowerCase();
|
|
269
269
|
if (lowerPath.endsWith(".abc")) {
|
|
270
270
|
const data2 = await _promises.readFile.call(void 0, filePath, "utf-8");
|
|
271
|
-
return
|
|
271
|
+
return _chunkO7G4CNSUjs.parseAbc.call(void 0, data2);
|
|
272
272
|
}
|
|
273
273
|
const data = await _promises.readFile.call(void 0, filePath);
|
|
274
|
-
if (
|
|
275
|
-
return
|
|
274
|
+
if (_chunkO7G4CNSUjs.isCompressed.call(void 0, data)) {
|
|
275
|
+
return _chunkO7G4CNSUjs.parseCompressed.call(void 0, data);
|
|
276
276
|
}
|
|
277
277
|
const xmlString = decodeBuffer(data);
|
|
278
|
-
return
|
|
278
|
+
return _chunkO7G4CNSUjs.parse.call(void 0, xmlString);
|
|
279
279
|
}
|
|
280
280
|
function decodeBuffer(buffer) {
|
|
281
281
|
if (buffer.length >= 2 && buffer[0] === 254 && buffer[1] === 255) {
|
|
@@ -292,16 +292,16 @@ function decodeBuffer(buffer) {
|
|
|
292
292
|
async function serializeToFile(score, filePath, options = {}) {
|
|
293
293
|
const lowerPath = filePath.toLowerCase();
|
|
294
294
|
if (lowerPath.endsWith(".abc")) {
|
|
295
|
-
const abcString =
|
|
295
|
+
const abcString = _chunkO7G4CNSUjs.serializeAbc.call(void 0, score);
|
|
296
296
|
await _promises.writeFile.call(void 0, filePath, abcString, "utf-8");
|
|
297
297
|
} else if (lowerPath.endsWith(".mxl")) {
|
|
298
|
-
const data =
|
|
298
|
+
const data = _chunkO7G4CNSUjs.serializeCompressed.call(void 0, score, options);
|
|
299
299
|
await _promises.writeFile.call(void 0, filePath, data);
|
|
300
300
|
} else if (lowerPath.endsWith(".mid") || lowerPath.endsWith(".midi")) {
|
|
301
|
-
const data =
|
|
301
|
+
const data = _chunkO7G4CNSUjs.exportMidi.call(void 0, score, options);
|
|
302
302
|
await _promises.writeFile.call(void 0, filePath, data);
|
|
303
303
|
} else {
|
|
304
|
-
const xmlString =
|
|
304
|
+
const xmlString = _chunkO7G4CNSUjs.serialize.call(void 0, score, options);
|
|
305
305
|
await _promises.writeFile.call(void 0, filePath, xmlString, "utf-8");
|
|
306
306
|
}
|
|
307
307
|
}
|
|
@@ -564,4 +564,4 @@ async function serializeToFile(score, filePath, options = {}) {
|
|
|
564
564
|
|
|
565
565
|
|
|
566
566
|
|
|
567
|
-
exports.ALL_COLOR_TARGETS = _chunkK7W4FSFVjs.ALL_COLOR_TARGETS; exports.STEPS = _chunkEWLB5X64js.STEPS; exports.STEP_SEMITONES = _chunkEWLB5X64js.STEP_SEMITONES; exports.ValidationException = _chunkK7W4FSFVjs.ValidationException; exports.addArticulation = _chunkK7W4FSFVjs.addArticulation; exports.addBeam = _chunkK7W4FSFVjs.addBeam; exports.addBowing = _chunkK7W4FSFVjs.addBowing; exports.addBreathMark = _chunkK7W4FSFVjs.addBreathMark; exports.addCaesura = _chunkK7W4FSFVjs.addCaesura; exports.addChord = _chunkK7W4FSFVjs.addChord; exports.addChordNote = _chunkK7W4FSFVjs.addChordNote; exports.addChordNoteChecked = _chunkK7W4FSFVjs.addChordNoteChecked; exports.addChordSymbol = _chunkK7W4FSFVjs.addChordSymbol; exports.addCoda = _chunkK7W4FSFVjs.addCoda; exports.addDaCapo = _chunkK7W4FSFVjs.addDaCapo; exports.addDalSegno = _chunkK7W4FSFVjs.addDalSegno; exports.addDynamics = _chunkK7W4FSFVjs.addDynamics; exports.addEnding = _chunkK7W4FSFVjs.addEnding; exports.addFermata = _chunkK7W4FSFVjs.addFermata; exports.addFine = _chunkK7W4FSFVjs.addFine; exports.addFingering = _chunkK7W4FSFVjs.addFingering; exports.addGraceNote = _chunkK7W4FSFVjs.addGraceNote; exports.addHarmony = _chunkK7W4FSFVjs.addHarmony; exports.addLyric = _chunkK7W4FSFVjs.addLyric; exports.addNote = _chunkK7W4FSFVjs.addNote; exports.addNoteChecked = _chunkK7W4FSFVjs.addNoteChecked; exports.addOctaveShift = _chunkK7W4FSFVjs.addOctaveShift; exports.addOrnament = _chunkK7W4FSFVjs.addOrnament; exports.addPart = _chunkK7W4FSFVjs.addPart; exports.addPedal = _chunkK7W4FSFVjs.addPedal; exports.addRehearsalMark = _chunkK7W4FSFVjs.addRehearsalMark; exports.addRepeat = _chunkK7W4FSFVjs.addRepeat; exports.addRepeatBarline = _chunkK7W4FSFVjs.addRepeatBarline; exports.addSegno = _chunkK7W4FSFVjs.addSegno; exports.addSlur = _chunkK7W4FSFVjs.addSlur; exports.addStringNumber = _chunkK7W4FSFVjs.addStringNumber; exports.addTempo = _chunkK7W4FSFVjs.addTempo; exports.addText = _chunkK7W4FSFVjs.addText; exports.addTextDirection = _chunkK7W4FSFVjs.addTextDirection; exports.addTie = _chunkK7W4FSFVjs.addTie; exports.addToCoda = _chunkK7W4FSFVjs.addToCoda; exports.addVoice = _chunkK7W4FSFVjs.addVoice; exports.addWedge = _chunkK7W4FSFVjs.addWedge; exports.assertMeasureValid = _chunkK7W4FSFVjs.assertMeasureValid; exports.assertValid = _chunkK7W4FSFVjs.assertValid; exports.autoBeam = _chunkK7W4FSFVjs.autoBeam; exports.buildVoiceToStaffMap = _chunkEWLB5X64js.buildVoiceToStaffMap; exports.buildVoiceToStaffMapForPart = _chunkEWLB5X64js.buildVoiceToStaffMapForPart; exports.changeBarline = _chunkK7W4FSFVjs.changeBarline; exports.changeClef = _chunkK7W4FSFVjs.changeClef; exports.changeKey = _chunkK7W4FSFVjs.changeKey; exports.changeNoteDuration = _chunkK7W4FSFVjs.changeNoteDuration; exports.changeTime = _chunkK7W4FSFVjs.changeTime; exports.clearColors = _chunkK7W4FSFVjs.clearColors; exports.convertToGrace = _chunkK7W4FSFVjs.convertToGrace; exports.copyNotes = _chunkK7W4FSFVjs.copyNotes; exports.copyNotesMultiMeasure = _chunkK7W4FSFVjs.copyNotesMultiMeasure; exports.countNotes = _chunkEWLB5X64js.countNotes; exports.createTuplet = _chunkK7W4FSFVjs.createTuplet; exports.cutNotes = _chunkK7W4FSFVjs.cutNotes; exports.decodeBuffer = decodeBuffer; exports.deleteMeasure = _chunkK7W4FSFVjs.deleteMeasure; exports.deleteNote = _chunkK7W4FSFVjs.deleteNote; exports.deleteNoteChecked = _chunkK7W4FSFVjs.deleteNoteChecked; exports.duplicatePart = _chunkK7W4FSFVjs.duplicatePart; exports.exportMidi = _chunkOWCMKOT4js.exportMidi; exports.exportMidiWithTimingMap = _chunkOWCMKOT4js.exportMidiWithTimingMap; exports.extractPlaybackControls = _chunkEWLB5X64js.extractPlaybackControls; exports.findBarlines = _chunkEWLB5X64js.findBarlines; exports.findDirectionsByType = _chunkEWLB5X64js.findDirectionsByType; exports.findNotes = _chunkEWLB5X64js.findNotes; exports.findNotesWithNotation = _chunkEWLB5X64js.findNotesWithNotation; exports.formatLocation = _chunkK7W4FSFVjs.formatLocation; exports.generateId = _chunkK7W4FSFVjs.generateId; exports.generatePlaybackSequence = _chunkEWLB5X64js.generatePlaybackSequence; exports.generatePlaybackTimeline = _chunkEWLB5X64js.generatePlaybackTimeline; exports.getAbsolutePosition = _chunkEWLB5X64js.getAbsolutePosition; exports.getAdjacentNotes = _chunkEWLB5X64js.getAdjacentNotes; exports.getAllNotes = _chunkEWLB5X64js.getAllNotes; exports.getAllPartInfos = _chunkOEX7NVZNjs.getAllPartInfos; exports.getAttributesAtMeasure = _chunkEWLB5X64js.getAttributesAtMeasure; exports.getBeamGroups = _chunkEWLB5X64js.getBeamGroups; exports.getChordProgression = _chunkEWLB5X64js.getChordProgression; exports.getChords = _chunkEWLB5X64js.getChords; exports.getClefChanges = _chunkEWLB5X64js.getClefChanges; exports.getClefForStaff = _chunkEWLB5X64js.getClefForStaff; exports.getDirectionOfKind = _chunkOEX7NVZNjs.getDirectionOfKind; exports.getDirections = _chunkEWLB5X64js.getDirections; exports.getDirectionsAtPosition = _chunkEWLB5X64js.getDirectionsAtPosition; exports.getDirectionsOfKind = _chunkOEX7NVZNjs.getDirectionsOfKind; exports.getDivisions = _chunkEWLB5X64js.getDivisions; exports.getDuration = _chunkEWLB5X64js.getDuration; exports.getDynamics = _chunkEWLB5X64js.getDynamics; exports.getEffectiveStaff = _chunkEWLB5X64js.getEffectiveStaff; exports.getEndings = _chunkEWLB5X64js.getEndings; exports.getEntriesAtPosition = _chunkEWLB5X64js.getEntriesAtPosition; exports.getEntriesForStaff = _chunkEWLB5X64js.getEntriesForStaff; exports.getEntriesInRange = _chunkEWLB5X64js.getEntriesInRange; exports.getHarmonies = _chunkEWLB5X64js.getHarmonies; exports.getHarmonyAtPosition = _chunkEWLB5X64js.getHarmonyAtPosition; exports.getKeyChanges = _chunkEWLB5X64js.getKeyChanges; exports.getLyricText = _chunkEWLB5X64js.getLyricText; exports.getLyrics = _chunkEWLB5X64js.getLyrics; exports.getMeasure = _chunkEWLB5X64js.getMeasure; exports.getMeasureByIndex = _chunkEWLB5X64js.getMeasureByIndex; exports.getMeasureContext = _chunkK7W4FSFVjs.getMeasureContext; exports.getMeasureCount = _chunkEWLB5X64js.getMeasureCount; exports.getMeasureEndPosition = _chunkEWLB5X64js.getMeasureEndPosition; exports.getNextNote = _chunkEWLB5X64js.getNextNote; exports.getNormalizedDuration = _chunkEWLB5X64js.getNormalizedDuration; exports.getNormalizedPosition = _chunkEWLB5X64js.getNormalizedPosition; exports.getNotesAtPosition = _chunkEWLB5X64js.getNotesAtPosition; exports.getNotesForStaff = _chunkEWLB5X64js.getNotesForStaff; exports.getNotesForVoice = _chunkEWLB5X64js.getNotesForVoice; exports.getNotesInRange = _chunkEWLB5X64js.getNotesInRange; exports.getOctaveShifts = _chunkEWLB5X64js.getOctaveShifts; exports.getPartAbbreviation = _chunkOEX7NVZNjs.getPartAbbreviation; exports.getPartById = _chunkEWLB5X64js.getPartById; exports.getPartByIndex = _chunkEWLB5X64js.getPartByIndex; exports.getPartCount = _chunkEWLB5X64js.getPartCount; exports.getPartIds = _chunkEWLB5X64js.getPartIds; exports.getPartIndex = _chunkEWLB5X64js.getPartIndex; exports.getPartInfo = _chunkOEX7NVZNjs.getPartInfo; exports.getPartName = _chunkOEX7NVZNjs.getPartName; exports.getPartNameMap = _chunkOEX7NVZNjs.getPartNameMap; exports.getPedalMarkings = _chunkEWLB5X64js.getPedalMarkings; exports.getPrevNote = _chunkEWLB5X64js.getPrevNote; exports.getRepeatStructure = _chunkEWLB5X64js.getRepeatStructure; exports.getSlurSpans = _chunkEWLB5X64js.getSlurSpans; exports.getSoundDamperPedal = _chunkOEX7NVZNjs.getSoundDamperPedal; exports.getSoundDynamics = _chunkOEX7NVZNjs.getSoundDynamics; exports.getSoundSoftPedal = _chunkOEX7NVZNjs.getSoundSoftPedal; exports.getSoundSostenutoPedal = _chunkOEX7NVZNjs.getSoundSostenutoPedal; exports.getSoundTempo = _chunkOEX7NVZNjs.getSoundTempo; exports.getStaffRange = _chunkEWLB5X64js.getStaffRange; exports.getStaveCount = _chunkEWLB5X64js.getStaveCount; exports.getStaves = _chunkEWLB5X64js.getStaves; exports.getStructuralChanges = _chunkEWLB5X64js.getStructuralChanges; exports.getTempoMarkings = _chunkEWLB5X64js.getTempoMarkings; exports.getTiedNoteGroups = _chunkEWLB5X64js.getTiedNoteGroups; exports.getTimeChanges = _chunkEWLB5X64js.getTimeChanges; exports.getTupletGroups = _chunkEWLB5X64js.getTupletGroups; exports.getVerseCount = _chunkEWLB5X64js.getVerseCount; exports.getVerticalSlice = _chunkEWLB5X64js.getVerticalSlice; exports.getVoiceLine = _chunkEWLB5X64js.getVoiceLine; exports.getVoiceLineInRange = _chunkEWLB5X64js.getVoiceLineInRange; exports.getVoices = _chunkEWLB5X64js.getVoices; exports.getVoicesForStaff = _chunkEWLB5X64js.getVoicesForStaff; exports.getWedges = _chunkEWLB5X64js.getWedges; exports.groupByStaff = _chunkEWLB5X64js.groupByStaff; exports.groupByVoice = _chunkEWLB5X64js.groupByVoice; exports.hasBeam = _chunkOEX7NVZNjs.hasBeam; exports.hasDirectionOfKind = _chunkOEX7NVZNjs.hasDirectionOfKind; exports.hasLyrics = _chunkOEX7NVZNjs.hasLyrics; exports.hasMultipleStaves = _chunkEWLB5X64js.hasMultipleStaves; exports.hasNotations = _chunkOEX7NVZNjs.hasNotations; exports.hasNotes = _chunkEWLB5X64js.hasNotes; exports.hasPlaybackControls = _chunkEWLB5X64js.hasPlaybackControls; exports.hasTie = _chunkOEX7NVZNjs.hasTie; exports.hasTieStart = _chunkOEX7NVZNjs.hasTieStart; exports.hasTieStop = _chunkOEX7NVZNjs.hasTieStop; exports.hasTuplet = _chunkOEX7NVZNjs.hasTuplet; exports.inferStaff = _chunkEWLB5X64js.inferStaff; exports.insertClefChange = _chunkK7W4FSFVjs.insertClefChange; exports.insertMeasure = _chunkK7W4FSFVjs.insertMeasure; exports.insertNote = _chunkK7W4FSFVjs.insertNote; exports.isChordNote = _chunkOEX7NVZNjs.isChordNote; exports.isCompressed = _chunkOWCMKOT4js.isCompressed; exports.isCueNote = _chunkOEX7NVZNjs.isCueNote; exports.isGraceNote = _chunkOEX7NVZNjs.isGraceNote; exports.isPartInfo = _chunkOEX7NVZNjs.isPartInfo; exports.isPitchedNote = _chunkOEX7NVZNjs.isPitchedNote; exports.isRest = _chunkOEX7NVZNjs.isRest; exports.isRestMeasure = _chunkEWLB5X64js.isRestMeasure; exports.isUnpitchedNote = _chunkOEX7NVZNjs.isUnpitchedNote; exports.isValid = _chunkK7W4FSFVjs.isValid; exports.iterateEntries = _chunkEWLB5X64js.iterateEntries; exports.iterateNotes = _chunkEWLB5X64js.iterateNotes; exports.lowerAccidental = _chunkK7W4FSFVjs.lowerAccidental; exports.measureRoundtrip = _chunkEWLB5X64js.measureRoundtrip; exports.modifyDynamics = _chunkK7W4FSFVjs.modifyDynamics; exports.modifyNoteDuration = _chunkK7W4FSFVjs.modifyNoteDuration; exports.modifyNoteDurationChecked = _chunkK7W4FSFVjs.modifyNoteDurationChecked; exports.modifyNotePitch = _chunkK7W4FSFVjs.modifyNotePitch; exports.modifyNotePitchChecked = _chunkK7W4FSFVjs.modifyNotePitchChecked; exports.modifyTempo = _chunkK7W4FSFVjs.modifyTempo; exports.moveNoteToStaff = _chunkK7W4FSFVjs.moveNoteToStaff; exports.parse = _chunkOWCMKOT4js.parse; exports.parseAbc = _chunkOWCMKOT4js.parseAbc; exports.parseAbcTunes = _chunkOWCMKOT4js.parseAbcTunes; exports.parseAuto = _chunkOWCMKOT4js.parseAuto; exports.parseCompressed = _chunkOWCMKOT4js.parseCompressed; exports.parseFile = parseFile; exports.pasteNotes = _chunkK7W4FSFVjs.pasteNotes; exports.pasteNotesMultiMeasure = _chunkK7W4FSFVjs.pasteNotesMultiMeasure; exports.pitchToSemitone = _chunkEWLB5X64js.pitchToSemitone; exports.raiseAccidental = _chunkK7W4FSFVjs.raiseAccidental; exports.removeArticulation = _chunkK7W4FSFVjs.removeArticulation; exports.removeBeam = _chunkK7W4FSFVjs.removeBeam; exports.removeBowing = _chunkK7W4FSFVjs.removeBowing; exports.removeBreathMark = _chunkK7W4FSFVjs.removeBreathMark; exports.removeCaesura = _chunkK7W4FSFVjs.removeCaesura; exports.removeChordSymbol = _chunkK7W4FSFVjs.removeChordSymbol; exports.removeDynamics = _chunkK7W4FSFVjs.removeDynamics; exports.removeEnding = _chunkK7W4FSFVjs.removeEnding; exports.removeFermata = _chunkK7W4FSFVjs.removeFermata; exports.removeFingering = _chunkK7W4FSFVjs.removeFingering; exports.removeGraceNote = _chunkK7W4FSFVjs.removeGraceNote; exports.removeHarmony = _chunkK7W4FSFVjs.removeHarmony; exports.removeLyric = _chunkK7W4FSFVjs.removeLyric; exports.removeNote = _chunkK7W4FSFVjs.removeNote; exports.removeOctaveShift = _chunkK7W4FSFVjs.removeOctaveShift; exports.removeOrnament = _chunkK7W4FSFVjs.removeOrnament; exports.removePart = _chunkK7W4FSFVjs.removePart; exports.removePedal = _chunkK7W4FSFVjs.removePedal; exports.removeRepeat = _chunkK7W4FSFVjs.removeRepeat; exports.removeRepeatBarline = _chunkK7W4FSFVjs.removeRepeatBarline; exports.removeSlur = _chunkK7W4FSFVjs.removeSlur; exports.removeStringNumber = _chunkK7W4FSFVjs.removeStringNumber; exports.removeTempo = _chunkK7W4FSFVjs.removeTempo; exports.removeTie = _chunkK7W4FSFVjs.removeTie; exports.removeTuplet = _chunkK7W4FSFVjs.removeTuplet; exports.removeWedge = _chunkK7W4FSFVjs.removeWedge; exports.scoresEqual = _chunkEWLB5X64js.scoresEqual; exports.serialize = _chunkOWCMKOT4js.serialize; exports.serializeAbc = _chunkOWCMKOT4js.serializeAbc; exports.serializeAbcTunes = _chunkOWCMKOT4js.serializeAbcTunes; exports.serializeCompressed = _chunkOWCMKOT4js.serializeCompressed; exports.serializeToFile = serializeToFile; exports.setBarline = _chunkK7W4FSFVjs.setBarline; exports.setBeaming = _chunkK7W4FSFVjs.setBeaming; exports.setColor = _chunkK7W4FSFVjs.setColor; exports.setNotePitch = _chunkK7W4FSFVjs.setNotePitch; exports.setNotePitchBySemitone = _chunkK7W4FSFVjs.setNotePitchBySemitone; exports.setStaves = _chunkK7W4FSFVjs.setStaves; exports.shiftNotePitch = _chunkK7W4FSFVjs.shiftNotePitch; exports.stopOctaveShift = _chunkK7W4FSFVjs.stopOctaveShift; exports.transpose = _chunkK7W4FSFVjs.transpose; exports.transposeChecked = _chunkK7W4FSFVjs.transposeChecked; exports.updateChordSymbol = _chunkK7W4FSFVjs.updateChordSymbol; exports.updateHarmony = _chunkK7W4FSFVjs.updateHarmony; exports.updateLyric = _chunkK7W4FSFVjs.updateLyric; exports.validate = _chunkK7W4FSFVjs.validate; exports.validateBackupForward = _chunkK7W4FSFVjs.validateBackupForward; exports.validateBeams = _chunkK7W4FSFVjs.validateBeams; exports.validateDivisions = _chunkK7W4FSFVjs.validateDivisions; exports.validateMeasureDuration = _chunkK7W4FSFVjs.validateMeasureDuration; exports.validateMeasureLocal = _chunkK7W4FSFVjs.validateMeasureLocal; exports.validatePartReferences = _chunkK7W4FSFVjs.validatePartReferences; exports.validatePartStructure = _chunkK7W4FSFVjs.validatePartStructure; exports.validateSlurs = _chunkK7W4FSFVjs.validateSlurs; exports.validateSlursAcrossMeasures = _chunkK7W4FSFVjs.validateSlursAcrossMeasures; exports.validateStaffStructure = _chunkK7W4FSFVjs.validateStaffStructure; exports.validateTies = _chunkK7W4FSFVjs.validateTies; exports.validateTiesAcrossMeasures = _chunkK7W4FSFVjs.validateTiesAcrossMeasures; exports.validateTuplets = _chunkK7W4FSFVjs.validateTuplets; exports.validateVoiceStaff = _chunkK7W4FSFVjs.validateVoiceStaff; exports.withAbsolutePositions = _chunkEWLB5X64js.withAbsolutePositions;
|
|
567
|
+
exports.ALL_COLOR_TARGETS = _chunkK7W4FSFVjs.ALL_COLOR_TARGETS; exports.STEPS = _chunkEWLB5X64js.STEPS; exports.STEP_SEMITONES = _chunkEWLB5X64js.STEP_SEMITONES; exports.ValidationException = _chunkK7W4FSFVjs.ValidationException; exports.addArticulation = _chunkK7W4FSFVjs.addArticulation; exports.addBeam = _chunkK7W4FSFVjs.addBeam; exports.addBowing = _chunkK7W4FSFVjs.addBowing; exports.addBreathMark = _chunkK7W4FSFVjs.addBreathMark; exports.addCaesura = _chunkK7W4FSFVjs.addCaesura; exports.addChord = _chunkK7W4FSFVjs.addChord; exports.addChordNote = _chunkK7W4FSFVjs.addChordNote; exports.addChordNoteChecked = _chunkK7W4FSFVjs.addChordNoteChecked; exports.addChordSymbol = _chunkK7W4FSFVjs.addChordSymbol; exports.addCoda = _chunkK7W4FSFVjs.addCoda; exports.addDaCapo = _chunkK7W4FSFVjs.addDaCapo; exports.addDalSegno = _chunkK7W4FSFVjs.addDalSegno; exports.addDynamics = _chunkK7W4FSFVjs.addDynamics; exports.addEnding = _chunkK7W4FSFVjs.addEnding; exports.addFermata = _chunkK7W4FSFVjs.addFermata; exports.addFine = _chunkK7W4FSFVjs.addFine; exports.addFingering = _chunkK7W4FSFVjs.addFingering; exports.addGraceNote = _chunkK7W4FSFVjs.addGraceNote; exports.addHarmony = _chunkK7W4FSFVjs.addHarmony; exports.addLyric = _chunkK7W4FSFVjs.addLyric; exports.addNote = _chunkK7W4FSFVjs.addNote; exports.addNoteChecked = _chunkK7W4FSFVjs.addNoteChecked; exports.addOctaveShift = _chunkK7W4FSFVjs.addOctaveShift; exports.addOrnament = _chunkK7W4FSFVjs.addOrnament; exports.addPart = _chunkK7W4FSFVjs.addPart; exports.addPedal = _chunkK7W4FSFVjs.addPedal; exports.addRehearsalMark = _chunkK7W4FSFVjs.addRehearsalMark; exports.addRepeat = _chunkK7W4FSFVjs.addRepeat; exports.addRepeatBarline = _chunkK7W4FSFVjs.addRepeatBarline; exports.addSegno = _chunkK7W4FSFVjs.addSegno; exports.addSlur = _chunkK7W4FSFVjs.addSlur; exports.addStringNumber = _chunkK7W4FSFVjs.addStringNumber; exports.addTempo = _chunkK7W4FSFVjs.addTempo; exports.addText = _chunkK7W4FSFVjs.addText; exports.addTextDirection = _chunkK7W4FSFVjs.addTextDirection; exports.addTie = _chunkK7W4FSFVjs.addTie; exports.addToCoda = _chunkK7W4FSFVjs.addToCoda; exports.addVoice = _chunkK7W4FSFVjs.addVoice; exports.addWedge = _chunkK7W4FSFVjs.addWedge; exports.assertMeasureValid = _chunkK7W4FSFVjs.assertMeasureValid; exports.assertValid = _chunkK7W4FSFVjs.assertValid; exports.autoBeam = _chunkK7W4FSFVjs.autoBeam; exports.buildVoiceToStaffMap = _chunkEWLB5X64js.buildVoiceToStaffMap; exports.buildVoiceToStaffMapForPart = _chunkEWLB5X64js.buildVoiceToStaffMapForPart; exports.changeBarline = _chunkK7W4FSFVjs.changeBarline; exports.changeClef = _chunkK7W4FSFVjs.changeClef; exports.changeKey = _chunkK7W4FSFVjs.changeKey; exports.changeNoteDuration = _chunkK7W4FSFVjs.changeNoteDuration; exports.changeTime = _chunkK7W4FSFVjs.changeTime; exports.clearColors = _chunkK7W4FSFVjs.clearColors; exports.convertToGrace = _chunkK7W4FSFVjs.convertToGrace; exports.copyNotes = _chunkK7W4FSFVjs.copyNotes; exports.copyNotesMultiMeasure = _chunkK7W4FSFVjs.copyNotesMultiMeasure; exports.countNotes = _chunkEWLB5X64js.countNotes; exports.createTuplet = _chunkK7W4FSFVjs.createTuplet; exports.cutNotes = _chunkK7W4FSFVjs.cutNotes; exports.decodeBuffer = decodeBuffer; exports.deleteMeasure = _chunkK7W4FSFVjs.deleteMeasure; exports.deleteNote = _chunkK7W4FSFVjs.deleteNote; exports.deleteNoteChecked = _chunkK7W4FSFVjs.deleteNoteChecked; exports.duplicatePart = _chunkK7W4FSFVjs.duplicatePart; exports.exportMidi = _chunkO7G4CNSUjs.exportMidi; exports.exportMidiWithTimingMap = _chunkO7G4CNSUjs.exportMidiWithTimingMap; exports.extractPlaybackControls = _chunkEWLB5X64js.extractPlaybackControls; exports.findBarlines = _chunkEWLB5X64js.findBarlines; exports.findDirectionsByType = _chunkEWLB5X64js.findDirectionsByType; exports.findNotes = _chunkEWLB5X64js.findNotes; exports.findNotesWithNotation = _chunkEWLB5X64js.findNotesWithNotation; exports.formatLocation = _chunkK7W4FSFVjs.formatLocation; exports.generateId = _chunkK7W4FSFVjs.generateId; exports.generatePlaybackSequence = _chunkEWLB5X64js.generatePlaybackSequence; exports.generatePlaybackTimeline = _chunkEWLB5X64js.generatePlaybackTimeline; exports.getAbsolutePosition = _chunkEWLB5X64js.getAbsolutePosition; exports.getAdjacentNotes = _chunkEWLB5X64js.getAdjacentNotes; exports.getAllNotes = _chunkEWLB5X64js.getAllNotes; exports.getAllPartInfos = _chunkOEX7NVZNjs.getAllPartInfos; exports.getAttributesAtMeasure = _chunkEWLB5X64js.getAttributesAtMeasure; exports.getBeamGroups = _chunkEWLB5X64js.getBeamGroups; exports.getChordProgression = _chunkEWLB5X64js.getChordProgression; exports.getChords = _chunkEWLB5X64js.getChords; exports.getClefChanges = _chunkEWLB5X64js.getClefChanges; exports.getClefForStaff = _chunkEWLB5X64js.getClefForStaff; exports.getDirectionOfKind = _chunkOEX7NVZNjs.getDirectionOfKind; exports.getDirections = _chunkEWLB5X64js.getDirections; exports.getDirectionsAtPosition = _chunkEWLB5X64js.getDirectionsAtPosition; exports.getDirectionsOfKind = _chunkOEX7NVZNjs.getDirectionsOfKind; exports.getDivisions = _chunkEWLB5X64js.getDivisions; exports.getDuration = _chunkEWLB5X64js.getDuration; exports.getDynamics = _chunkEWLB5X64js.getDynamics; exports.getEffectiveStaff = _chunkEWLB5X64js.getEffectiveStaff; exports.getEndings = _chunkEWLB5X64js.getEndings; exports.getEntriesAtPosition = _chunkEWLB5X64js.getEntriesAtPosition; exports.getEntriesForStaff = _chunkEWLB5X64js.getEntriesForStaff; exports.getEntriesInRange = _chunkEWLB5X64js.getEntriesInRange; exports.getHarmonies = _chunkEWLB5X64js.getHarmonies; exports.getHarmonyAtPosition = _chunkEWLB5X64js.getHarmonyAtPosition; exports.getKeyChanges = _chunkEWLB5X64js.getKeyChanges; exports.getLyricText = _chunkEWLB5X64js.getLyricText; exports.getLyrics = _chunkEWLB5X64js.getLyrics; exports.getMeasure = _chunkEWLB5X64js.getMeasure; exports.getMeasureByIndex = _chunkEWLB5X64js.getMeasureByIndex; exports.getMeasureContext = _chunkK7W4FSFVjs.getMeasureContext; exports.getMeasureCount = _chunkEWLB5X64js.getMeasureCount; exports.getMeasureEndPosition = _chunkEWLB5X64js.getMeasureEndPosition; exports.getNextNote = _chunkEWLB5X64js.getNextNote; exports.getNormalizedDuration = _chunkEWLB5X64js.getNormalizedDuration; exports.getNormalizedPosition = _chunkEWLB5X64js.getNormalizedPosition; exports.getNotesAtPosition = _chunkEWLB5X64js.getNotesAtPosition; exports.getNotesForStaff = _chunkEWLB5X64js.getNotesForStaff; exports.getNotesForVoice = _chunkEWLB5X64js.getNotesForVoice; exports.getNotesInRange = _chunkEWLB5X64js.getNotesInRange; exports.getOctaveShifts = _chunkEWLB5X64js.getOctaveShifts; exports.getPartAbbreviation = _chunkOEX7NVZNjs.getPartAbbreviation; exports.getPartById = _chunkEWLB5X64js.getPartById; exports.getPartByIndex = _chunkEWLB5X64js.getPartByIndex; exports.getPartCount = _chunkEWLB5X64js.getPartCount; exports.getPartIds = _chunkEWLB5X64js.getPartIds; exports.getPartIndex = _chunkEWLB5X64js.getPartIndex; exports.getPartInfo = _chunkOEX7NVZNjs.getPartInfo; exports.getPartName = _chunkOEX7NVZNjs.getPartName; exports.getPartNameMap = _chunkOEX7NVZNjs.getPartNameMap; exports.getPedalMarkings = _chunkEWLB5X64js.getPedalMarkings; exports.getPrevNote = _chunkEWLB5X64js.getPrevNote; exports.getRepeatStructure = _chunkEWLB5X64js.getRepeatStructure; exports.getSlurSpans = _chunkEWLB5X64js.getSlurSpans; exports.getSoundDamperPedal = _chunkOEX7NVZNjs.getSoundDamperPedal; exports.getSoundDynamics = _chunkOEX7NVZNjs.getSoundDynamics; exports.getSoundSoftPedal = _chunkOEX7NVZNjs.getSoundSoftPedal; exports.getSoundSostenutoPedal = _chunkOEX7NVZNjs.getSoundSostenutoPedal; exports.getSoundTempo = _chunkOEX7NVZNjs.getSoundTempo; exports.getStaffRange = _chunkEWLB5X64js.getStaffRange; exports.getStaveCount = _chunkEWLB5X64js.getStaveCount; exports.getStaves = _chunkEWLB5X64js.getStaves; exports.getStructuralChanges = _chunkEWLB5X64js.getStructuralChanges; exports.getTempoMarkings = _chunkEWLB5X64js.getTempoMarkings; exports.getTiedNoteGroups = _chunkEWLB5X64js.getTiedNoteGroups; exports.getTimeChanges = _chunkEWLB5X64js.getTimeChanges; exports.getTupletGroups = _chunkEWLB5X64js.getTupletGroups; exports.getVerseCount = _chunkEWLB5X64js.getVerseCount; exports.getVerticalSlice = _chunkEWLB5X64js.getVerticalSlice; exports.getVoiceLine = _chunkEWLB5X64js.getVoiceLine; exports.getVoiceLineInRange = _chunkEWLB5X64js.getVoiceLineInRange; exports.getVoices = _chunkEWLB5X64js.getVoices; exports.getVoicesForStaff = _chunkEWLB5X64js.getVoicesForStaff; exports.getWedges = _chunkEWLB5X64js.getWedges; exports.groupByStaff = _chunkEWLB5X64js.groupByStaff; exports.groupByVoice = _chunkEWLB5X64js.groupByVoice; exports.hasBeam = _chunkOEX7NVZNjs.hasBeam; exports.hasDirectionOfKind = _chunkOEX7NVZNjs.hasDirectionOfKind; exports.hasLyrics = _chunkOEX7NVZNjs.hasLyrics; exports.hasMultipleStaves = _chunkEWLB5X64js.hasMultipleStaves; exports.hasNotations = _chunkOEX7NVZNjs.hasNotations; exports.hasNotes = _chunkEWLB5X64js.hasNotes; exports.hasPlaybackControls = _chunkEWLB5X64js.hasPlaybackControls; exports.hasTie = _chunkOEX7NVZNjs.hasTie; exports.hasTieStart = _chunkOEX7NVZNjs.hasTieStart; exports.hasTieStop = _chunkOEX7NVZNjs.hasTieStop; exports.hasTuplet = _chunkOEX7NVZNjs.hasTuplet; exports.inferStaff = _chunkEWLB5X64js.inferStaff; exports.insertClefChange = _chunkK7W4FSFVjs.insertClefChange; exports.insertMeasure = _chunkK7W4FSFVjs.insertMeasure; exports.insertNote = _chunkK7W4FSFVjs.insertNote; exports.isChordNote = _chunkOEX7NVZNjs.isChordNote; exports.isCompressed = _chunkO7G4CNSUjs.isCompressed; exports.isCueNote = _chunkOEX7NVZNjs.isCueNote; exports.isGraceNote = _chunkOEX7NVZNjs.isGraceNote; exports.isPartInfo = _chunkOEX7NVZNjs.isPartInfo; exports.isPitchedNote = _chunkOEX7NVZNjs.isPitchedNote; exports.isRest = _chunkOEX7NVZNjs.isRest; exports.isRestMeasure = _chunkEWLB5X64js.isRestMeasure; exports.isUnpitchedNote = _chunkOEX7NVZNjs.isUnpitchedNote; exports.isValid = _chunkK7W4FSFVjs.isValid; exports.iterateEntries = _chunkEWLB5X64js.iterateEntries; exports.iterateNotes = _chunkEWLB5X64js.iterateNotes; exports.lowerAccidental = _chunkK7W4FSFVjs.lowerAccidental; exports.measureRoundtrip = _chunkEWLB5X64js.measureRoundtrip; exports.modifyDynamics = _chunkK7W4FSFVjs.modifyDynamics; exports.modifyNoteDuration = _chunkK7W4FSFVjs.modifyNoteDuration; exports.modifyNoteDurationChecked = _chunkK7W4FSFVjs.modifyNoteDurationChecked; exports.modifyNotePitch = _chunkK7W4FSFVjs.modifyNotePitch; exports.modifyNotePitchChecked = _chunkK7W4FSFVjs.modifyNotePitchChecked; exports.modifyTempo = _chunkK7W4FSFVjs.modifyTempo; exports.moveNoteToStaff = _chunkK7W4FSFVjs.moveNoteToStaff; exports.parse = _chunkO7G4CNSUjs.parse; exports.parseAbc = _chunkO7G4CNSUjs.parseAbc; exports.parseAbcTunes = _chunkO7G4CNSUjs.parseAbcTunes; exports.parseAuto = _chunkO7G4CNSUjs.parseAuto; exports.parseCompressed = _chunkO7G4CNSUjs.parseCompressed; exports.parseFile = parseFile; exports.pasteNotes = _chunkK7W4FSFVjs.pasteNotes; exports.pasteNotesMultiMeasure = _chunkK7W4FSFVjs.pasteNotesMultiMeasure; exports.pitchToSemitone = _chunkEWLB5X64js.pitchToSemitone; exports.raiseAccidental = _chunkK7W4FSFVjs.raiseAccidental; exports.removeArticulation = _chunkK7W4FSFVjs.removeArticulation; exports.removeBeam = _chunkK7W4FSFVjs.removeBeam; exports.removeBowing = _chunkK7W4FSFVjs.removeBowing; exports.removeBreathMark = _chunkK7W4FSFVjs.removeBreathMark; exports.removeCaesura = _chunkK7W4FSFVjs.removeCaesura; exports.removeChordSymbol = _chunkK7W4FSFVjs.removeChordSymbol; exports.removeDynamics = _chunkK7W4FSFVjs.removeDynamics; exports.removeEnding = _chunkK7W4FSFVjs.removeEnding; exports.removeFermata = _chunkK7W4FSFVjs.removeFermata; exports.removeFingering = _chunkK7W4FSFVjs.removeFingering; exports.removeGraceNote = _chunkK7W4FSFVjs.removeGraceNote; exports.removeHarmony = _chunkK7W4FSFVjs.removeHarmony; exports.removeLyric = _chunkK7W4FSFVjs.removeLyric; exports.removeNote = _chunkK7W4FSFVjs.removeNote; exports.removeOctaveShift = _chunkK7W4FSFVjs.removeOctaveShift; exports.removeOrnament = _chunkK7W4FSFVjs.removeOrnament; exports.removePart = _chunkK7W4FSFVjs.removePart; exports.removePedal = _chunkK7W4FSFVjs.removePedal; exports.removeRepeat = _chunkK7W4FSFVjs.removeRepeat; exports.removeRepeatBarline = _chunkK7W4FSFVjs.removeRepeatBarline; exports.removeSlur = _chunkK7W4FSFVjs.removeSlur; exports.removeStringNumber = _chunkK7W4FSFVjs.removeStringNumber; exports.removeTempo = _chunkK7W4FSFVjs.removeTempo; exports.removeTie = _chunkK7W4FSFVjs.removeTie; exports.removeTuplet = _chunkK7W4FSFVjs.removeTuplet; exports.removeWedge = _chunkK7W4FSFVjs.removeWedge; exports.scoresEqual = _chunkEWLB5X64js.scoresEqual; exports.serialize = _chunkO7G4CNSUjs.serialize; exports.serializeAbc = _chunkO7G4CNSUjs.serializeAbc; exports.serializeAbcTunes = _chunkO7G4CNSUjs.serializeAbcTunes; exports.serializeCompressed = _chunkO7G4CNSUjs.serializeCompressed; exports.serializeToFile = serializeToFile; exports.setBarline = _chunkK7W4FSFVjs.setBarline; exports.setBeaming = _chunkK7W4FSFVjs.setBeaming; exports.setColor = _chunkK7W4FSFVjs.setColor; exports.setNotePitch = _chunkK7W4FSFVjs.setNotePitch; exports.setNotePitchBySemitone = _chunkK7W4FSFVjs.setNotePitchBySemitone; exports.setStaves = _chunkK7W4FSFVjs.setStaves; exports.shiftNotePitch = _chunkK7W4FSFVjs.shiftNotePitch; exports.stopOctaveShift = _chunkK7W4FSFVjs.stopOctaveShift; exports.transpose = _chunkK7W4FSFVjs.transpose; exports.transposeChecked = _chunkK7W4FSFVjs.transposeChecked; exports.updateChordSymbol = _chunkK7W4FSFVjs.updateChordSymbol; exports.updateHarmony = _chunkK7W4FSFVjs.updateHarmony; exports.updateLyric = _chunkK7W4FSFVjs.updateLyric; exports.validate = _chunkK7W4FSFVjs.validate; exports.validateBackupForward = _chunkK7W4FSFVjs.validateBackupForward; exports.validateBeams = _chunkK7W4FSFVjs.validateBeams; exports.validateDivisions = _chunkK7W4FSFVjs.validateDivisions; exports.validateMeasureDuration = _chunkK7W4FSFVjs.validateMeasureDuration; exports.validateMeasureLocal = _chunkK7W4FSFVjs.validateMeasureLocal; exports.validatePartReferences = _chunkK7W4FSFVjs.validatePartReferences; exports.validatePartStructure = _chunkK7W4FSFVjs.validatePartStructure; exports.validateSlurs = _chunkK7W4FSFVjs.validateSlurs; exports.validateSlursAcrossMeasures = _chunkK7W4FSFVjs.validateSlursAcrossMeasures; exports.validateStaffStructure = _chunkK7W4FSFVjs.validateStaffStructure; exports.validateTies = _chunkK7W4FSFVjs.validateTies; exports.validateTiesAcrossMeasures = _chunkK7W4FSFVjs.validateTiesAcrossMeasures; exports.validateTuplets = _chunkK7W4FSFVjs.validateTuplets; exports.validateVoiceStaff = _chunkK7W4FSFVjs.validateVoiceStaff; exports.withAbsolutePositions = _chunkEWLB5X64js.withAbsolutePositions;
|
package/dist/index.mjs
CHANGED