musicxml-io 0.11.0 → 0.12.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/dist/browser.js +3 -3
- package/dist/browser.mjs +2 -2
- package/dist/{chunk-K7W4FSFV.js → chunk-FQ3NEYIV.js} +54 -21
- package/dist/{chunk-SQSIGPRD.mjs → chunk-I4X4GRMP.mjs} +53 -20
- package/dist/{chunk-YICQ3O7V.mjs → chunk-T2USSS5E.mjs} +495 -214
- package/dist/{chunk-O7G4CNSU.js → chunk-UT7LQW6V.js} +633 -352
- package/dist/index.js +11 -11
- package/dist/index.mjs +2 -2
- package/dist/operations/index.js +2 -2
- package/dist/operations/index.mjs +1 -1
- package/package.json +1 -1
package/dist/browser.js
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
var
|
|
14
|
+
var _chunkUT7LQW6Vjs = require('./chunk-UT7LQW6V.js');
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
|
|
@@ -173,7 +173,7 @@ var _chunkOEX7NVZNjs = require('./chunk-OEX7NVZN.js');
|
|
|
173
173
|
|
|
174
174
|
|
|
175
175
|
|
|
176
|
-
var
|
|
176
|
+
var _chunkFQ3NEYIVjs = require('./chunk-FQ3NEYIV.js');
|
|
177
177
|
|
|
178
178
|
|
|
179
179
|
|
|
@@ -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 = _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;
|
|
520
|
+
exports.ALL_COLOR_TARGETS = _chunkFQ3NEYIVjs.ALL_COLOR_TARGETS; exports.STEPS = _chunkEWLB5X64js.STEPS; exports.STEP_SEMITONES = _chunkEWLB5X64js.STEP_SEMITONES; exports.ValidationException = _chunkFQ3NEYIVjs.ValidationException; exports.addArticulation = _chunkFQ3NEYIVjs.addArticulation; exports.addBeam = _chunkFQ3NEYIVjs.addBeam; exports.addBowing = _chunkFQ3NEYIVjs.addBowing; exports.addBreathMark = _chunkFQ3NEYIVjs.addBreathMark; exports.addCaesura = _chunkFQ3NEYIVjs.addCaesura; exports.addChord = _chunkFQ3NEYIVjs.addChord; exports.addChordNote = _chunkFQ3NEYIVjs.addChordNote; exports.addChordNoteChecked = _chunkFQ3NEYIVjs.addChordNoteChecked; exports.addChordSymbol = _chunkFQ3NEYIVjs.addChordSymbol; exports.addCoda = _chunkFQ3NEYIVjs.addCoda; exports.addDaCapo = _chunkFQ3NEYIVjs.addDaCapo; exports.addDalSegno = _chunkFQ3NEYIVjs.addDalSegno; exports.addDynamics = _chunkFQ3NEYIVjs.addDynamics; exports.addEnding = _chunkFQ3NEYIVjs.addEnding; exports.addFermata = _chunkFQ3NEYIVjs.addFermata; exports.addFine = _chunkFQ3NEYIVjs.addFine; exports.addFingering = _chunkFQ3NEYIVjs.addFingering; exports.addGraceNote = _chunkFQ3NEYIVjs.addGraceNote; exports.addHarmony = _chunkFQ3NEYIVjs.addHarmony; exports.addLyric = _chunkFQ3NEYIVjs.addLyric; exports.addNote = _chunkFQ3NEYIVjs.addNote; exports.addNoteChecked = _chunkFQ3NEYIVjs.addNoteChecked; exports.addOctaveShift = _chunkFQ3NEYIVjs.addOctaveShift; exports.addOrnament = _chunkFQ3NEYIVjs.addOrnament; exports.addPart = _chunkFQ3NEYIVjs.addPart; exports.addPedal = _chunkFQ3NEYIVjs.addPedal; exports.addRehearsalMark = _chunkFQ3NEYIVjs.addRehearsalMark; exports.addRepeat = _chunkFQ3NEYIVjs.addRepeat; exports.addRepeatBarline = _chunkFQ3NEYIVjs.addRepeatBarline; exports.addSegno = _chunkFQ3NEYIVjs.addSegno; exports.addSlur = _chunkFQ3NEYIVjs.addSlur; exports.addStringNumber = _chunkFQ3NEYIVjs.addStringNumber; exports.addTempo = _chunkFQ3NEYIVjs.addTempo; exports.addText = _chunkFQ3NEYIVjs.addText; exports.addTextDirection = _chunkFQ3NEYIVjs.addTextDirection; exports.addTie = _chunkFQ3NEYIVjs.addTie; exports.addToCoda = _chunkFQ3NEYIVjs.addToCoda; exports.addVoice = _chunkFQ3NEYIVjs.addVoice; exports.addWedge = _chunkFQ3NEYIVjs.addWedge; exports.assertMeasureValid = _chunkFQ3NEYIVjs.assertMeasureValid; exports.assertValid = _chunkFQ3NEYIVjs.assertValid; exports.autoBeam = _chunkFQ3NEYIVjs.autoBeam; exports.buildVoiceToStaffMap = _chunkEWLB5X64js.buildVoiceToStaffMap; exports.buildVoiceToStaffMapForPart = _chunkEWLB5X64js.buildVoiceToStaffMapForPart; exports.changeBarline = _chunkFQ3NEYIVjs.changeBarline; exports.changeClef = _chunkFQ3NEYIVjs.changeClef; exports.changeKey = _chunkFQ3NEYIVjs.changeKey; exports.changeNoteDuration = _chunkFQ3NEYIVjs.changeNoteDuration; exports.changeTime = _chunkFQ3NEYIVjs.changeTime; exports.clearColors = _chunkFQ3NEYIVjs.clearColors; exports.convertToGrace = _chunkFQ3NEYIVjs.convertToGrace; exports.copyNotes = _chunkFQ3NEYIVjs.copyNotes; exports.copyNotesMultiMeasure = _chunkFQ3NEYIVjs.copyNotesMultiMeasure; exports.countNotes = _chunkEWLB5X64js.countNotes; exports.createTuplet = _chunkFQ3NEYIVjs.createTuplet; exports.cutNotes = _chunkFQ3NEYIVjs.cutNotes; exports.deleteMeasure = _chunkFQ3NEYIVjs.deleteMeasure; exports.deleteNote = _chunkFQ3NEYIVjs.deleteNote; exports.deleteNoteChecked = _chunkFQ3NEYIVjs.deleteNoteChecked; exports.duplicatePart = _chunkFQ3NEYIVjs.duplicatePart; exports.exportMidi = _chunkUT7LQW6Vjs.exportMidi; exports.exportMidiWithTimingMap = _chunkUT7LQW6Vjs.exportMidiWithTimingMap; exports.extractPlaybackControls = _chunkEWLB5X64js.extractPlaybackControls; exports.findBarlines = _chunkEWLB5X64js.findBarlines; exports.findDirectionsByType = _chunkEWLB5X64js.findDirectionsByType; exports.findNotes = _chunkEWLB5X64js.findNotes; exports.findNotesWithNotation = _chunkEWLB5X64js.findNotesWithNotation; exports.formatLocation = _chunkFQ3NEYIVjs.formatLocation; exports.generateId = _chunkFQ3NEYIVjs.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 = _chunkFQ3NEYIVjs.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 = _chunkFQ3NEYIVjs.insertClefChange; exports.insertMeasure = _chunkFQ3NEYIVjs.insertMeasure; exports.insertNote = _chunkFQ3NEYIVjs.insertNote; exports.isChordNote = _chunkOEX7NVZNjs.isChordNote; exports.isCompressed = _chunkUT7LQW6Vjs.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 = _chunkFQ3NEYIVjs.isValid; exports.iterateEntries = _chunkEWLB5X64js.iterateEntries; exports.iterateNotes = _chunkEWLB5X64js.iterateNotes; exports.lowerAccidental = _chunkFQ3NEYIVjs.lowerAccidental; exports.measureRoundtrip = _chunkEWLB5X64js.measureRoundtrip; exports.modifyDynamics = _chunkFQ3NEYIVjs.modifyDynamics; exports.modifyNoteDuration = _chunkFQ3NEYIVjs.modifyNoteDuration; exports.modifyNoteDurationChecked = _chunkFQ3NEYIVjs.modifyNoteDurationChecked; exports.modifyNotePitch = _chunkFQ3NEYIVjs.modifyNotePitch; exports.modifyNotePitchChecked = _chunkFQ3NEYIVjs.modifyNotePitchChecked; exports.modifyTempo = _chunkFQ3NEYIVjs.modifyTempo; exports.moveNoteToStaff = _chunkFQ3NEYIVjs.moveNoteToStaff; exports.parse = _chunkUT7LQW6Vjs.parse; exports.parseAbc = _chunkUT7LQW6Vjs.parseAbc; exports.parseAbcTunes = _chunkUT7LQW6Vjs.parseAbcTunes; exports.parseAuto = _chunkUT7LQW6Vjs.parseAuto; exports.parseCompressed = _chunkUT7LQW6Vjs.parseCompressed; exports.pasteNotes = _chunkFQ3NEYIVjs.pasteNotes; exports.pasteNotesMultiMeasure = _chunkFQ3NEYIVjs.pasteNotesMultiMeasure; exports.pitchToSemitone = _chunkEWLB5X64js.pitchToSemitone; exports.raiseAccidental = _chunkFQ3NEYIVjs.raiseAccidental; exports.removeArticulation = _chunkFQ3NEYIVjs.removeArticulation; exports.removeBeam = _chunkFQ3NEYIVjs.removeBeam; exports.removeBowing = _chunkFQ3NEYIVjs.removeBowing; exports.removeBreathMark = _chunkFQ3NEYIVjs.removeBreathMark; exports.removeCaesura = _chunkFQ3NEYIVjs.removeCaesura; exports.removeChordSymbol = _chunkFQ3NEYIVjs.removeChordSymbol; exports.removeDynamics = _chunkFQ3NEYIVjs.removeDynamics; exports.removeEnding = _chunkFQ3NEYIVjs.removeEnding; exports.removeFermata = _chunkFQ3NEYIVjs.removeFermata; exports.removeFingering = _chunkFQ3NEYIVjs.removeFingering; exports.removeGraceNote = _chunkFQ3NEYIVjs.removeGraceNote; exports.removeHarmony = _chunkFQ3NEYIVjs.removeHarmony; exports.removeLyric = _chunkFQ3NEYIVjs.removeLyric; exports.removeNote = _chunkFQ3NEYIVjs.removeNote; exports.removeOctaveShift = _chunkFQ3NEYIVjs.removeOctaveShift; exports.removeOrnament = _chunkFQ3NEYIVjs.removeOrnament; exports.removePart = _chunkFQ3NEYIVjs.removePart; exports.removePedal = _chunkFQ3NEYIVjs.removePedal; exports.removeRepeat = _chunkFQ3NEYIVjs.removeRepeat; exports.removeRepeatBarline = _chunkFQ3NEYIVjs.removeRepeatBarline; exports.removeSlur = _chunkFQ3NEYIVjs.removeSlur; exports.removeStringNumber = _chunkFQ3NEYIVjs.removeStringNumber; exports.removeTempo = _chunkFQ3NEYIVjs.removeTempo; exports.removeTie = _chunkFQ3NEYIVjs.removeTie; exports.removeTuplet = _chunkFQ3NEYIVjs.removeTuplet; exports.removeWedge = _chunkFQ3NEYIVjs.removeWedge; exports.scoresEqual = _chunkEWLB5X64js.scoresEqual; exports.serialize = _chunkUT7LQW6Vjs.serialize; exports.serializeAbc = _chunkUT7LQW6Vjs.serializeAbc; exports.serializeAbcTunes = _chunkUT7LQW6Vjs.serializeAbcTunes; exports.serializeCompressed = _chunkUT7LQW6Vjs.serializeCompressed; exports.setBarline = _chunkFQ3NEYIVjs.setBarline; exports.setBeaming = _chunkFQ3NEYIVjs.setBeaming; exports.setColor = _chunkFQ3NEYIVjs.setColor; exports.setNotePitch = _chunkFQ3NEYIVjs.setNotePitch; exports.setNotePitchBySemitone = _chunkFQ3NEYIVjs.setNotePitchBySemitone; exports.setStaves = _chunkFQ3NEYIVjs.setStaves; exports.shiftNotePitch = _chunkFQ3NEYIVjs.shiftNotePitch; exports.stopOctaveShift = _chunkFQ3NEYIVjs.stopOctaveShift; exports.transpose = _chunkFQ3NEYIVjs.transpose; exports.transposeChecked = _chunkFQ3NEYIVjs.transposeChecked; exports.updateChordSymbol = _chunkFQ3NEYIVjs.updateChordSymbol; exports.updateHarmony = _chunkFQ3NEYIVjs.updateHarmony; exports.updateLyric = _chunkFQ3NEYIVjs.updateLyric; exports.validate = _chunkFQ3NEYIVjs.validate; exports.validateBackupForward = _chunkFQ3NEYIVjs.validateBackupForward; exports.validateBeams = _chunkFQ3NEYIVjs.validateBeams; exports.validateDivisions = _chunkFQ3NEYIVjs.validateDivisions; exports.validateMeasureDuration = _chunkFQ3NEYIVjs.validateMeasureDuration; exports.validateMeasureLocal = _chunkFQ3NEYIVjs.validateMeasureLocal; exports.validatePartReferences = _chunkFQ3NEYIVjs.validatePartReferences; exports.validatePartStructure = _chunkFQ3NEYIVjs.validatePartStructure; exports.validateSlurs = _chunkFQ3NEYIVjs.validateSlurs; exports.validateSlursAcrossMeasures = _chunkFQ3NEYIVjs.validateSlursAcrossMeasures; exports.validateStaffStructure = _chunkFQ3NEYIVjs.validateStaffStructure; exports.validateTies = _chunkFQ3NEYIVjs.validateTies; exports.validateTiesAcrossMeasures = _chunkFQ3NEYIVjs.validateTiesAcrossMeasures; exports.validateTuplets = _chunkFQ3NEYIVjs.validateTuplets; exports.validateVoiceStaff = _chunkFQ3NEYIVjs.validateVoiceStaff; exports.withAbsolutePositions = _chunkEWLB5X64js.withAbsolutePositions;
|
package/dist/browser.mjs
CHANGED
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
serializeAbc,
|
|
12
12
|
serializeAbcTunes,
|
|
13
13
|
serializeCompressed
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-T2USSS5E.mjs";
|
|
15
15
|
import {
|
|
16
16
|
getAllPartInfos,
|
|
17
17
|
getDirectionOfKind,
|
|
@@ -173,7 +173,7 @@ import {
|
|
|
173
173
|
validateTiesAcrossMeasures,
|
|
174
174
|
validateTuplets,
|
|
175
175
|
validateVoiceStaff
|
|
176
|
-
} from "./chunk-
|
|
176
|
+
} from "./chunk-I4X4GRMP.mjs";
|
|
177
177
|
import {
|
|
178
178
|
STEPS,
|
|
179
179
|
STEP_SEMITONES,
|
|
@@ -37,6 +37,47 @@ function generateId() {
|
|
|
37
37
|
return id;
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
+
// src/beams.ts
|
|
41
|
+
var BEAM_LEVELS = {
|
|
42
|
+
eighth: 1,
|
|
43
|
+
"16th": 2,
|
|
44
|
+
"32nd": 3,
|
|
45
|
+
"64th": 4,
|
|
46
|
+
"128th": 5,
|
|
47
|
+
"256th": 6,
|
|
48
|
+
"512th": 7,
|
|
49
|
+
"1024th": 8
|
|
50
|
+
};
|
|
51
|
+
function beamLevel(note) {
|
|
52
|
+
return note.rest || !note.noteType ? 0 : _nullishCoalesce(BEAM_LEVELS[note.noteType], () => ( 0));
|
|
53
|
+
}
|
|
54
|
+
function applyBeamGroup(group) {
|
|
55
|
+
const levels = group.map(beamLevel);
|
|
56
|
+
const beams = group.map(() => []);
|
|
57
|
+
const maxLevel = Math.max(...levels);
|
|
58
|
+
for (let lv = 1; lv <= maxLevel; lv++) {
|
|
59
|
+
for (let i = 0; i < group.length; ) {
|
|
60
|
+
if (levels[i] < lv) {
|
|
61
|
+
i++;
|
|
62
|
+
continue;
|
|
63
|
+
}
|
|
64
|
+
let j = i;
|
|
65
|
+
while (j + 1 < group.length && levels[j + 1] >= lv) j++;
|
|
66
|
+
if (i === j) {
|
|
67
|
+
beams[i].push({ number: lv, type: i === group.length - 1 ? "backward hook" : "forward hook" });
|
|
68
|
+
} else {
|
|
69
|
+
for (let k = i; k <= j; k++) {
|
|
70
|
+
beams[k].push({ number: lv, type: k === i ? "begin" : k === j ? "end" : "continue" });
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
i = j + 1;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
group.forEach((n, i) => {
|
|
77
|
+
n.beam = beams[i];
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
|
|
40
81
|
// src/validator/index.ts
|
|
41
82
|
var DEFAULT_OPTIONS = {
|
|
42
83
|
checkDivisions: true,
|
|
@@ -2635,7 +2676,7 @@ function addBeam(score, options) {
|
|
|
2635
2676
|
}
|
|
2636
2677
|
const result = cloneScoreAt(score, options.partIndex, options.measureIndex);
|
|
2637
2678
|
const measure = result.parts[options.partIndex].measures[options.measureIndex];
|
|
2638
|
-
const
|
|
2679
|
+
const beamLevel2 = _nullishCoalesce(options.beamLevel, () => ( 1));
|
|
2639
2680
|
const notes = [];
|
|
2640
2681
|
let noteCount = 0;
|
|
2641
2682
|
for (const entry of measure.entries) {
|
|
@@ -2658,7 +2699,7 @@ function addBeam(score, options) {
|
|
|
2658
2699
|
if (!note.beam) {
|
|
2659
2700
|
note.beam = [];
|
|
2660
2701
|
}
|
|
2661
|
-
note.beam = note.beam.filter((b) => b.number !==
|
|
2702
|
+
note.beam = note.beam.filter((b) => b.number !== beamLevel2);
|
|
2662
2703
|
let beamType;
|
|
2663
2704
|
if (i === 0) {
|
|
2664
2705
|
beamType = "begin";
|
|
@@ -2668,7 +2709,7 @@ function addBeam(score, options) {
|
|
|
2668
2709
|
beamType = "continue";
|
|
2669
2710
|
}
|
|
2670
2711
|
note.beam.push({
|
|
2671
|
-
number:
|
|
2712
|
+
number: beamLevel2,
|
|
2672
2713
|
type: beamType
|
|
2673
2714
|
});
|
|
2674
2715
|
}
|
|
@@ -2800,7 +2841,8 @@ function autoBeam(score, options) {
|
|
|
2800
2841
|
let currentBeat = -1;
|
|
2801
2842
|
let currentGroup = [];
|
|
2802
2843
|
for (const { note, position: notePos } of notes) {
|
|
2803
|
-
|
|
2844
|
+
const beamable = note.noteType ? beamLevel(note) > 0 : note.duration < beatDuration;
|
|
2845
|
+
if (!beamable || note.grace) {
|
|
2804
2846
|
if (currentGroup.length >= 2) {
|
|
2805
2847
|
beatGroups.push(currentGroup);
|
|
2806
2848
|
}
|
|
@@ -2823,22 +2865,11 @@ function autoBeam(score, options) {
|
|
|
2823
2865
|
beatGroups.push(currentGroup);
|
|
2824
2866
|
}
|
|
2825
2867
|
for (const group of beatGroups) {
|
|
2826
|
-
|
|
2827
|
-
|
|
2828
|
-
|
|
2829
|
-
|
|
2830
|
-
|
|
2831
|
-
let beamType;
|
|
2832
|
-
if (i === 0) {
|
|
2833
|
-
beamType = "begin";
|
|
2834
|
-
} else if (i === group.length - 1) {
|
|
2835
|
-
beamType = "end";
|
|
2836
|
-
} else {
|
|
2837
|
-
beamType = "continue";
|
|
2838
|
-
}
|
|
2839
|
-
note.beam.push({
|
|
2840
|
-
number: 1,
|
|
2841
|
-
type: beamType
|
|
2868
|
+
if (group.every(({ note }) => note.noteType)) {
|
|
2869
|
+
applyBeamGroup(group.map(({ note }) => note));
|
|
2870
|
+
} else {
|
|
2871
|
+
group.forEach(({ note }, i) => {
|
|
2872
|
+
note.beam = [{ number: 1, type: i === 0 ? "begin" : i === group.length - 1 ? "end" : "continue" }];
|
|
2842
2873
|
});
|
|
2843
2874
|
}
|
|
2844
2875
|
}
|
|
@@ -5158,4 +5189,6 @@ var removeRepeat = removeRepeatBarline;
|
|
|
5158
5189
|
|
|
5159
5190
|
|
|
5160
5191
|
|
|
5161
|
-
|
|
5192
|
+
|
|
5193
|
+
|
|
5194
|
+
exports.generateId = generateId; exports.beamLevel = beamLevel; exports.applyBeamGroup = applyBeamGroup; exports.validate = validate; exports.validateDivisions = validateDivisions; exports.validateMeasureDuration = validateMeasureDuration; exports.validateBackupForward = validateBackupForward; exports.validateTies = validateTies; exports.validateBeams = validateBeams; exports.validateSlurs = validateSlurs; exports.validateTuplets = validateTuplets; exports.validatePartReferences = validatePartReferences; exports.validateVoiceStaff = validateVoiceStaff; exports.validatePartStructure = validatePartStructure; exports.validateStaffStructure = validateStaffStructure; exports.validateMeasureLocal = validateMeasureLocal; exports.getMeasureContext = getMeasureContext; exports.assertMeasureValid = assertMeasureValid; exports.isValid = isValid; exports.assertValid = assertValid; exports.formatLocation = formatLocation; exports.ValidationException = ValidationException; exports.validateTiesAcrossMeasures = validateTiesAcrossMeasures; exports.validateSlursAcrossMeasures = validateSlursAcrossMeasures; exports.insertNote = insertNote; exports.removeNote = removeNote; exports.addChord = addChord; exports.changeNoteDuration = changeNoteDuration; exports.setNotePitch = setNotePitch; exports.setNotePitchBySemitone = setNotePitchBySemitone; exports.shiftNotePitch = shiftNotePitch; exports.raiseAccidental = raiseAccidental; exports.lowerAccidental = lowerAccidental; exports.addVoice = addVoice; exports.transpose = transpose; exports.addPart = addPart; exports.removePart = removePart; exports.duplicatePart = duplicatePart; exports.setStaves = setStaves; exports.moveNoteToStaff = moveNoteToStaff; exports.changeKey = changeKey; exports.changeTime = changeTime; exports.insertMeasure = insertMeasure; exports.deleteMeasure = deleteMeasure; exports.addTie = addTie; exports.removeTie = removeTie; exports.addSlur = addSlur; exports.removeSlur = removeSlur; exports.addArticulation = addArticulation; exports.removeArticulation = removeArticulation; exports.addDynamics = addDynamics; exports.removeDynamics = removeDynamics; exports.modifyDynamics = modifyDynamics; exports.insertClefChange = insertClefChange; exports.addNote = addNote; exports.deleteNote = deleteNote; exports.addChordNote = addChordNote; exports.modifyNotePitch = modifyNotePitch; exports.modifyNoteDuration = modifyNoteDuration; exports.addNoteChecked = addNoteChecked; exports.deleteNoteChecked = deleteNoteChecked; exports.addChordNoteChecked = addChordNoteChecked; exports.modifyNotePitchChecked = modifyNotePitchChecked; exports.modifyNoteDurationChecked = modifyNoteDurationChecked; exports.transposeChecked = transposeChecked; exports.createTuplet = createTuplet; exports.removeTuplet = removeTuplet; exports.addBeam = addBeam; exports.removeBeam = removeBeam; exports.autoBeam = autoBeam; exports.copyNotes = copyNotes; exports.pasteNotes = pasteNotes; exports.cutNotes = cutNotes; exports.copyNotesMultiMeasure = copyNotesMultiMeasure; exports.pasteNotesMultiMeasure = pasteNotesMultiMeasure; exports.addTempo = addTempo; exports.removeTempo = removeTempo; exports.modifyTempo = modifyTempo; exports.addWedge = addWedge; exports.removeWedge = removeWedge; exports.addFermata = addFermata; exports.removeFermata = removeFermata; exports.addOrnament = addOrnament; exports.removeOrnament = removeOrnament; exports.addPedal = addPedal; exports.removePedal = removePedal; exports.addTextDirection = addTextDirection; exports.addRehearsalMark = addRehearsalMark; exports.addRepeatBarline = addRepeatBarline; exports.removeRepeatBarline = removeRepeatBarline; exports.addEnding = addEnding; exports.removeEnding = removeEnding; exports.changeBarline = changeBarline; exports.addSegno = addSegno; exports.addCoda = addCoda; exports.addDaCapo = addDaCapo; exports.addDalSegno = addDalSegno; exports.addFine = addFine; exports.addToCoda = addToCoda; exports.addGraceNote = addGraceNote; exports.removeGraceNote = removeGraceNote; exports.convertToGrace = convertToGrace; exports.addLyric = addLyric; exports.removeLyric = removeLyric; exports.updateLyric = updateLyric; exports.addHarmony = addHarmony; exports.removeHarmony = removeHarmony; exports.updateHarmony = updateHarmony; exports.addFingering = addFingering; exports.removeFingering = removeFingering; exports.addBowing = addBowing; exports.removeBowing = removeBowing; exports.addStringNumber = addStringNumber; exports.removeStringNumber = removeStringNumber; exports.addOctaveShift = addOctaveShift; exports.stopOctaveShift = stopOctaveShift; exports.removeOctaveShift = removeOctaveShift; exports.addBreathMark = addBreathMark; exports.removeBreathMark = removeBreathMark; exports.addCaesura = addCaesura; exports.removeCaesura = removeCaesura; exports.ALL_COLOR_TARGETS = ALL_COLOR_TARGETS; exports.setColor = setColor; exports.clearColors = clearColors; exports.addText = addText; exports.setBeaming = setBeaming; exports.addChordSymbol = addChordSymbol; exports.removeChordSymbol = removeChordSymbol; exports.updateChordSymbol = updateChordSymbol; exports.changeClef = changeClef; exports.setBarline = setBarline; exports.addRepeat = addRepeat; exports.removeRepeat = removeRepeat;
|
|
@@ -37,6 +37,47 @@ function generateId() {
|
|
|
37
37
|
return id;
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
+
// src/beams.ts
|
|
41
|
+
var BEAM_LEVELS = {
|
|
42
|
+
eighth: 1,
|
|
43
|
+
"16th": 2,
|
|
44
|
+
"32nd": 3,
|
|
45
|
+
"64th": 4,
|
|
46
|
+
"128th": 5,
|
|
47
|
+
"256th": 6,
|
|
48
|
+
"512th": 7,
|
|
49
|
+
"1024th": 8
|
|
50
|
+
};
|
|
51
|
+
function beamLevel(note) {
|
|
52
|
+
return note.rest || !note.noteType ? 0 : BEAM_LEVELS[note.noteType] ?? 0;
|
|
53
|
+
}
|
|
54
|
+
function applyBeamGroup(group) {
|
|
55
|
+
const levels = group.map(beamLevel);
|
|
56
|
+
const beams = group.map(() => []);
|
|
57
|
+
const maxLevel = Math.max(...levels);
|
|
58
|
+
for (let lv = 1; lv <= maxLevel; lv++) {
|
|
59
|
+
for (let i = 0; i < group.length; ) {
|
|
60
|
+
if (levels[i] < lv) {
|
|
61
|
+
i++;
|
|
62
|
+
continue;
|
|
63
|
+
}
|
|
64
|
+
let j = i;
|
|
65
|
+
while (j + 1 < group.length && levels[j + 1] >= lv) j++;
|
|
66
|
+
if (i === j) {
|
|
67
|
+
beams[i].push({ number: lv, type: i === group.length - 1 ? "backward hook" : "forward hook" });
|
|
68
|
+
} else {
|
|
69
|
+
for (let k = i; k <= j; k++) {
|
|
70
|
+
beams[k].push({ number: lv, type: k === i ? "begin" : k === j ? "end" : "continue" });
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
i = j + 1;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
group.forEach((n, i) => {
|
|
77
|
+
n.beam = beams[i];
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
|
|
40
81
|
// src/validator/index.ts
|
|
41
82
|
var DEFAULT_OPTIONS = {
|
|
42
83
|
checkDivisions: true,
|
|
@@ -2635,7 +2676,7 @@ function addBeam(score, options) {
|
|
|
2635
2676
|
}
|
|
2636
2677
|
const result = cloneScoreAt(score, options.partIndex, options.measureIndex);
|
|
2637
2678
|
const measure = result.parts[options.partIndex].measures[options.measureIndex];
|
|
2638
|
-
const
|
|
2679
|
+
const beamLevel2 = options.beamLevel ?? 1;
|
|
2639
2680
|
const notes = [];
|
|
2640
2681
|
let noteCount = 0;
|
|
2641
2682
|
for (const entry of measure.entries) {
|
|
@@ -2658,7 +2699,7 @@ function addBeam(score, options) {
|
|
|
2658
2699
|
if (!note.beam) {
|
|
2659
2700
|
note.beam = [];
|
|
2660
2701
|
}
|
|
2661
|
-
note.beam = note.beam.filter((b) => b.number !==
|
|
2702
|
+
note.beam = note.beam.filter((b) => b.number !== beamLevel2);
|
|
2662
2703
|
let beamType;
|
|
2663
2704
|
if (i === 0) {
|
|
2664
2705
|
beamType = "begin";
|
|
@@ -2668,7 +2709,7 @@ function addBeam(score, options) {
|
|
|
2668
2709
|
beamType = "continue";
|
|
2669
2710
|
}
|
|
2670
2711
|
note.beam.push({
|
|
2671
|
-
number:
|
|
2712
|
+
number: beamLevel2,
|
|
2672
2713
|
type: beamType
|
|
2673
2714
|
});
|
|
2674
2715
|
}
|
|
@@ -2800,7 +2841,8 @@ function autoBeam(score, options) {
|
|
|
2800
2841
|
let currentBeat = -1;
|
|
2801
2842
|
let currentGroup = [];
|
|
2802
2843
|
for (const { note, position: notePos } of notes) {
|
|
2803
|
-
|
|
2844
|
+
const beamable = note.noteType ? beamLevel(note) > 0 : note.duration < beatDuration;
|
|
2845
|
+
if (!beamable || note.grace) {
|
|
2804
2846
|
if (currentGroup.length >= 2) {
|
|
2805
2847
|
beatGroups.push(currentGroup);
|
|
2806
2848
|
}
|
|
@@ -2823,22 +2865,11 @@ function autoBeam(score, options) {
|
|
|
2823
2865
|
beatGroups.push(currentGroup);
|
|
2824
2866
|
}
|
|
2825
2867
|
for (const group of beatGroups) {
|
|
2826
|
-
|
|
2827
|
-
|
|
2828
|
-
|
|
2829
|
-
|
|
2830
|
-
|
|
2831
|
-
let beamType;
|
|
2832
|
-
if (i === 0) {
|
|
2833
|
-
beamType = "begin";
|
|
2834
|
-
} else if (i === group.length - 1) {
|
|
2835
|
-
beamType = "end";
|
|
2836
|
-
} else {
|
|
2837
|
-
beamType = "continue";
|
|
2838
|
-
}
|
|
2839
|
-
note.beam.push({
|
|
2840
|
-
number: 1,
|
|
2841
|
-
type: beamType
|
|
2868
|
+
if (group.every(({ note }) => note.noteType)) {
|
|
2869
|
+
applyBeamGroup(group.map(({ note }) => note));
|
|
2870
|
+
} else {
|
|
2871
|
+
group.forEach(({ note }, i) => {
|
|
2872
|
+
note.beam = [{ number: 1, type: i === 0 ? "begin" : i === group.length - 1 ? "end" : "continue" }];
|
|
2842
2873
|
});
|
|
2843
2874
|
}
|
|
2844
2875
|
}
|
|
@@ -5028,6 +5059,8 @@ var removeRepeat = removeRepeatBarline;
|
|
|
5028
5059
|
|
|
5029
5060
|
export {
|
|
5030
5061
|
generateId,
|
|
5062
|
+
beamLevel,
|
|
5063
|
+
applyBeamGroup,
|
|
5031
5064
|
validate,
|
|
5032
5065
|
validateDivisions,
|
|
5033
5066
|
validateMeasureDuration,
|