musicxml-io 0.2.11 → 0.2.12
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 +44 -0
- package/dist/{index-C9zaOJxW.d.mts → index-DPW0wqXK.d.mts} +1 -1
- package/dist/{index-2mOfy1m5.d.ts → index-DkvcsWdo.d.ts} +1 -1
- package/dist/index.d.mts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +67 -44
- package/dist/index.mjs +67 -44
- package/dist/operations/index.d.mts +2 -2
- package/dist/operations/index.d.ts +2 -2
- package/dist/operations/index.js +4 -4
- package/dist/operations/index.mjs +4 -4
- package/dist/query/index.d.mts +1 -1
- package/dist/query/index.d.ts +1 -1
- package/dist/{types-Bpq2o5JS.d.mts → types-JohtsbUB.d.mts} +1 -0
- package/dist/{types-Bpq2o5JS.d.ts → types-JohtsbUB.d.ts} +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -330,6 +330,50 @@ This feature enables:
|
|
|
330
330
|
| Node coverage | 99.9% |
|
|
331
331
|
| Attribute coverage | 95.9% |
|
|
332
332
|
|
|
333
|
+
## Contributing
|
|
334
|
+
|
|
335
|
+
Contributions are welcome! Whether it's bug reports, feature requests, documentation improvements, or code contributions, we appreciate your help in making this library better.
|
|
336
|
+
|
|
337
|
+
### Development Setup
|
|
338
|
+
|
|
339
|
+
```bash
|
|
340
|
+
# Clone the repository
|
|
341
|
+
git clone https://github.com/tan-z-tan/musicxml-io.git
|
|
342
|
+
cd musicxml-io
|
|
343
|
+
|
|
344
|
+
# Install dependencies
|
|
345
|
+
npm install
|
|
346
|
+
|
|
347
|
+
# Run tests
|
|
348
|
+
npm test
|
|
349
|
+
|
|
350
|
+
# Build
|
|
351
|
+
npm run build
|
|
352
|
+
|
|
353
|
+
# Type check
|
|
354
|
+
npm run typecheck
|
|
355
|
+
|
|
356
|
+
# Lint
|
|
357
|
+
npm run lint
|
|
358
|
+
```
|
|
359
|
+
|
|
360
|
+
### How to Contribute
|
|
361
|
+
|
|
362
|
+
1. Fork the repository
|
|
363
|
+
2. Create a feature branch (`git checkout -b feature/amazing-feature`)
|
|
364
|
+
3. Make your changes
|
|
365
|
+
4. Run tests to ensure everything works (`npm test`)
|
|
366
|
+
5. Commit your changes (`git commit -m 'Add amazing feature'`)
|
|
367
|
+
6. Push to the branch (`git push origin feature/amazing-feature`)
|
|
368
|
+
7. Open a Pull Request
|
|
369
|
+
|
|
370
|
+
### Guidelines
|
|
371
|
+
|
|
372
|
+
- Write tests for new features
|
|
373
|
+
- Follow the existing code style
|
|
374
|
+
- Update documentation as needed
|
|
375
|
+
- Keep PRs focused on a single change
|
|
376
|
+
|
|
333
377
|
## License
|
|
334
378
|
|
|
335
379
|
MIT
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { S as Score, M as Measure, n as TimeSignature, f as Part, P as Pitch, N as NoteEntry, K as KeySignature, C as Clef, ac as ArticulationType, m as DynamicsValue, ad as OrnamentType, i as NoteType } from './types-
|
|
1
|
+
import { S as Score, M as Measure, n as TimeSignature, f as Part, P as Pitch, N as NoteEntry, K as KeySignature, C as Clef, ac as ArticulationType, m as DynamicsValue, ad as OrnamentType, i as NoteType } from './types-JohtsbUB.mjs';
|
|
2
2
|
|
|
3
3
|
type ValidationErrorCode = 'MISSING_DIVISIONS' | 'INVALID_DIVISIONS' | 'MEASURE_DURATION_MISMATCH' | 'MEASURE_DURATION_OVERFLOW' | 'MEASURE_DURATION_UNDERFLOW' | 'VOICE_INCOMPLETE' | 'VOICE_GAP' | 'NEGATIVE_POSITION' | 'BACKUP_EXCEEDS_POSITION' | 'TIE_START_WITHOUT_STOP' | 'TIE_STOP_WITHOUT_START' | 'TIE_PITCH_MISMATCH' | 'BEAM_BEGIN_WITHOUT_END' | 'BEAM_END_WITHOUT_BEGIN' | 'SLUR_START_WITHOUT_STOP' | 'SLUR_STOP_WITHOUT_START' | 'TUPLET_START_WITHOUT_STOP' | 'TUPLET_STOP_WITHOUT_START' | 'PART_ID_NOT_IN_PART_LIST' | 'PART_LIST_ID_NOT_IN_PARTS' | 'PART_MEASURE_COUNT_MISMATCH' | 'PART_MEASURE_NUMBER_MISMATCH' | 'PART_GROUP_START_WITHOUT_STOP' | 'PART_GROUP_STOP_WITHOUT_START' | 'DUPLICATE_PART_ID' | 'INVALID_VOICE_NUMBER' | 'INVALID_STAFF_NUMBER' | 'STAFF_EXCEEDS_STAVES' | 'MISSING_STAVES_DECLARATION' | 'STAVES_DECLARATION_MISMATCH' | 'MISSING_CLEF_FOR_STAFF' | 'CLEF_STAFF_EXCEEDS_STAVES' | 'INVALID_DURATION' | 'EMPTY_MEASURE';
|
|
4
4
|
type ValidationLevel = 'error' | 'warning' | 'info';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { S as Score, M as Measure, n as TimeSignature, f as Part, P as Pitch, N as NoteEntry, K as KeySignature, C as Clef, ac as ArticulationType, m as DynamicsValue, ad as OrnamentType, i as NoteType } from './types-
|
|
1
|
+
import { S as Score, M as Measure, n as TimeSignature, f as Part, P as Pitch, N as NoteEntry, K as KeySignature, C as Clef, ac as ArticulationType, m as DynamicsValue, ad as OrnamentType, i as NoteType } from './types-JohtsbUB.js';
|
|
2
2
|
|
|
3
3
|
type ValidationErrorCode = 'MISSING_DIVISIONS' | 'INVALID_DIVISIONS' | 'MEASURE_DURATION_MISMATCH' | 'MEASURE_DURATION_OVERFLOW' | 'MEASURE_DURATION_UNDERFLOW' | 'VOICE_INCOMPLETE' | 'VOICE_GAP' | 'NEGATIVE_POSITION' | 'BACKUP_EXCEEDS_POSITION' | 'TIE_START_WITHOUT_STOP' | 'TIE_STOP_WITHOUT_START' | 'TIE_PITCH_MISMATCH' | 'BEAM_BEGIN_WITHOUT_END' | 'BEAM_END_WITHOUT_BEGIN' | 'SLUR_START_WITHOUT_STOP' | 'SLUR_STOP_WITHOUT_START' | 'TUPLET_START_WITHOUT_STOP' | 'TUPLET_STOP_WITHOUT_START' | 'PART_ID_NOT_IN_PART_LIST' | 'PART_LIST_ID_NOT_IN_PARTS' | 'PART_MEASURE_COUNT_MISMATCH' | 'PART_MEASURE_NUMBER_MISMATCH' | 'PART_GROUP_START_WITHOUT_STOP' | 'PART_GROUP_STOP_WITHOUT_START' | 'DUPLICATE_PART_ID' | 'INVALID_VOICE_NUMBER' | 'INVALID_STAFF_NUMBER' | 'STAFF_EXCEEDS_STAVES' | 'MISSING_STAVES_DECLARATION' | 'STAVES_DECLARATION_MISMATCH' | 'MISSING_CLEF_FOR_STAFF' | 'CLEF_STAFF_EXCEEDS_STAVES' | 'INVALID_DURATION' | 'EMPTY_MEASURE';
|
|
4
4
|
type ValidationLevel = 'error' | 'warning' | 'info';
|
package/dist/index.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { S as Score, P as Pitch, M as Measure, D as DirectionType, a as DirectionEntry, N as NoteEntry, b as PartListEntry, c as PartInfo } from './types-
|
|
2
|
-
export { A as Accidental, j as AccidentalInfo, O as AdjacentNotes, a4 as AssembledLyrics, B as BackupEntry, p as Barline, a5 as BarlineWithContext, a0 as BeamGroup, k as BeamInfo, s as Chord, C as Clef, aa as ClefChangeInfo, w as Credit, v as Defaults, Q as DirectionKind, z as DirectionWithContext, R as DynamicWithContext, m as DynamicsValue, a7 as EndingInfo, E as EntryWithContext, F as ForwardEntry, a2 as HarmonyWithContext, a8 as KeyChangeInfo, K as KeySignature, L as Lyric, a3 as LyricWithContext, g as MeasureAttributes, h as MeasureEntry, l as Notation, a1 as NotationType, t as NoteIteratorItem, i as NoteType, y as NoteWithContext, r as NoteWithPosition, Y as OctaveShiftWithContext, f as Part, e as PartGroup, W as PedalWithContext, H as PositionQueryOptions, u as Print, a6 as RepeatInfo, d as ScoreMetadata, _ as SlurSpan, q as StaffGroup, G as StaffRange, ab as StructuralChanges, U as TempoWithContext, T as TieInfo, Z as TiedNoteGroup, a9 as TimeChangeInfo, n as TimeSignature, o as Transpose, $ as TupletGroup, I as VerticalSlice, V as VoiceGroup, J as VoiceLine, x as VoiceToStaffMap, X as WedgeWithContext } from './types-
|
|
3
|
-
import { V as ValidateOptions, a as ValidationResult } from './index-
|
|
4
|
-
export { ba as AddArticulationOptions, bj as AddBeamOptions, c8 as AddBowingOptions, ch as AddBreathMarkOptions, ck as AddCaesuraOptions, aW as AddChordOptions, c2 as AddChordSymbolOptions, bS as AddCodaOptions, bc as AddDynamicsOptions, bM as AddEndingOptions, bz as AddFermataOptions, c5 as AddFingeringOptions, bU as AddGraceNoteOptions, b$ as AddHarmonyOptions, bX as AddLyricOptions, bT as AddNavigationOptions, cd as AddOctaveShiftOptions, bB as AddOrnamentOptions, b2 as AddPartOptions, bD as AddPedalOptions, bH as AddRehearsalMarkOptions, bI as AddRepeatBarlineOptions, bK as AddRepeatOptions, bR as AddSegnoOptions, b8 as AddSlurOptions, ca as AddStringNumberOptions, bu as AddTempoOptions, bF as AddTextDirectionOptions, bG as AddTextOptions, b6 as AddTieOptions, b1 as AddVoiceOptions, bx as AddWedgeOptions, bl as AutoBeamOptions, bQ as BarStyle, c7 as BowingType, cg as BreathMarkValue, cj as CaesuraValue, bO as ChangeBarlineOptions, bg as ChangeClefOptions, aX as ChangeNoteDurationOptions, bW as ConvertToGraceOptions, br as CopyNotesMultiMeasureOptions, bo as CopyNotesOptions, bh as CreateTupletOptions, bq as CutNotesOptions, b3 as DuplicatePartOptions, b_ as HarmonyKind, bf as InsertClefChangeOptions, aU as InsertNoteOptions, cM as LocalValidateOptions, b0 as LowerAccidentalOptions, cL as MeasureValidationContext, be as ModifyDynamicsOptions, bw as ModifyTempoOptions, b5 as MoveNoteToStaffOptions, bs as MultiMeasureSelection, bn as NoteSelection, cc as OctaveShiftType, aT as OperationErrorCode, aS as OperationResult, bt as PasteNotesMultiMeasureOptions, bp as PasteNotesOptions, a$ as RaiseAccidentalOptions, bb as RemoveArticulationOptions, bk as RemoveBeamOptions, c9 as RemoveBowingOptions, ci as RemoveBreathMarkOptions, cl as RemoveCaesuraOptions, c3 as RemoveChordSymbolOptions, bd as RemoveDynamicsOptions, bN as RemoveEndingOptions, bA as RemoveFermataOptions, c6 as RemoveFingeringOptions, bV as RemoveGraceNoteOptions, c0 as RemoveHarmonyOptions, bY as RemoveLyricOptions, aV as RemoveNoteOptions, cf as RemoveOctaveShiftOptions, bC as RemoveOrnamentOptions, bE as RemovePedalOptions, bJ as RemoveRepeatBarlineOptions, bL as RemoveRepeatOptions, b9 as RemoveSlurOptions, cb as RemoveStringNumberOptions, bv as RemoveTempoOptions, b7 as RemoveTieOptions, bi as RemoveTupletOptions, by as RemoveWedgeOptions, bP as SetBarlineOptions, bm as SetBeamingOptions, aZ as SetNotePitchBySemitoneOptions, aY as SetNotePitchOptions, b4 as SetStavesOptions, a_ as ShiftNotePitchOptions, ce as StopOctaveShiftOptions, c4 as UpdateChordSymbolOptions, c1 as UpdateHarmonyOptions, bZ as UpdateLyricOptions, cH as ValidationError, cJ as ValidationErrorCode, cD as ValidationException, cK as ValidationLevel, cI as ValidationLocation, K as addArticulation, T as addBeam, aH as addBowing, aO as addBreathMark, aQ as addCaesura, b as addChord, j as addChordNote, p as addChordNoteChecked, aC as addChordSymbol, ao as addCoda, ap as addDaCapo, aq as addDalSegno, M as addDynamics, aj as addEnding, a6 as addFermata, ar as addFine, aF as addFingering, at as addGraceNote, az as addHarmony, aw as addLyric, g as addNote, n as addNoteChecked, aL as addOctaveShift, a8 as addOrnament, x as addPart, aa as addPedal, ae as addRehearsalMark, ah as addRepeat, af as addRepeatBarline, an as addSegno, I as addSlur, aJ as addStringNumber, a1 as addTempo, ad as addText, ac as addTextDirection, G as addTie, as as addToCoda, w as addVoice, a4 as addWedge, cG as assertMeasureValid, co as assertValid, W as autoBeam, al as changeBarline, Q as changeClef, C as changeKey, e as changeNoteDuration, D as changeTime, av as convertToGrace, Y as copyNotes, $ as copyNotesMultiMeasure, R as createTuplet, _ as cutNotes, F as deleteMeasure, h as deleteNote, o as deleteNoteChecked, z as duplicatePart, cC as formatLocation, cF as getMeasureContext, P as insertClefChange, E as insertMeasure, i as insertNote, cn as isValid, l as lowerAccidental, O as modifyDynamics, k as modifyNoteDuration, u as modifyNoteDurationChecked, m as modifyNotePitch, q as modifyNotePitchChecked, a3 as modifyTempo, B as moveNoteToStaff, Z as pasteNotes, a0 as pasteNotesMultiMeasure, f as raiseAccidental, L as removeArticulation, U as removeBeam, aI as removeBowing, aP as removeBreathMark, aR as removeCaesura, aD as removeChordSymbol, N as removeDynamics, ak as removeEnding, a7 as removeFermata, aG as removeFingering, au as removeGraceNote, aA as removeHarmony, ax as removeLyric, r as removeNote, aN as removeOctaveShift, a9 as removeOrnament, y as removePart, ab as removePedal, ai as removeRepeat, ag as removeRepeatBarline, J as removeSlur, aK as removeStringNumber, a2 as removeTempo, H as removeTie, S as removeTuplet, a5 as removeWedge, am as setBarline, X as setBeaming, s as setNotePitch, c as setNotePitchBySemitone, A as setStaves, d as shiftNotePitch, aM as stopOctaveShift, t as transpose, v as transposeChecked, aE as updateChordSymbol, aB as updateHarmony, ay as updateLyric, cm as validate, cr as validateBackupForward, ct as validateBeams, cp as validateDivisions, cq as validateMeasureDuration, cE as validateMeasureLocal, cw as validatePartReferences, cx as validatePartStructure, cu as validateSlurs, cB as validateSlursAcrossMeasures, cy as validateStaffStructure, cs as validateTies, cA as validateTiesAcrossMeasures, cv as validateTuplets, cz as validateVoiceStaff } from './index-
|
|
1
|
+
import { S as Score, P as Pitch, M as Measure, D as DirectionType, a as DirectionEntry, N as NoteEntry, b as PartListEntry, c as PartInfo } from './types-JohtsbUB.mjs';
|
|
2
|
+
export { A as Accidental, j as AccidentalInfo, O as AdjacentNotes, a4 as AssembledLyrics, B as BackupEntry, p as Barline, a5 as BarlineWithContext, a0 as BeamGroup, k as BeamInfo, s as Chord, C as Clef, aa as ClefChangeInfo, w as Credit, v as Defaults, Q as DirectionKind, z as DirectionWithContext, R as DynamicWithContext, m as DynamicsValue, a7 as EndingInfo, E as EntryWithContext, F as ForwardEntry, a2 as HarmonyWithContext, a8 as KeyChangeInfo, K as KeySignature, L as Lyric, a3 as LyricWithContext, g as MeasureAttributes, h as MeasureEntry, l as Notation, a1 as NotationType, t as NoteIteratorItem, i as NoteType, y as NoteWithContext, r as NoteWithPosition, Y as OctaveShiftWithContext, f as Part, e as PartGroup, W as PedalWithContext, H as PositionQueryOptions, u as Print, a6 as RepeatInfo, d as ScoreMetadata, _ as SlurSpan, q as StaffGroup, G as StaffRange, ab as StructuralChanges, U as TempoWithContext, T as TieInfo, Z as TiedNoteGroup, a9 as TimeChangeInfo, n as TimeSignature, o as Transpose, $ as TupletGroup, I as VerticalSlice, V as VoiceGroup, J as VoiceLine, x as VoiceToStaffMap, X as WedgeWithContext } from './types-JohtsbUB.mjs';
|
|
3
|
+
import { V as ValidateOptions, a as ValidationResult } from './index-DPW0wqXK.mjs';
|
|
4
|
+
export { ba as AddArticulationOptions, bj as AddBeamOptions, c8 as AddBowingOptions, ch as AddBreathMarkOptions, ck as AddCaesuraOptions, aW as AddChordOptions, c2 as AddChordSymbolOptions, bS as AddCodaOptions, bc as AddDynamicsOptions, bM as AddEndingOptions, bz as AddFermataOptions, c5 as AddFingeringOptions, bU as AddGraceNoteOptions, b$ as AddHarmonyOptions, bX as AddLyricOptions, bT as AddNavigationOptions, cd as AddOctaveShiftOptions, bB as AddOrnamentOptions, b2 as AddPartOptions, bD as AddPedalOptions, bH as AddRehearsalMarkOptions, bI as AddRepeatBarlineOptions, bK as AddRepeatOptions, bR as AddSegnoOptions, b8 as AddSlurOptions, ca as AddStringNumberOptions, bu as AddTempoOptions, bF as AddTextDirectionOptions, bG as AddTextOptions, b6 as AddTieOptions, b1 as AddVoiceOptions, bx as AddWedgeOptions, bl as AutoBeamOptions, bQ as BarStyle, c7 as BowingType, cg as BreathMarkValue, cj as CaesuraValue, bO as ChangeBarlineOptions, bg as ChangeClefOptions, aX as ChangeNoteDurationOptions, bW as ConvertToGraceOptions, br as CopyNotesMultiMeasureOptions, bo as CopyNotesOptions, bh as CreateTupletOptions, bq as CutNotesOptions, b3 as DuplicatePartOptions, b_ as HarmonyKind, bf as InsertClefChangeOptions, aU as InsertNoteOptions, cM as LocalValidateOptions, b0 as LowerAccidentalOptions, cL as MeasureValidationContext, be as ModifyDynamicsOptions, bw as ModifyTempoOptions, b5 as MoveNoteToStaffOptions, bs as MultiMeasureSelection, bn as NoteSelection, cc as OctaveShiftType, aT as OperationErrorCode, aS as OperationResult, bt as PasteNotesMultiMeasureOptions, bp as PasteNotesOptions, a$ as RaiseAccidentalOptions, bb as RemoveArticulationOptions, bk as RemoveBeamOptions, c9 as RemoveBowingOptions, ci as RemoveBreathMarkOptions, cl as RemoveCaesuraOptions, c3 as RemoveChordSymbolOptions, bd as RemoveDynamicsOptions, bN as RemoveEndingOptions, bA as RemoveFermataOptions, c6 as RemoveFingeringOptions, bV as RemoveGraceNoteOptions, c0 as RemoveHarmonyOptions, bY as RemoveLyricOptions, aV as RemoveNoteOptions, cf as RemoveOctaveShiftOptions, bC as RemoveOrnamentOptions, bE as RemovePedalOptions, bJ as RemoveRepeatBarlineOptions, bL as RemoveRepeatOptions, b9 as RemoveSlurOptions, cb as RemoveStringNumberOptions, bv as RemoveTempoOptions, b7 as RemoveTieOptions, bi as RemoveTupletOptions, by as RemoveWedgeOptions, bP as SetBarlineOptions, bm as SetBeamingOptions, aZ as SetNotePitchBySemitoneOptions, aY as SetNotePitchOptions, b4 as SetStavesOptions, a_ as ShiftNotePitchOptions, ce as StopOctaveShiftOptions, c4 as UpdateChordSymbolOptions, c1 as UpdateHarmonyOptions, bZ as UpdateLyricOptions, cH as ValidationError, cJ as ValidationErrorCode, cD as ValidationException, cK as ValidationLevel, cI as ValidationLocation, K as addArticulation, T as addBeam, aH as addBowing, aO as addBreathMark, aQ as addCaesura, b as addChord, j as addChordNote, p as addChordNoteChecked, aC as addChordSymbol, ao as addCoda, ap as addDaCapo, aq as addDalSegno, M as addDynamics, aj as addEnding, a6 as addFermata, ar as addFine, aF as addFingering, at as addGraceNote, az as addHarmony, aw as addLyric, g as addNote, n as addNoteChecked, aL as addOctaveShift, a8 as addOrnament, x as addPart, aa as addPedal, ae as addRehearsalMark, ah as addRepeat, af as addRepeatBarline, an as addSegno, I as addSlur, aJ as addStringNumber, a1 as addTempo, ad as addText, ac as addTextDirection, G as addTie, as as addToCoda, w as addVoice, a4 as addWedge, cG as assertMeasureValid, co as assertValid, W as autoBeam, al as changeBarline, Q as changeClef, C as changeKey, e as changeNoteDuration, D as changeTime, av as convertToGrace, Y as copyNotes, $ as copyNotesMultiMeasure, R as createTuplet, _ as cutNotes, F as deleteMeasure, h as deleteNote, o as deleteNoteChecked, z as duplicatePart, cC as formatLocation, cF as getMeasureContext, P as insertClefChange, E as insertMeasure, i as insertNote, cn as isValid, l as lowerAccidental, O as modifyDynamics, k as modifyNoteDuration, u as modifyNoteDurationChecked, m as modifyNotePitch, q as modifyNotePitchChecked, a3 as modifyTempo, B as moveNoteToStaff, Z as pasteNotes, a0 as pasteNotesMultiMeasure, f as raiseAccidental, L as removeArticulation, U as removeBeam, aI as removeBowing, aP as removeBreathMark, aR as removeCaesura, aD as removeChordSymbol, N as removeDynamics, ak as removeEnding, a7 as removeFermata, aG as removeFingering, au as removeGraceNote, aA as removeHarmony, ax as removeLyric, r as removeNote, aN as removeOctaveShift, a9 as removeOrnament, y as removePart, ab as removePedal, ai as removeRepeat, ag as removeRepeatBarline, J as removeSlur, aK as removeStringNumber, a2 as removeTempo, H as removeTie, S as removeTuplet, a5 as removeWedge, am as setBarline, X as setBeaming, s as setNotePitch, c as setNotePitchBySemitone, A as setStaves, d as shiftNotePitch, aM as stopOctaveShift, t as transpose, v as transposeChecked, aE as updateChordSymbol, aB as updateHarmony, ay as updateLyric, cm as validate, cr as validateBackupForward, ct as validateBeams, cp as validateDivisions, cq as validateMeasureDuration, cE as validateMeasureLocal, cw as validatePartReferences, cx as validatePartStructure, cu as validateSlurs, cB as validateSlursAcrossMeasures, cy as validateStaffStructure, cs as validateTies, cA as validateTiesAcrossMeasures, cv as validateTuplets, cz as validateVoiceStaff } from './index-DPW0wqXK.mjs';
|
|
5
5
|
export { FindNotesFilter, NormalizedPositionOptions, PitchRange, RoundtripMetrics, VoiceFilter, buildVoiceToStaffMap, buildVoiceToStaffMapForPart, countNotes, findBarlines, findDirectionsByType, findNotes, findNotesWithNotation, getAbsolutePosition, getAdjacentNotes, getAllNotes, getAttributesAtMeasure, getBeamGroups, getChordProgression, getChords, getClefChanges, getClefForStaff, getDirections, getDirectionsAtPosition, getDivisions, getDuration, getDynamics, getEffectiveStaff, getEndings, getEntriesAtPosition, getEntriesForStaff, getEntriesInRange, getHarmonies, getHarmonyAtPosition, getKeyChanges, getLyricText, getLyrics, getMeasure, getMeasureByIndex, getMeasureCount, getNextNote, getNormalizedDuration, getNormalizedPosition, getNotesAtPosition, getNotesForStaff, getNotesForVoice, getNotesInRange, getOctaveShifts, getPartById, getPartByIndex, getPartCount, getPartIds, getPartIndex, getPedalMarkings, getPrevNote, getRepeatStructure, getSlurSpans, getStaffRange, getStaveCount, getStaves, getStructuralChanges, getTempoMarkings, getTiedNoteGroups, getTimeChanges, getTupletGroups, getVerseCount, getVerticalSlice, getVoiceLine, getVoiceLineInRange, getVoices, getVoicesForStaff, getWedges, groupByStaff, groupByVoice, hasMultipleStaves, hasNotes, inferStaff, isRestMeasure, iterateEntries, iterateNotes, measureRoundtrip, scoresEqual, withAbsolutePositions } from './query/index.mjs';
|
|
6
6
|
|
|
7
7
|
declare function parse(xmlString: string): Score;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { S as Score, P as Pitch, M as Measure, D as DirectionType, a as DirectionEntry, N as NoteEntry, b as PartListEntry, c as PartInfo } from './types-
|
|
2
|
-
export { A as Accidental, j as AccidentalInfo, O as AdjacentNotes, a4 as AssembledLyrics, B as BackupEntry, p as Barline, a5 as BarlineWithContext, a0 as BeamGroup, k as BeamInfo, s as Chord, C as Clef, aa as ClefChangeInfo, w as Credit, v as Defaults, Q as DirectionKind, z as DirectionWithContext, R as DynamicWithContext, m as DynamicsValue, a7 as EndingInfo, E as EntryWithContext, F as ForwardEntry, a2 as HarmonyWithContext, a8 as KeyChangeInfo, K as KeySignature, L as Lyric, a3 as LyricWithContext, g as MeasureAttributes, h as MeasureEntry, l as Notation, a1 as NotationType, t as NoteIteratorItem, i as NoteType, y as NoteWithContext, r as NoteWithPosition, Y as OctaveShiftWithContext, f as Part, e as PartGroup, W as PedalWithContext, H as PositionQueryOptions, u as Print, a6 as RepeatInfo, d as ScoreMetadata, _ as SlurSpan, q as StaffGroup, G as StaffRange, ab as StructuralChanges, U as TempoWithContext, T as TieInfo, Z as TiedNoteGroup, a9 as TimeChangeInfo, n as TimeSignature, o as Transpose, $ as TupletGroup, I as VerticalSlice, V as VoiceGroup, J as VoiceLine, x as VoiceToStaffMap, X as WedgeWithContext } from './types-
|
|
3
|
-
import { V as ValidateOptions, a as ValidationResult } from './index-
|
|
4
|
-
export { ba as AddArticulationOptions, bj as AddBeamOptions, c8 as AddBowingOptions, ch as AddBreathMarkOptions, ck as AddCaesuraOptions, aW as AddChordOptions, c2 as AddChordSymbolOptions, bS as AddCodaOptions, bc as AddDynamicsOptions, bM as AddEndingOptions, bz as AddFermataOptions, c5 as AddFingeringOptions, bU as AddGraceNoteOptions, b$ as AddHarmonyOptions, bX as AddLyricOptions, bT as AddNavigationOptions, cd as AddOctaveShiftOptions, bB as AddOrnamentOptions, b2 as AddPartOptions, bD as AddPedalOptions, bH as AddRehearsalMarkOptions, bI as AddRepeatBarlineOptions, bK as AddRepeatOptions, bR as AddSegnoOptions, b8 as AddSlurOptions, ca as AddStringNumberOptions, bu as AddTempoOptions, bF as AddTextDirectionOptions, bG as AddTextOptions, b6 as AddTieOptions, b1 as AddVoiceOptions, bx as AddWedgeOptions, bl as AutoBeamOptions, bQ as BarStyle, c7 as BowingType, cg as BreathMarkValue, cj as CaesuraValue, bO as ChangeBarlineOptions, bg as ChangeClefOptions, aX as ChangeNoteDurationOptions, bW as ConvertToGraceOptions, br as CopyNotesMultiMeasureOptions, bo as CopyNotesOptions, bh as CreateTupletOptions, bq as CutNotesOptions, b3 as DuplicatePartOptions, b_ as HarmonyKind, bf as InsertClefChangeOptions, aU as InsertNoteOptions, cM as LocalValidateOptions, b0 as LowerAccidentalOptions, cL as MeasureValidationContext, be as ModifyDynamicsOptions, bw as ModifyTempoOptions, b5 as MoveNoteToStaffOptions, bs as MultiMeasureSelection, bn as NoteSelection, cc as OctaveShiftType, aT as OperationErrorCode, aS as OperationResult, bt as PasteNotesMultiMeasureOptions, bp as PasteNotesOptions, a$ as RaiseAccidentalOptions, bb as RemoveArticulationOptions, bk as RemoveBeamOptions, c9 as RemoveBowingOptions, ci as RemoveBreathMarkOptions, cl as RemoveCaesuraOptions, c3 as RemoveChordSymbolOptions, bd as RemoveDynamicsOptions, bN as RemoveEndingOptions, bA as RemoveFermataOptions, c6 as RemoveFingeringOptions, bV as RemoveGraceNoteOptions, c0 as RemoveHarmonyOptions, bY as RemoveLyricOptions, aV as RemoveNoteOptions, cf as RemoveOctaveShiftOptions, bC as RemoveOrnamentOptions, bE as RemovePedalOptions, bJ as RemoveRepeatBarlineOptions, bL as RemoveRepeatOptions, b9 as RemoveSlurOptions, cb as RemoveStringNumberOptions, bv as RemoveTempoOptions, b7 as RemoveTieOptions, bi as RemoveTupletOptions, by as RemoveWedgeOptions, bP as SetBarlineOptions, bm as SetBeamingOptions, aZ as SetNotePitchBySemitoneOptions, aY as SetNotePitchOptions, b4 as SetStavesOptions, a_ as ShiftNotePitchOptions, ce as StopOctaveShiftOptions, c4 as UpdateChordSymbolOptions, c1 as UpdateHarmonyOptions, bZ as UpdateLyricOptions, cH as ValidationError, cJ as ValidationErrorCode, cD as ValidationException, cK as ValidationLevel, cI as ValidationLocation, K as addArticulation, T as addBeam, aH as addBowing, aO as addBreathMark, aQ as addCaesura, b as addChord, j as addChordNote, p as addChordNoteChecked, aC as addChordSymbol, ao as addCoda, ap as addDaCapo, aq as addDalSegno, M as addDynamics, aj as addEnding, a6 as addFermata, ar as addFine, aF as addFingering, at as addGraceNote, az as addHarmony, aw as addLyric, g as addNote, n as addNoteChecked, aL as addOctaveShift, a8 as addOrnament, x as addPart, aa as addPedal, ae as addRehearsalMark, ah as addRepeat, af as addRepeatBarline, an as addSegno, I as addSlur, aJ as addStringNumber, a1 as addTempo, ad as addText, ac as addTextDirection, G as addTie, as as addToCoda, w as addVoice, a4 as addWedge, cG as assertMeasureValid, co as assertValid, W as autoBeam, al as changeBarline, Q as changeClef, C as changeKey, e as changeNoteDuration, D as changeTime, av as convertToGrace, Y as copyNotes, $ as copyNotesMultiMeasure, R as createTuplet, _ as cutNotes, F as deleteMeasure, h as deleteNote, o as deleteNoteChecked, z as duplicatePart, cC as formatLocation, cF as getMeasureContext, P as insertClefChange, E as insertMeasure, i as insertNote, cn as isValid, l as lowerAccidental, O as modifyDynamics, k as modifyNoteDuration, u as modifyNoteDurationChecked, m as modifyNotePitch, q as modifyNotePitchChecked, a3 as modifyTempo, B as moveNoteToStaff, Z as pasteNotes, a0 as pasteNotesMultiMeasure, f as raiseAccidental, L as removeArticulation, U as removeBeam, aI as removeBowing, aP as removeBreathMark, aR as removeCaesura, aD as removeChordSymbol, N as removeDynamics, ak as removeEnding, a7 as removeFermata, aG as removeFingering, au as removeGraceNote, aA as removeHarmony, ax as removeLyric, r as removeNote, aN as removeOctaveShift, a9 as removeOrnament, y as removePart, ab as removePedal, ai as removeRepeat, ag as removeRepeatBarline, J as removeSlur, aK as removeStringNumber, a2 as removeTempo, H as removeTie, S as removeTuplet, a5 as removeWedge, am as setBarline, X as setBeaming, s as setNotePitch, c as setNotePitchBySemitone, A as setStaves, d as shiftNotePitch, aM as stopOctaveShift, t as transpose, v as transposeChecked, aE as updateChordSymbol, aB as updateHarmony, ay as updateLyric, cm as validate, cr as validateBackupForward, ct as validateBeams, cp as validateDivisions, cq as validateMeasureDuration, cE as validateMeasureLocal, cw as validatePartReferences, cx as validatePartStructure, cu as validateSlurs, cB as validateSlursAcrossMeasures, cy as validateStaffStructure, cs as validateTies, cA as validateTiesAcrossMeasures, cv as validateTuplets, cz as validateVoiceStaff } from './index-
|
|
1
|
+
import { S as Score, P as Pitch, M as Measure, D as DirectionType, a as DirectionEntry, N as NoteEntry, b as PartListEntry, c as PartInfo } from './types-JohtsbUB.js';
|
|
2
|
+
export { A as Accidental, j as AccidentalInfo, O as AdjacentNotes, a4 as AssembledLyrics, B as BackupEntry, p as Barline, a5 as BarlineWithContext, a0 as BeamGroup, k as BeamInfo, s as Chord, C as Clef, aa as ClefChangeInfo, w as Credit, v as Defaults, Q as DirectionKind, z as DirectionWithContext, R as DynamicWithContext, m as DynamicsValue, a7 as EndingInfo, E as EntryWithContext, F as ForwardEntry, a2 as HarmonyWithContext, a8 as KeyChangeInfo, K as KeySignature, L as Lyric, a3 as LyricWithContext, g as MeasureAttributes, h as MeasureEntry, l as Notation, a1 as NotationType, t as NoteIteratorItem, i as NoteType, y as NoteWithContext, r as NoteWithPosition, Y as OctaveShiftWithContext, f as Part, e as PartGroup, W as PedalWithContext, H as PositionQueryOptions, u as Print, a6 as RepeatInfo, d as ScoreMetadata, _ as SlurSpan, q as StaffGroup, G as StaffRange, ab as StructuralChanges, U as TempoWithContext, T as TieInfo, Z as TiedNoteGroup, a9 as TimeChangeInfo, n as TimeSignature, o as Transpose, $ as TupletGroup, I as VerticalSlice, V as VoiceGroup, J as VoiceLine, x as VoiceToStaffMap, X as WedgeWithContext } from './types-JohtsbUB.js';
|
|
3
|
+
import { V as ValidateOptions, a as ValidationResult } from './index-DkvcsWdo.js';
|
|
4
|
+
export { ba as AddArticulationOptions, bj as AddBeamOptions, c8 as AddBowingOptions, ch as AddBreathMarkOptions, ck as AddCaesuraOptions, aW as AddChordOptions, c2 as AddChordSymbolOptions, bS as AddCodaOptions, bc as AddDynamicsOptions, bM as AddEndingOptions, bz as AddFermataOptions, c5 as AddFingeringOptions, bU as AddGraceNoteOptions, b$ as AddHarmonyOptions, bX as AddLyricOptions, bT as AddNavigationOptions, cd as AddOctaveShiftOptions, bB as AddOrnamentOptions, b2 as AddPartOptions, bD as AddPedalOptions, bH as AddRehearsalMarkOptions, bI as AddRepeatBarlineOptions, bK as AddRepeatOptions, bR as AddSegnoOptions, b8 as AddSlurOptions, ca as AddStringNumberOptions, bu as AddTempoOptions, bF as AddTextDirectionOptions, bG as AddTextOptions, b6 as AddTieOptions, b1 as AddVoiceOptions, bx as AddWedgeOptions, bl as AutoBeamOptions, bQ as BarStyle, c7 as BowingType, cg as BreathMarkValue, cj as CaesuraValue, bO as ChangeBarlineOptions, bg as ChangeClefOptions, aX as ChangeNoteDurationOptions, bW as ConvertToGraceOptions, br as CopyNotesMultiMeasureOptions, bo as CopyNotesOptions, bh as CreateTupletOptions, bq as CutNotesOptions, b3 as DuplicatePartOptions, b_ as HarmonyKind, bf as InsertClefChangeOptions, aU as InsertNoteOptions, cM as LocalValidateOptions, b0 as LowerAccidentalOptions, cL as MeasureValidationContext, be as ModifyDynamicsOptions, bw as ModifyTempoOptions, b5 as MoveNoteToStaffOptions, bs as MultiMeasureSelection, bn as NoteSelection, cc as OctaveShiftType, aT as OperationErrorCode, aS as OperationResult, bt as PasteNotesMultiMeasureOptions, bp as PasteNotesOptions, a$ as RaiseAccidentalOptions, bb as RemoveArticulationOptions, bk as RemoveBeamOptions, c9 as RemoveBowingOptions, ci as RemoveBreathMarkOptions, cl as RemoveCaesuraOptions, c3 as RemoveChordSymbolOptions, bd as RemoveDynamicsOptions, bN as RemoveEndingOptions, bA as RemoveFermataOptions, c6 as RemoveFingeringOptions, bV as RemoveGraceNoteOptions, c0 as RemoveHarmonyOptions, bY as RemoveLyricOptions, aV as RemoveNoteOptions, cf as RemoveOctaveShiftOptions, bC as RemoveOrnamentOptions, bE as RemovePedalOptions, bJ as RemoveRepeatBarlineOptions, bL as RemoveRepeatOptions, b9 as RemoveSlurOptions, cb as RemoveStringNumberOptions, bv as RemoveTempoOptions, b7 as RemoveTieOptions, bi as RemoveTupletOptions, by as RemoveWedgeOptions, bP as SetBarlineOptions, bm as SetBeamingOptions, aZ as SetNotePitchBySemitoneOptions, aY as SetNotePitchOptions, b4 as SetStavesOptions, a_ as ShiftNotePitchOptions, ce as StopOctaveShiftOptions, c4 as UpdateChordSymbolOptions, c1 as UpdateHarmonyOptions, bZ as UpdateLyricOptions, cH as ValidationError, cJ as ValidationErrorCode, cD as ValidationException, cK as ValidationLevel, cI as ValidationLocation, K as addArticulation, T as addBeam, aH as addBowing, aO as addBreathMark, aQ as addCaesura, b as addChord, j as addChordNote, p as addChordNoteChecked, aC as addChordSymbol, ao as addCoda, ap as addDaCapo, aq as addDalSegno, M as addDynamics, aj as addEnding, a6 as addFermata, ar as addFine, aF as addFingering, at as addGraceNote, az as addHarmony, aw as addLyric, g as addNote, n as addNoteChecked, aL as addOctaveShift, a8 as addOrnament, x as addPart, aa as addPedal, ae as addRehearsalMark, ah as addRepeat, af as addRepeatBarline, an as addSegno, I as addSlur, aJ as addStringNumber, a1 as addTempo, ad as addText, ac as addTextDirection, G as addTie, as as addToCoda, w as addVoice, a4 as addWedge, cG as assertMeasureValid, co as assertValid, W as autoBeam, al as changeBarline, Q as changeClef, C as changeKey, e as changeNoteDuration, D as changeTime, av as convertToGrace, Y as copyNotes, $ as copyNotesMultiMeasure, R as createTuplet, _ as cutNotes, F as deleteMeasure, h as deleteNote, o as deleteNoteChecked, z as duplicatePart, cC as formatLocation, cF as getMeasureContext, P as insertClefChange, E as insertMeasure, i as insertNote, cn as isValid, l as lowerAccidental, O as modifyDynamics, k as modifyNoteDuration, u as modifyNoteDurationChecked, m as modifyNotePitch, q as modifyNotePitchChecked, a3 as modifyTempo, B as moveNoteToStaff, Z as pasteNotes, a0 as pasteNotesMultiMeasure, f as raiseAccidental, L as removeArticulation, U as removeBeam, aI as removeBowing, aP as removeBreathMark, aR as removeCaesura, aD as removeChordSymbol, N as removeDynamics, ak as removeEnding, a7 as removeFermata, aG as removeFingering, au as removeGraceNote, aA as removeHarmony, ax as removeLyric, r as removeNote, aN as removeOctaveShift, a9 as removeOrnament, y as removePart, ab as removePedal, ai as removeRepeat, ag as removeRepeatBarline, J as removeSlur, aK as removeStringNumber, a2 as removeTempo, H as removeTie, S as removeTuplet, a5 as removeWedge, am as setBarline, X as setBeaming, s as setNotePitch, c as setNotePitchBySemitone, A as setStaves, d as shiftNotePitch, aM as stopOctaveShift, t as transpose, v as transposeChecked, aE as updateChordSymbol, aB as updateHarmony, ay as updateLyric, cm as validate, cr as validateBackupForward, ct as validateBeams, cp as validateDivisions, cq as validateMeasureDuration, cE as validateMeasureLocal, cw as validatePartReferences, cx as validatePartStructure, cu as validateSlurs, cB as validateSlursAcrossMeasures, cy as validateStaffStructure, cs as validateTies, cA as validateTiesAcrossMeasures, cv as validateTuplets, cz as validateVoiceStaff } from './index-DkvcsWdo.js';
|
|
5
5
|
export { FindNotesFilter, NormalizedPositionOptions, PitchRange, RoundtripMetrics, VoiceFilter, buildVoiceToStaffMap, buildVoiceToStaffMapForPart, countNotes, findBarlines, findDirectionsByType, findNotes, findNotesWithNotation, getAbsolutePosition, getAdjacentNotes, getAllNotes, getAttributesAtMeasure, getBeamGroups, getChordProgression, getChords, getClefChanges, getClefForStaff, getDirections, getDirectionsAtPosition, getDivisions, getDuration, getDynamics, getEffectiveStaff, getEndings, getEntriesAtPosition, getEntriesForStaff, getEntriesInRange, getHarmonies, getHarmonyAtPosition, getKeyChanges, getLyricText, getLyrics, getMeasure, getMeasureByIndex, getMeasureCount, getNextNote, getNormalizedDuration, getNormalizedPosition, getNotesAtPosition, getNotesForStaff, getNotesForVoice, getNotesInRange, getOctaveShifts, getPartById, getPartByIndex, getPartCount, getPartIds, getPartIndex, getPedalMarkings, getPrevNote, getRepeatStructure, getSlurSpans, getStaffRange, getStaveCount, getStaves, getStructuralChanges, getTempoMarkings, getTiedNoteGroups, getTimeChanges, getTupletGroups, getVerseCount, getVerticalSlice, getVoiceLine, getVoiceLineInRange, getVoices, getVoicesForStaff, getWedges, groupByStaff, groupByVoice, hasMultipleStaves, hasNotes, inferStaff, isRestMeasure, iterateEntries, iterateNotes, measureRoundtrip, scoresEqual, withAbsolutePositions } from './query/index.js';
|
|
6
6
|
|
|
7
7
|
declare function parse(xmlString: string): Score;
|
package/dist/index.js
CHANGED
|
@@ -1697,8 +1697,8 @@ function parseDirection(elements, attrs) {
|
|
|
1697
1697
|
});
|
|
1698
1698
|
for (const el of elements) {
|
|
1699
1699
|
if (el["direction-type"]) {
|
|
1700
|
-
const
|
|
1701
|
-
|
|
1700
|
+
const parsedTypes = parseDirectionTypes(el["direction-type"]);
|
|
1701
|
+
for (const parsed of parsedTypes) {
|
|
1702
1702
|
direction.directionTypes.push(parsed);
|
|
1703
1703
|
}
|
|
1704
1704
|
}
|
|
@@ -1735,7 +1735,8 @@ function parseDirection(elements, attrs) {
|
|
|
1735
1735
|
}
|
|
1736
1736
|
return direction;
|
|
1737
1737
|
}
|
|
1738
|
-
function
|
|
1738
|
+
function parseDirectionTypes(elements) {
|
|
1739
|
+
const results = [];
|
|
1739
1740
|
for (const el of elements) {
|
|
1740
1741
|
if (el["dynamics"]) {
|
|
1741
1742
|
const dynAttrs = getAttributes(el);
|
|
@@ -1775,10 +1776,12 @@ function parseDirectionType(elements) {
|
|
|
1775
1776
|
if (dynAttrs["default-y"]) result.defaultY = parseFloat(dynAttrs["default-y"]);
|
|
1776
1777
|
if (dynAttrs["relative-x"]) result.relativeX = parseFloat(dynAttrs["relative-x"]);
|
|
1777
1778
|
if (dynAttrs["halign"]) result.halign = dynAttrs["halign"];
|
|
1778
|
-
|
|
1779
|
+
results.push(result);
|
|
1780
|
+
break;
|
|
1779
1781
|
}
|
|
1780
1782
|
}
|
|
1781
1783
|
}
|
|
1784
|
+
continue;
|
|
1782
1785
|
}
|
|
1783
1786
|
if (el["wedge"]) {
|
|
1784
1787
|
const wedgeAttrs = getAttributes(el);
|
|
@@ -1788,8 +1791,9 @@ function parseDirectionType(elements) {
|
|
|
1788
1791
|
if (wedgeAttrs["spread"]) result.spread = parseFloat(wedgeAttrs["spread"]);
|
|
1789
1792
|
if (wedgeAttrs["default-y"]) result.defaultY = parseFloat(wedgeAttrs["default-y"]);
|
|
1790
1793
|
if (wedgeAttrs["relative-x"]) result.relativeX = parseFloat(wedgeAttrs["relative-x"]);
|
|
1791
|
-
|
|
1794
|
+
results.push(result);
|
|
1792
1795
|
}
|
|
1796
|
+
continue;
|
|
1793
1797
|
}
|
|
1794
1798
|
if (el["metronome"]) {
|
|
1795
1799
|
const metAttrs = getAttributes(el);
|
|
@@ -1829,28 +1833,29 @@ function parseDirectionType(elements) {
|
|
|
1829
1833
|
if (metAttrs["default-y"]) result.defaultY = parseFloat(metAttrs["default-y"]);
|
|
1830
1834
|
if (metAttrs["font-family"]) result.fontFamily = metAttrs["font-family"];
|
|
1831
1835
|
if (metAttrs["font-size"]) result.fontSize = metAttrs["font-size"];
|
|
1832
|
-
|
|
1836
|
+
results.push(result);
|
|
1833
1837
|
}
|
|
1838
|
+
continue;
|
|
1834
1839
|
}
|
|
1835
1840
|
if (el["words"]) {
|
|
1836
1841
|
const a = getAttributes(el);
|
|
1837
1842
|
const text = extractText(el["words"]);
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1843
|
+
const result = { kind: "words", text: text || "" };
|
|
1844
|
+
if (a["default-x"]) result.defaultX = parseFloat(a["default-x"]);
|
|
1845
|
+
if (a["default-y"]) result.defaultY = parseFloat(a["default-y"]);
|
|
1846
|
+
if (a["relative-x"]) result.relativeX = parseFloat(a["relative-x"]);
|
|
1847
|
+
if (a["relative-y"]) result.relativeY = parseFloat(a["relative-y"]);
|
|
1848
|
+
if (a["font-family"]) result.fontFamily = a["font-family"];
|
|
1849
|
+
if (a["font-size"]) result.fontSize = a["font-size"];
|
|
1850
|
+
if (a["font-style"]) result.fontStyle = a["font-style"];
|
|
1851
|
+
if (a["font-weight"]) result.fontWeight = a["font-weight"];
|
|
1852
|
+
if (a["xml:lang"]) result.xmlLang = a["xml:lang"];
|
|
1853
|
+
if (a["justify"]) result.justify = a["justify"];
|
|
1854
|
+
if (a["color"]) result.color = a["color"];
|
|
1855
|
+
if (a["xml:space"]) result.xmlSpace = a["xml:space"];
|
|
1856
|
+
if (a["halign"]) result.halign = a["halign"];
|
|
1857
|
+
results.push(result);
|
|
1858
|
+
continue;
|
|
1854
1859
|
}
|
|
1855
1860
|
if (el["rehearsal"]) {
|
|
1856
1861
|
const a = getAttributes(el);
|
|
@@ -1862,8 +1867,9 @@ function parseDirectionType(elements) {
|
|
|
1862
1867
|
if (a["default-y"]) result.defaultY = parseFloat(a["default-y"]);
|
|
1863
1868
|
if (a["font-size"]) result.fontSize = a["font-size"];
|
|
1864
1869
|
if (a["font-weight"]) result.fontWeight = a["font-weight"];
|
|
1865
|
-
|
|
1870
|
+
results.push(result);
|
|
1866
1871
|
}
|
|
1872
|
+
continue;
|
|
1867
1873
|
}
|
|
1868
1874
|
if (el["bracket"]) {
|
|
1869
1875
|
const bracketAttrs = getAttributes(el);
|
|
@@ -1875,8 +1881,9 @@ function parseDirectionType(elements) {
|
|
|
1875
1881
|
if (bracketAttrs["line-type"]) result.lineType = bracketAttrs["line-type"];
|
|
1876
1882
|
if (bracketAttrs["default-y"]) result.defaultY = parseFloat(bracketAttrs["default-y"]);
|
|
1877
1883
|
if (bracketAttrs["relative-x"]) result.relativeX = parseFloat(bracketAttrs["relative-x"]);
|
|
1878
|
-
|
|
1884
|
+
results.push(result);
|
|
1879
1885
|
}
|
|
1886
|
+
continue;
|
|
1880
1887
|
}
|
|
1881
1888
|
if (el["dashes"]) {
|
|
1882
1889
|
const dashAttrs = getAttributes(el);
|
|
@@ -1887,8 +1894,9 @@ function parseDirectionType(elements) {
|
|
|
1887
1894
|
if (dashAttrs["dash-length"]) result.dashLength = parseFloat(dashAttrs["dash-length"]);
|
|
1888
1895
|
if (dashAttrs["default-y"]) result.defaultY = parseFloat(dashAttrs["default-y"]);
|
|
1889
1896
|
if (dashAttrs["space-length"]) result.spaceLength = parseFloat(dashAttrs["space-length"]);
|
|
1890
|
-
|
|
1897
|
+
results.push(result);
|
|
1891
1898
|
}
|
|
1899
|
+
continue;
|
|
1892
1900
|
}
|
|
1893
1901
|
if (el["accordion-registration"]) {
|
|
1894
1902
|
const accContent = el["accordion-registration"];
|
|
@@ -1908,7 +1916,8 @@ function parseDirectionType(elements) {
|
|
|
1908
1916
|
result.low = true;
|
|
1909
1917
|
}
|
|
1910
1918
|
}
|
|
1911
|
-
|
|
1919
|
+
results.push(result);
|
|
1920
|
+
continue;
|
|
1912
1921
|
}
|
|
1913
1922
|
if (el["other-direction"]) {
|
|
1914
1923
|
const otherAttrs = getAttributes(el);
|
|
@@ -1920,24 +1929,31 @@ function parseDirectionType(elements) {
|
|
|
1920
1929
|
if (otherAttrs["default-y"]) result.defaultY = parseFloat(otherAttrs["default-y"]);
|
|
1921
1930
|
if (otherAttrs["halign"]) result.halign = otherAttrs["halign"];
|
|
1922
1931
|
if (otherAttrs["print-object"] === "no") result.printObject = false;
|
|
1923
|
-
|
|
1932
|
+
results.push(result);
|
|
1933
|
+
break;
|
|
1924
1934
|
}
|
|
1925
1935
|
}
|
|
1936
|
+
continue;
|
|
1926
1937
|
}
|
|
1927
1938
|
if (el["segno"] !== void 0) {
|
|
1928
|
-
|
|
1939
|
+
results.push({ kind: "segno" });
|
|
1940
|
+
continue;
|
|
1929
1941
|
}
|
|
1930
1942
|
if (el["coda"] !== void 0) {
|
|
1931
|
-
|
|
1943
|
+
results.push({ kind: "coda" });
|
|
1944
|
+
continue;
|
|
1932
1945
|
}
|
|
1933
1946
|
if (el["eyeglasses"] !== void 0) {
|
|
1934
|
-
|
|
1947
|
+
results.push({ kind: "eyeglasses" });
|
|
1948
|
+
continue;
|
|
1935
1949
|
}
|
|
1936
1950
|
if (el["damp"] !== void 0) {
|
|
1937
|
-
|
|
1951
|
+
results.push({ kind: "damp" });
|
|
1952
|
+
continue;
|
|
1938
1953
|
}
|
|
1939
1954
|
if (el["damp-all"] !== void 0) {
|
|
1940
|
-
|
|
1955
|
+
results.push({ kind: "damp-all" });
|
|
1956
|
+
continue;
|
|
1941
1957
|
}
|
|
1942
1958
|
if (el["scordatura"] !== void 0) {
|
|
1943
1959
|
const scordContent = el["scordatura"];
|
|
@@ -1960,7 +1976,8 @@ function parseDirectionType(elements) {
|
|
|
1960
1976
|
}
|
|
1961
1977
|
}
|
|
1962
1978
|
}
|
|
1963
|
-
|
|
1979
|
+
results.push({ kind: "scordatura", accords: accords.length > 0 ? accords : void 0 });
|
|
1980
|
+
continue;
|
|
1964
1981
|
}
|
|
1965
1982
|
if (el["harp-pedals"] !== void 0) {
|
|
1966
1983
|
const harpContent = el["harp-pedals"];
|
|
@@ -1978,15 +1995,17 @@ function parseDirectionType(elements) {
|
|
|
1978
1995
|
}
|
|
1979
1996
|
}
|
|
1980
1997
|
}
|
|
1981
|
-
|
|
1998
|
+
results.push({ kind: "harp-pedals", pedalTunings: pedalTunings.length > 0 ? pedalTunings : void 0 });
|
|
1999
|
+
continue;
|
|
1982
2000
|
}
|
|
1983
2001
|
if (el["image"] !== void 0) {
|
|
1984
2002
|
const imgAttrs = getAttributes(el);
|
|
1985
|
-
|
|
2003
|
+
results.push({
|
|
1986
2004
|
kind: "image",
|
|
1987
2005
|
source: imgAttrs["source"],
|
|
1988
2006
|
type: imgAttrs["type"]
|
|
1989
|
-
};
|
|
2007
|
+
});
|
|
2008
|
+
continue;
|
|
1990
2009
|
}
|
|
1991
2010
|
if (el["pedal"]) {
|
|
1992
2011
|
const pedalAttrs = getAttributes(el);
|
|
@@ -1998,8 +2017,9 @@ function parseDirectionType(elements) {
|
|
|
1998
2017
|
if (pedalAttrs["default-y"]) result.defaultY = parseFloat(pedalAttrs["default-y"]);
|
|
1999
2018
|
if (pedalAttrs["relative-x"]) result.relativeX = parseFloat(pedalAttrs["relative-x"]);
|
|
2000
2019
|
if (pedalAttrs["halign"]) result.halign = pedalAttrs["halign"];
|
|
2001
|
-
|
|
2020
|
+
results.push(result);
|
|
2002
2021
|
}
|
|
2022
|
+
continue;
|
|
2003
2023
|
}
|
|
2004
2024
|
if (el["octave-shift"]) {
|
|
2005
2025
|
const shiftAttrs = getAttributes(el);
|
|
@@ -2007,8 +2027,9 @@ function parseDirectionType(elements) {
|
|
|
2007
2027
|
if (shiftType === "up" || shiftType === "down" || shiftType === "stop") {
|
|
2008
2028
|
const result = { kind: "octave-shift", type: shiftType };
|
|
2009
2029
|
if (shiftAttrs["size"]) result.size = parseInt(shiftAttrs["size"], 10);
|
|
2010
|
-
|
|
2030
|
+
results.push(result);
|
|
2011
2031
|
}
|
|
2032
|
+
continue;
|
|
2012
2033
|
}
|
|
2013
2034
|
if (el["swing"]) {
|
|
2014
2035
|
const swingContent = el["swing"];
|
|
@@ -2042,10 +2063,11 @@ function parseDirectionType(elements) {
|
|
|
2042
2063
|
}
|
|
2043
2064
|
}
|
|
2044
2065
|
}
|
|
2045
|
-
|
|
2066
|
+
results.push(result);
|
|
2067
|
+
continue;
|
|
2046
2068
|
}
|
|
2047
2069
|
}
|
|
2048
|
-
return
|
|
2070
|
+
return results;
|
|
2049
2071
|
}
|
|
2050
2072
|
function parseBarline(elements, attrs) {
|
|
2051
2073
|
const location = attrs["location"] || "right";
|
|
@@ -2926,7 +2948,7 @@ function validateBeams(measure, location) {
|
|
|
2926
2948
|
const entry = measure.entries[entryIndex];
|
|
2927
2949
|
if (entry.type !== "note" || !entry.beam) continue;
|
|
2928
2950
|
for (const beam of entry.beam) {
|
|
2929
|
-
const beamKey = `${beam.number}-${entry.voice}
|
|
2951
|
+
const beamKey = `${beam.number}-${entry.voice}`;
|
|
2930
2952
|
if (beam.type === "begin") {
|
|
2931
2953
|
if (openBeams.has(beamKey)) {
|
|
2932
2954
|
errors.push({
|
|
@@ -2937,7 +2959,7 @@ function validateBeams(measure, location) {
|
|
|
2937
2959
|
details: { beamNumber: beam.number }
|
|
2938
2960
|
});
|
|
2939
2961
|
}
|
|
2940
|
-
openBeams.set(beamKey, entryIndex);
|
|
2962
|
+
openBeams.set(beamKey, { entryIndex, staff: entry.staff ?? 1 });
|
|
2941
2963
|
} else if (beam.type === "end") {
|
|
2942
2964
|
if (!openBeams.has(beamKey)) {
|
|
2943
2965
|
errors.push({
|
|
@@ -2953,8 +2975,8 @@ function validateBeams(measure, location) {
|
|
|
2953
2975
|
}
|
|
2954
2976
|
}
|
|
2955
2977
|
}
|
|
2956
|
-
for (const [beamKey, startIndex] of openBeams.entries()) {
|
|
2957
|
-
const [beamNumber, voice
|
|
2978
|
+
for (const [beamKey, { entryIndex: startIndex, staff }] of openBeams.entries()) {
|
|
2979
|
+
const [beamNumber, voice] = beamKey.split("-").map(Number);
|
|
2958
2980
|
errors.push({
|
|
2959
2981
|
code: "BEAM_BEGIN_WITHOUT_END",
|
|
2960
2982
|
level: "error",
|
|
@@ -4848,6 +4870,7 @@ function serializeDirectionType(dirType, indent) {
|
|
|
4848
4870
|
if (dirType.defaultX !== void 0) wordAttrs += ` default-x="${dirType.defaultX}"`;
|
|
4849
4871
|
if (dirType.defaultY !== void 0) wordAttrs += ` default-y="${dirType.defaultY}"`;
|
|
4850
4872
|
if (dirType.relativeX !== void 0) wordAttrs += ` relative-x="${dirType.relativeX}"`;
|
|
4873
|
+
if (dirType.relativeY !== void 0) wordAttrs += ` relative-y="${dirType.relativeY}"`;
|
|
4851
4874
|
if (dirType.fontFamily) wordAttrs += ` font-family="${escapeXml(dirType.fontFamily)}"`;
|
|
4852
4875
|
if (dirType.fontSize) wordAttrs += ` font-size="${escapeXml(dirType.fontSize)}"`;
|
|
4853
4876
|
if (dirType.fontStyle) wordAttrs += ` font-style="${escapeXml(dirType.fontStyle)}"`;
|
package/dist/index.mjs
CHANGED
|
@@ -1426,8 +1426,8 @@ function parseDirection(elements, attrs) {
|
|
|
1426
1426
|
});
|
|
1427
1427
|
for (const el of elements) {
|
|
1428
1428
|
if (el["direction-type"]) {
|
|
1429
|
-
const
|
|
1430
|
-
|
|
1429
|
+
const parsedTypes = parseDirectionTypes(el["direction-type"]);
|
|
1430
|
+
for (const parsed of parsedTypes) {
|
|
1431
1431
|
direction.directionTypes.push(parsed);
|
|
1432
1432
|
}
|
|
1433
1433
|
}
|
|
@@ -1464,7 +1464,8 @@ function parseDirection(elements, attrs) {
|
|
|
1464
1464
|
}
|
|
1465
1465
|
return direction;
|
|
1466
1466
|
}
|
|
1467
|
-
function
|
|
1467
|
+
function parseDirectionTypes(elements) {
|
|
1468
|
+
const results = [];
|
|
1468
1469
|
for (const el of elements) {
|
|
1469
1470
|
if (el["dynamics"]) {
|
|
1470
1471
|
const dynAttrs = getAttributes(el);
|
|
@@ -1504,10 +1505,12 @@ function parseDirectionType(elements) {
|
|
|
1504
1505
|
if (dynAttrs["default-y"]) result.defaultY = parseFloat(dynAttrs["default-y"]);
|
|
1505
1506
|
if (dynAttrs["relative-x"]) result.relativeX = parseFloat(dynAttrs["relative-x"]);
|
|
1506
1507
|
if (dynAttrs["halign"]) result.halign = dynAttrs["halign"];
|
|
1507
|
-
|
|
1508
|
+
results.push(result);
|
|
1509
|
+
break;
|
|
1508
1510
|
}
|
|
1509
1511
|
}
|
|
1510
1512
|
}
|
|
1513
|
+
continue;
|
|
1511
1514
|
}
|
|
1512
1515
|
if (el["wedge"]) {
|
|
1513
1516
|
const wedgeAttrs = getAttributes(el);
|
|
@@ -1517,8 +1520,9 @@ function parseDirectionType(elements) {
|
|
|
1517
1520
|
if (wedgeAttrs["spread"]) result.spread = parseFloat(wedgeAttrs["spread"]);
|
|
1518
1521
|
if (wedgeAttrs["default-y"]) result.defaultY = parseFloat(wedgeAttrs["default-y"]);
|
|
1519
1522
|
if (wedgeAttrs["relative-x"]) result.relativeX = parseFloat(wedgeAttrs["relative-x"]);
|
|
1520
|
-
|
|
1523
|
+
results.push(result);
|
|
1521
1524
|
}
|
|
1525
|
+
continue;
|
|
1522
1526
|
}
|
|
1523
1527
|
if (el["metronome"]) {
|
|
1524
1528
|
const metAttrs = getAttributes(el);
|
|
@@ -1558,28 +1562,29 @@ function parseDirectionType(elements) {
|
|
|
1558
1562
|
if (metAttrs["default-y"]) result.defaultY = parseFloat(metAttrs["default-y"]);
|
|
1559
1563
|
if (metAttrs["font-family"]) result.fontFamily = metAttrs["font-family"];
|
|
1560
1564
|
if (metAttrs["font-size"]) result.fontSize = metAttrs["font-size"];
|
|
1561
|
-
|
|
1565
|
+
results.push(result);
|
|
1562
1566
|
}
|
|
1567
|
+
continue;
|
|
1563
1568
|
}
|
|
1564
1569
|
if (el["words"]) {
|
|
1565
1570
|
const a = getAttributes(el);
|
|
1566
1571
|
const text = extractText(el["words"]);
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1572
|
+
const result = { kind: "words", text: text || "" };
|
|
1573
|
+
if (a["default-x"]) result.defaultX = parseFloat(a["default-x"]);
|
|
1574
|
+
if (a["default-y"]) result.defaultY = parseFloat(a["default-y"]);
|
|
1575
|
+
if (a["relative-x"]) result.relativeX = parseFloat(a["relative-x"]);
|
|
1576
|
+
if (a["relative-y"]) result.relativeY = parseFloat(a["relative-y"]);
|
|
1577
|
+
if (a["font-family"]) result.fontFamily = a["font-family"];
|
|
1578
|
+
if (a["font-size"]) result.fontSize = a["font-size"];
|
|
1579
|
+
if (a["font-style"]) result.fontStyle = a["font-style"];
|
|
1580
|
+
if (a["font-weight"]) result.fontWeight = a["font-weight"];
|
|
1581
|
+
if (a["xml:lang"]) result.xmlLang = a["xml:lang"];
|
|
1582
|
+
if (a["justify"]) result.justify = a["justify"];
|
|
1583
|
+
if (a["color"]) result.color = a["color"];
|
|
1584
|
+
if (a["xml:space"]) result.xmlSpace = a["xml:space"];
|
|
1585
|
+
if (a["halign"]) result.halign = a["halign"];
|
|
1586
|
+
results.push(result);
|
|
1587
|
+
continue;
|
|
1583
1588
|
}
|
|
1584
1589
|
if (el["rehearsal"]) {
|
|
1585
1590
|
const a = getAttributes(el);
|
|
@@ -1591,8 +1596,9 @@ function parseDirectionType(elements) {
|
|
|
1591
1596
|
if (a["default-y"]) result.defaultY = parseFloat(a["default-y"]);
|
|
1592
1597
|
if (a["font-size"]) result.fontSize = a["font-size"];
|
|
1593
1598
|
if (a["font-weight"]) result.fontWeight = a["font-weight"];
|
|
1594
|
-
|
|
1599
|
+
results.push(result);
|
|
1595
1600
|
}
|
|
1601
|
+
continue;
|
|
1596
1602
|
}
|
|
1597
1603
|
if (el["bracket"]) {
|
|
1598
1604
|
const bracketAttrs = getAttributes(el);
|
|
@@ -1604,8 +1610,9 @@ function parseDirectionType(elements) {
|
|
|
1604
1610
|
if (bracketAttrs["line-type"]) result.lineType = bracketAttrs["line-type"];
|
|
1605
1611
|
if (bracketAttrs["default-y"]) result.defaultY = parseFloat(bracketAttrs["default-y"]);
|
|
1606
1612
|
if (bracketAttrs["relative-x"]) result.relativeX = parseFloat(bracketAttrs["relative-x"]);
|
|
1607
|
-
|
|
1613
|
+
results.push(result);
|
|
1608
1614
|
}
|
|
1615
|
+
continue;
|
|
1609
1616
|
}
|
|
1610
1617
|
if (el["dashes"]) {
|
|
1611
1618
|
const dashAttrs = getAttributes(el);
|
|
@@ -1616,8 +1623,9 @@ function parseDirectionType(elements) {
|
|
|
1616
1623
|
if (dashAttrs["dash-length"]) result.dashLength = parseFloat(dashAttrs["dash-length"]);
|
|
1617
1624
|
if (dashAttrs["default-y"]) result.defaultY = parseFloat(dashAttrs["default-y"]);
|
|
1618
1625
|
if (dashAttrs["space-length"]) result.spaceLength = parseFloat(dashAttrs["space-length"]);
|
|
1619
|
-
|
|
1626
|
+
results.push(result);
|
|
1620
1627
|
}
|
|
1628
|
+
continue;
|
|
1621
1629
|
}
|
|
1622
1630
|
if (el["accordion-registration"]) {
|
|
1623
1631
|
const accContent = el["accordion-registration"];
|
|
@@ -1637,7 +1645,8 @@ function parseDirectionType(elements) {
|
|
|
1637
1645
|
result.low = true;
|
|
1638
1646
|
}
|
|
1639
1647
|
}
|
|
1640
|
-
|
|
1648
|
+
results.push(result);
|
|
1649
|
+
continue;
|
|
1641
1650
|
}
|
|
1642
1651
|
if (el["other-direction"]) {
|
|
1643
1652
|
const otherAttrs = getAttributes(el);
|
|
@@ -1649,24 +1658,31 @@ function parseDirectionType(elements) {
|
|
|
1649
1658
|
if (otherAttrs["default-y"]) result.defaultY = parseFloat(otherAttrs["default-y"]);
|
|
1650
1659
|
if (otherAttrs["halign"]) result.halign = otherAttrs["halign"];
|
|
1651
1660
|
if (otherAttrs["print-object"] === "no") result.printObject = false;
|
|
1652
|
-
|
|
1661
|
+
results.push(result);
|
|
1662
|
+
break;
|
|
1653
1663
|
}
|
|
1654
1664
|
}
|
|
1665
|
+
continue;
|
|
1655
1666
|
}
|
|
1656
1667
|
if (el["segno"] !== void 0) {
|
|
1657
|
-
|
|
1668
|
+
results.push({ kind: "segno" });
|
|
1669
|
+
continue;
|
|
1658
1670
|
}
|
|
1659
1671
|
if (el["coda"] !== void 0) {
|
|
1660
|
-
|
|
1672
|
+
results.push({ kind: "coda" });
|
|
1673
|
+
continue;
|
|
1661
1674
|
}
|
|
1662
1675
|
if (el["eyeglasses"] !== void 0) {
|
|
1663
|
-
|
|
1676
|
+
results.push({ kind: "eyeglasses" });
|
|
1677
|
+
continue;
|
|
1664
1678
|
}
|
|
1665
1679
|
if (el["damp"] !== void 0) {
|
|
1666
|
-
|
|
1680
|
+
results.push({ kind: "damp" });
|
|
1681
|
+
continue;
|
|
1667
1682
|
}
|
|
1668
1683
|
if (el["damp-all"] !== void 0) {
|
|
1669
|
-
|
|
1684
|
+
results.push({ kind: "damp-all" });
|
|
1685
|
+
continue;
|
|
1670
1686
|
}
|
|
1671
1687
|
if (el["scordatura"] !== void 0) {
|
|
1672
1688
|
const scordContent = el["scordatura"];
|
|
@@ -1689,7 +1705,8 @@ function parseDirectionType(elements) {
|
|
|
1689
1705
|
}
|
|
1690
1706
|
}
|
|
1691
1707
|
}
|
|
1692
|
-
|
|
1708
|
+
results.push({ kind: "scordatura", accords: accords.length > 0 ? accords : void 0 });
|
|
1709
|
+
continue;
|
|
1693
1710
|
}
|
|
1694
1711
|
if (el["harp-pedals"] !== void 0) {
|
|
1695
1712
|
const harpContent = el["harp-pedals"];
|
|
@@ -1707,15 +1724,17 @@ function parseDirectionType(elements) {
|
|
|
1707
1724
|
}
|
|
1708
1725
|
}
|
|
1709
1726
|
}
|
|
1710
|
-
|
|
1727
|
+
results.push({ kind: "harp-pedals", pedalTunings: pedalTunings.length > 0 ? pedalTunings : void 0 });
|
|
1728
|
+
continue;
|
|
1711
1729
|
}
|
|
1712
1730
|
if (el["image"] !== void 0) {
|
|
1713
1731
|
const imgAttrs = getAttributes(el);
|
|
1714
|
-
|
|
1732
|
+
results.push({
|
|
1715
1733
|
kind: "image",
|
|
1716
1734
|
source: imgAttrs["source"],
|
|
1717
1735
|
type: imgAttrs["type"]
|
|
1718
|
-
};
|
|
1736
|
+
});
|
|
1737
|
+
continue;
|
|
1719
1738
|
}
|
|
1720
1739
|
if (el["pedal"]) {
|
|
1721
1740
|
const pedalAttrs = getAttributes(el);
|
|
@@ -1727,8 +1746,9 @@ function parseDirectionType(elements) {
|
|
|
1727
1746
|
if (pedalAttrs["default-y"]) result.defaultY = parseFloat(pedalAttrs["default-y"]);
|
|
1728
1747
|
if (pedalAttrs["relative-x"]) result.relativeX = parseFloat(pedalAttrs["relative-x"]);
|
|
1729
1748
|
if (pedalAttrs["halign"]) result.halign = pedalAttrs["halign"];
|
|
1730
|
-
|
|
1749
|
+
results.push(result);
|
|
1731
1750
|
}
|
|
1751
|
+
continue;
|
|
1732
1752
|
}
|
|
1733
1753
|
if (el["octave-shift"]) {
|
|
1734
1754
|
const shiftAttrs = getAttributes(el);
|
|
@@ -1736,8 +1756,9 @@ function parseDirectionType(elements) {
|
|
|
1736
1756
|
if (shiftType === "up" || shiftType === "down" || shiftType === "stop") {
|
|
1737
1757
|
const result = { kind: "octave-shift", type: shiftType };
|
|
1738
1758
|
if (shiftAttrs["size"]) result.size = parseInt(shiftAttrs["size"], 10);
|
|
1739
|
-
|
|
1759
|
+
results.push(result);
|
|
1740
1760
|
}
|
|
1761
|
+
continue;
|
|
1741
1762
|
}
|
|
1742
1763
|
if (el["swing"]) {
|
|
1743
1764
|
const swingContent = el["swing"];
|
|
@@ -1771,10 +1792,11 @@ function parseDirectionType(elements) {
|
|
|
1771
1792
|
}
|
|
1772
1793
|
}
|
|
1773
1794
|
}
|
|
1774
|
-
|
|
1795
|
+
results.push(result);
|
|
1796
|
+
continue;
|
|
1775
1797
|
}
|
|
1776
1798
|
}
|
|
1777
|
-
return
|
|
1799
|
+
return results;
|
|
1778
1800
|
}
|
|
1779
1801
|
function parseBarline(elements, attrs) {
|
|
1780
1802
|
const location = attrs["location"] || "right";
|
|
@@ -2655,7 +2677,7 @@ function validateBeams(measure, location) {
|
|
|
2655
2677
|
const entry = measure.entries[entryIndex];
|
|
2656
2678
|
if (entry.type !== "note" || !entry.beam) continue;
|
|
2657
2679
|
for (const beam of entry.beam) {
|
|
2658
|
-
const beamKey = `${beam.number}-${entry.voice}
|
|
2680
|
+
const beamKey = `${beam.number}-${entry.voice}`;
|
|
2659
2681
|
if (beam.type === "begin") {
|
|
2660
2682
|
if (openBeams.has(beamKey)) {
|
|
2661
2683
|
errors.push({
|
|
@@ -2666,7 +2688,7 @@ function validateBeams(measure, location) {
|
|
|
2666
2688
|
details: { beamNumber: beam.number }
|
|
2667
2689
|
});
|
|
2668
2690
|
}
|
|
2669
|
-
openBeams.set(beamKey, entryIndex);
|
|
2691
|
+
openBeams.set(beamKey, { entryIndex, staff: entry.staff ?? 1 });
|
|
2670
2692
|
} else if (beam.type === "end") {
|
|
2671
2693
|
if (!openBeams.has(beamKey)) {
|
|
2672
2694
|
errors.push({
|
|
@@ -2682,8 +2704,8 @@ function validateBeams(measure, location) {
|
|
|
2682
2704
|
}
|
|
2683
2705
|
}
|
|
2684
2706
|
}
|
|
2685
|
-
for (const [beamKey, startIndex] of openBeams.entries()) {
|
|
2686
|
-
const [beamNumber, voice
|
|
2707
|
+
for (const [beamKey, { entryIndex: startIndex, staff }] of openBeams.entries()) {
|
|
2708
|
+
const [beamNumber, voice] = beamKey.split("-").map(Number);
|
|
2687
2709
|
errors.push({
|
|
2688
2710
|
code: "BEAM_BEGIN_WITHOUT_END",
|
|
2689
2711
|
level: "error",
|
|
@@ -4577,6 +4599,7 @@ function serializeDirectionType(dirType, indent) {
|
|
|
4577
4599
|
if (dirType.defaultX !== void 0) wordAttrs += ` default-x="${dirType.defaultX}"`;
|
|
4578
4600
|
if (dirType.defaultY !== void 0) wordAttrs += ` default-y="${dirType.defaultY}"`;
|
|
4579
4601
|
if (dirType.relativeX !== void 0) wordAttrs += ` relative-x="${dirType.relativeX}"`;
|
|
4602
|
+
if (dirType.relativeY !== void 0) wordAttrs += ` relative-y="${dirType.relativeY}"`;
|
|
4580
4603
|
if (dirType.fontFamily) wordAttrs += ` font-family="${escapeXml(dirType.fontFamily)}"`;
|
|
4581
4604
|
if (dirType.fontSize) wordAttrs += ` font-size="${escapeXml(dirType.fontSize)}"`;
|
|
4582
4605
|
if (dirType.fontStyle) wordAttrs += ` font-style="${escapeXml(dirType.fontStyle)}"`;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import '../types-
|
|
2
|
-
export { ba as AddArticulationOptions, bj as AddBeamOptions, c8 as AddBowingOptions, ch as AddBreathMarkOptions, ck as AddCaesuraOptions, aW as AddChordOptions, c2 as AddChordSymbolOptions, bS as AddCodaOptions, bc as AddDynamicsOptions, bM as AddEndingOptions, bz as AddFermataOptions, c5 as AddFingeringOptions, bU as AddGraceNoteOptions, b$ as AddHarmonyOptions, bX as AddLyricOptions, bT as AddNavigationOptions, cd as AddOctaveShiftOptions, bB as AddOrnamentOptions, b2 as AddPartOptions, bD as AddPedalOptions, bH as AddRehearsalMarkOptions, bI as AddRepeatBarlineOptions, bK as AddRepeatOptions, bR as AddSegnoOptions, b8 as AddSlurOptions, ca as AddStringNumberOptions, bu as AddTempoOptions, bF as AddTextDirectionOptions, bG as AddTextOptions, b6 as AddTieOptions, b1 as AddVoiceOptions, bx as AddWedgeOptions, bl as AutoBeamOptions, bQ as BarStyle, c7 as BowingType, cg as BreathMarkValue, cj as CaesuraValue, bO as ChangeBarlineOptions, bg as ChangeClefOptions, aX as ChangeNoteDurationOptions, bW as ConvertToGraceOptions, br as CopyNotesMultiMeasureOptions, bo as CopyNotesOptions, bh as CreateTupletOptions, bq as CutNotesOptions, b3 as DuplicatePartOptions, b_ as HarmonyKind, bf as InsertClefChangeOptions, aU as InsertNoteOptions, b0 as LowerAccidentalOptions, be as ModifyDynamicsOptions, bw as ModifyTempoOptions, b5 as MoveNoteToStaffOptions, bs as MultiMeasureSelection, bn as NoteSelection, cc as OctaveShiftType, aT as OperationErrorCode, aS as OperationResult, bt as PasteNotesMultiMeasureOptions, bp as PasteNotesOptions, a$ as RaiseAccidentalOptions, bb as RemoveArticulationOptions, bk as RemoveBeamOptions, c9 as RemoveBowingOptions, ci as RemoveBreathMarkOptions, cl as RemoveCaesuraOptions, c3 as RemoveChordSymbolOptions, bd as RemoveDynamicsOptions, bN as RemoveEndingOptions, bA as RemoveFermataOptions, c6 as RemoveFingeringOptions, bV as RemoveGraceNoteOptions, c0 as RemoveHarmonyOptions, bY as RemoveLyricOptions, aV as RemoveNoteOptions, cf as RemoveOctaveShiftOptions, bC as RemoveOrnamentOptions, bE as RemovePedalOptions, bJ as RemoveRepeatBarlineOptions, bL as RemoveRepeatOptions, b9 as RemoveSlurOptions, cb as RemoveStringNumberOptions, bv as RemoveTempoOptions, b7 as RemoveTieOptions, bi as RemoveTupletOptions, by as RemoveWedgeOptions, bP as SetBarlineOptions, bm as SetBeamingOptions, aZ as SetNotePitchBySemitoneOptions, aY as SetNotePitchOptions, b4 as SetStavesOptions, a_ as ShiftNotePitchOptions, ce as StopOctaveShiftOptions, c4 as UpdateChordSymbolOptions, c1 as UpdateHarmonyOptions, bZ as UpdateLyricOptions, cH as ValidationError, K as addArticulation, T as addBeam, aH as addBowing, aO as addBreathMark, aQ as addCaesura, b as addChord, j as addChordNote, p as addChordNoteChecked, aC as addChordSymbol, ao as addCoda, ap as addDaCapo, aq as addDalSegno, M as addDynamics, aj as addEnding, a6 as addFermata, ar as addFine, aF as addFingering, at as addGraceNote, az as addHarmony, aw as addLyric, g as addNote, n as addNoteChecked, aL as addOctaveShift, a8 as addOrnament, x as addPart, aa as addPedal, ae as addRehearsalMark, ah as addRepeat, af as addRepeatBarline, an as addSegno, I as addSlur, aJ as addStringNumber, a1 as addTempo, ad as addText, ac as addTextDirection, G as addTie, as as addToCoda, w as addVoice, a4 as addWedge, W as autoBeam, al as changeBarline, Q as changeClef, C as changeKey, e as changeNoteDuration, D as changeTime, av as convertToGrace, Y as copyNotes, $ as copyNotesMultiMeasure, R as createTuplet, _ as cutNotes, F as deleteMeasure, h as deleteNote, o as deleteNoteChecked, z as duplicatePart, P as insertClefChange, E as insertMeasure, i as insertNote, l as lowerAccidental, O as modifyDynamics, k as modifyNoteDuration, u as modifyNoteDurationChecked, m as modifyNotePitch, q as modifyNotePitchChecked, a3 as modifyTempo, B as moveNoteToStaff, Z as pasteNotes, a0 as pasteNotesMultiMeasure, f as raiseAccidental, L as removeArticulation, U as removeBeam, aI as removeBowing, aP as removeBreathMark, aR as removeCaesura, aD as removeChordSymbol, N as removeDynamics, ak as removeEnding, a7 as removeFermata, aG as removeFingering, au as removeGraceNote, aA as removeHarmony, ax as removeLyric, r as removeNote, aN as removeOctaveShift, a9 as removeOrnament, y as removePart, ab as removePedal, ai as removeRepeat, ag as removeRepeatBarline, J as removeSlur, aK as removeStringNumber, a2 as removeTempo, H as removeTie, S as removeTuplet, a5 as removeWedge, am as setBarline, X as setBeaming, s as setNotePitch, c as setNotePitchBySemitone, A as setStaves, d as shiftNotePitch, aM as stopOctaveShift, t as transpose, v as transposeChecked, aE as updateChordSymbol, aB as updateHarmony, ay as updateLyric } from '../index-
|
|
1
|
+
import '../types-JohtsbUB.mjs';
|
|
2
|
+
export { ba as AddArticulationOptions, bj as AddBeamOptions, c8 as AddBowingOptions, ch as AddBreathMarkOptions, ck as AddCaesuraOptions, aW as AddChordOptions, c2 as AddChordSymbolOptions, bS as AddCodaOptions, bc as AddDynamicsOptions, bM as AddEndingOptions, bz as AddFermataOptions, c5 as AddFingeringOptions, bU as AddGraceNoteOptions, b$ as AddHarmonyOptions, bX as AddLyricOptions, bT as AddNavigationOptions, cd as AddOctaveShiftOptions, bB as AddOrnamentOptions, b2 as AddPartOptions, bD as AddPedalOptions, bH as AddRehearsalMarkOptions, bI as AddRepeatBarlineOptions, bK as AddRepeatOptions, bR as AddSegnoOptions, b8 as AddSlurOptions, ca as AddStringNumberOptions, bu as AddTempoOptions, bF as AddTextDirectionOptions, bG as AddTextOptions, b6 as AddTieOptions, b1 as AddVoiceOptions, bx as AddWedgeOptions, bl as AutoBeamOptions, bQ as BarStyle, c7 as BowingType, cg as BreathMarkValue, cj as CaesuraValue, bO as ChangeBarlineOptions, bg as ChangeClefOptions, aX as ChangeNoteDurationOptions, bW as ConvertToGraceOptions, br as CopyNotesMultiMeasureOptions, bo as CopyNotesOptions, bh as CreateTupletOptions, bq as CutNotesOptions, b3 as DuplicatePartOptions, b_ as HarmonyKind, bf as InsertClefChangeOptions, aU as InsertNoteOptions, b0 as LowerAccidentalOptions, be as ModifyDynamicsOptions, bw as ModifyTempoOptions, b5 as MoveNoteToStaffOptions, bs as MultiMeasureSelection, bn as NoteSelection, cc as OctaveShiftType, aT as OperationErrorCode, aS as OperationResult, bt as PasteNotesMultiMeasureOptions, bp as PasteNotesOptions, a$ as RaiseAccidentalOptions, bb as RemoveArticulationOptions, bk as RemoveBeamOptions, c9 as RemoveBowingOptions, ci as RemoveBreathMarkOptions, cl as RemoveCaesuraOptions, c3 as RemoveChordSymbolOptions, bd as RemoveDynamicsOptions, bN as RemoveEndingOptions, bA as RemoveFermataOptions, c6 as RemoveFingeringOptions, bV as RemoveGraceNoteOptions, c0 as RemoveHarmonyOptions, bY as RemoveLyricOptions, aV as RemoveNoteOptions, cf as RemoveOctaveShiftOptions, bC as RemoveOrnamentOptions, bE as RemovePedalOptions, bJ as RemoveRepeatBarlineOptions, bL as RemoveRepeatOptions, b9 as RemoveSlurOptions, cb as RemoveStringNumberOptions, bv as RemoveTempoOptions, b7 as RemoveTieOptions, bi as RemoveTupletOptions, by as RemoveWedgeOptions, bP as SetBarlineOptions, bm as SetBeamingOptions, aZ as SetNotePitchBySemitoneOptions, aY as SetNotePitchOptions, b4 as SetStavesOptions, a_ as ShiftNotePitchOptions, ce as StopOctaveShiftOptions, c4 as UpdateChordSymbolOptions, c1 as UpdateHarmonyOptions, bZ as UpdateLyricOptions, cH as ValidationError, K as addArticulation, T as addBeam, aH as addBowing, aO as addBreathMark, aQ as addCaesura, b as addChord, j as addChordNote, p as addChordNoteChecked, aC as addChordSymbol, ao as addCoda, ap as addDaCapo, aq as addDalSegno, M as addDynamics, aj as addEnding, a6 as addFermata, ar as addFine, aF as addFingering, at as addGraceNote, az as addHarmony, aw as addLyric, g as addNote, n as addNoteChecked, aL as addOctaveShift, a8 as addOrnament, x as addPart, aa as addPedal, ae as addRehearsalMark, ah as addRepeat, af as addRepeatBarline, an as addSegno, I as addSlur, aJ as addStringNumber, a1 as addTempo, ad as addText, ac as addTextDirection, G as addTie, as as addToCoda, w as addVoice, a4 as addWedge, W as autoBeam, al as changeBarline, Q as changeClef, C as changeKey, e as changeNoteDuration, D as changeTime, av as convertToGrace, Y as copyNotes, $ as copyNotesMultiMeasure, R as createTuplet, _ as cutNotes, F as deleteMeasure, h as deleteNote, o as deleteNoteChecked, z as duplicatePart, P as insertClefChange, E as insertMeasure, i as insertNote, l as lowerAccidental, O as modifyDynamics, k as modifyNoteDuration, u as modifyNoteDurationChecked, m as modifyNotePitch, q as modifyNotePitchChecked, a3 as modifyTempo, B as moveNoteToStaff, Z as pasteNotes, a0 as pasteNotesMultiMeasure, f as raiseAccidental, L as removeArticulation, U as removeBeam, aI as removeBowing, aP as removeBreathMark, aR as removeCaesura, aD as removeChordSymbol, N as removeDynamics, ak as removeEnding, a7 as removeFermata, aG as removeFingering, au as removeGraceNote, aA as removeHarmony, ax as removeLyric, r as removeNote, aN as removeOctaveShift, a9 as removeOrnament, y as removePart, ab as removePedal, ai as removeRepeat, ag as removeRepeatBarline, J as removeSlur, aK as removeStringNumber, a2 as removeTempo, H as removeTie, S as removeTuplet, a5 as removeWedge, am as setBarline, X as setBeaming, s as setNotePitch, c as setNotePitchBySemitone, A as setStaves, d as shiftNotePitch, aM as stopOctaveShift, t as transpose, v as transposeChecked, aE as updateChordSymbol, aB as updateHarmony, ay as updateLyric } from '../index-DPW0wqXK.mjs';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import '../types-
|
|
2
|
-
export { ba as AddArticulationOptions, bj as AddBeamOptions, c8 as AddBowingOptions, ch as AddBreathMarkOptions, ck as AddCaesuraOptions, aW as AddChordOptions, c2 as AddChordSymbolOptions, bS as AddCodaOptions, bc as AddDynamicsOptions, bM as AddEndingOptions, bz as AddFermataOptions, c5 as AddFingeringOptions, bU as AddGraceNoteOptions, b$ as AddHarmonyOptions, bX as AddLyricOptions, bT as AddNavigationOptions, cd as AddOctaveShiftOptions, bB as AddOrnamentOptions, b2 as AddPartOptions, bD as AddPedalOptions, bH as AddRehearsalMarkOptions, bI as AddRepeatBarlineOptions, bK as AddRepeatOptions, bR as AddSegnoOptions, b8 as AddSlurOptions, ca as AddStringNumberOptions, bu as AddTempoOptions, bF as AddTextDirectionOptions, bG as AddTextOptions, b6 as AddTieOptions, b1 as AddVoiceOptions, bx as AddWedgeOptions, bl as AutoBeamOptions, bQ as BarStyle, c7 as BowingType, cg as BreathMarkValue, cj as CaesuraValue, bO as ChangeBarlineOptions, bg as ChangeClefOptions, aX as ChangeNoteDurationOptions, bW as ConvertToGraceOptions, br as CopyNotesMultiMeasureOptions, bo as CopyNotesOptions, bh as CreateTupletOptions, bq as CutNotesOptions, b3 as DuplicatePartOptions, b_ as HarmonyKind, bf as InsertClefChangeOptions, aU as InsertNoteOptions, b0 as LowerAccidentalOptions, be as ModifyDynamicsOptions, bw as ModifyTempoOptions, b5 as MoveNoteToStaffOptions, bs as MultiMeasureSelection, bn as NoteSelection, cc as OctaveShiftType, aT as OperationErrorCode, aS as OperationResult, bt as PasteNotesMultiMeasureOptions, bp as PasteNotesOptions, a$ as RaiseAccidentalOptions, bb as RemoveArticulationOptions, bk as RemoveBeamOptions, c9 as RemoveBowingOptions, ci as RemoveBreathMarkOptions, cl as RemoveCaesuraOptions, c3 as RemoveChordSymbolOptions, bd as RemoveDynamicsOptions, bN as RemoveEndingOptions, bA as RemoveFermataOptions, c6 as RemoveFingeringOptions, bV as RemoveGraceNoteOptions, c0 as RemoveHarmonyOptions, bY as RemoveLyricOptions, aV as RemoveNoteOptions, cf as RemoveOctaveShiftOptions, bC as RemoveOrnamentOptions, bE as RemovePedalOptions, bJ as RemoveRepeatBarlineOptions, bL as RemoveRepeatOptions, b9 as RemoveSlurOptions, cb as RemoveStringNumberOptions, bv as RemoveTempoOptions, b7 as RemoveTieOptions, bi as RemoveTupletOptions, by as RemoveWedgeOptions, bP as SetBarlineOptions, bm as SetBeamingOptions, aZ as SetNotePitchBySemitoneOptions, aY as SetNotePitchOptions, b4 as SetStavesOptions, a_ as ShiftNotePitchOptions, ce as StopOctaveShiftOptions, c4 as UpdateChordSymbolOptions, c1 as UpdateHarmonyOptions, bZ as UpdateLyricOptions, cH as ValidationError, K as addArticulation, T as addBeam, aH as addBowing, aO as addBreathMark, aQ as addCaesura, b as addChord, j as addChordNote, p as addChordNoteChecked, aC as addChordSymbol, ao as addCoda, ap as addDaCapo, aq as addDalSegno, M as addDynamics, aj as addEnding, a6 as addFermata, ar as addFine, aF as addFingering, at as addGraceNote, az as addHarmony, aw as addLyric, g as addNote, n as addNoteChecked, aL as addOctaveShift, a8 as addOrnament, x as addPart, aa as addPedal, ae as addRehearsalMark, ah as addRepeat, af as addRepeatBarline, an as addSegno, I as addSlur, aJ as addStringNumber, a1 as addTempo, ad as addText, ac as addTextDirection, G as addTie, as as addToCoda, w as addVoice, a4 as addWedge, W as autoBeam, al as changeBarline, Q as changeClef, C as changeKey, e as changeNoteDuration, D as changeTime, av as convertToGrace, Y as copyNotes, $ as copyNotesMultiMeasure, R as createTuplet, _ as cutNotes, F as deleteMeasure, h as deleteNote, o as deleteNoteChecked, z as duplicatePart, P as insertClefChange, E as insertMeasure, i as insertNote, l as lowerAccidental, O as modifyDynamics, k as modifyNoteDuration, u as modifyNoteDurationChecked, m as modifyNotePitch, q as modifyNotePitchChecked, a3 as modifyTempo, B as moveNoteToStaff, Z as pasteNotes, a0 as pasteNotesMultiMeasure, f as raiseAccidental, L as removeArticulation, U as removeBeam, aI as removeBowing, aP as removeBreathMark, aR as removeCaesura, aD as removeChordSymbol, N as removeDynamics, ak as removeEnding, a7 as removeFermata, aG as removeFingering, au as removeGraceNote, aA as removeHarmony, ax as removeLyric, r as removeNote, aN as removeOctaveShift, a9 as removeOrnament, y as removePart, ab as removePedal, ai as removeRepeat, ag as removeRepeatBarline, J as removeSlur, aK as removeStringNumber, a2 as removeTempo, H as removeTie, S as removeTuplet, a5 as removeWedge, am as setBarline, X as setBeaming, s as setNotePitch, c as setNotePitchBySemitone, A as setStaves, d as shiftNotePitch, aM as stopOctaveShift, t as transpose, v as transposeChecked, aE as updateChordSymbol, aB as updateHarmony, ay as updateLyric } from '../index-
|
|
1
|
+
import '../types-JohtsbUB.js';
|
|
2
|
+
export { ba as AddArticulationOptions, bj as AddBeamOptions, c8 as AddBowingOptions, ch as AddBreathMarkOptions, ck as AddCaesuraOptions, aW as AddChordOptions, c2 as AddChordSymbolOptions, bS as AddCodaOptions, bc as AddDynamicsOptions, bM as AddEndingOptions, bz as AddFermataOptions, c5 as AddFingeringOptions, bU as AddGraceNoteOptions, b$ as AddHarmonyOptions, bX as AddLyricOptions, bT as AddNavigationOptions, cd as AddOctaveShiftOptions, bB as AddOrnamentOptions, b2 as AddPartOptions, bD as AddPedalOptions, bH as AddRehearsalMarkOptions, bI as AddRepeatBarlineOptions, bK as AddRepeatOptions, bR as AddSegnoOptions, b8 as AddSlurOptions, ca as AddStringNumberOptions, bu as AddTempoOptions, bF as AddTextDirectionOptions, bG as AddTextOptions, b6 as AddTieOptions, b1 as AddVoiceOptions, bx as AddWedgeOptions, bl as AutoBeamOptions, bQ as BarStyle, c7 as BowingType, cg as BreathMarkValue, cj as CaesuraValue, bO as ChangeBarlineOptions, bg as ChangeClefOptions, aX as ChangeNoteDurationOptions, bW as ConvertToGraceOptions, br as CopyNotesMultiMeasureOptions, bo as CopyNotesOptions, bh as CreateTupletOptions, bq as CutNotesOptions, b3 as DuplicatePartOptions, b_ as HarmonyKind, bf as InsertClefChangeOptions, aU as InsertNoteOptions, b0 as LowerAccidentalOptions, be as ModifyDynamicsOptions, bw as ModifyTempoOptions, b5 as MoveNoteToStaffOptions, bs as MultiMeasureSelection, bn as NoteSelection, cc as OctaveShiftType, aT as OperationErrorCode, aS as OperationResult, bt as PasteNotesMultiMeasureOptions, bp as PasteNotesOptions, a$ as RaiseAccidentalOptions, bb as RemoveArticulationOptions, bk as RemoveBeamOptions, c9 as RemoveBowingOptions, ci as RemoveBreathMarkOptions, cl as RemoveCaesuraOptions, c3 as RemoveChordSymbolOptions, bd as RemoveDynamicsOptions, bN as RemoveEndingOptions, bA as RemoveFermataOptions, c6 as RemoveFingeringOptions, bV as RemoveGraceNoteOptions, c0 as RemoveHarmonyOptions, bY as RemoveLyricOptions, aV as RemoveNoteOptions, cf as RemoveOctaveShiftOptions, bC as RemoveOrnamentOptions, bE as RemovePedalOptions, bJ as RemoveRepeatBarlineOptions, bL as RemoveRepeatOptions, b9 as RemoveSlurOptions, cb as RemoveStringNumberOptions, bv as RemoveTempoOptions, b7 as RemoveTieOptions, bi as RemoveTupletOptions, by as RemoveWedgeOptions, bP as SetBarlineOptions, bm as SetBeamingOptions, aZ as SetNotePitchBySemitoneOptions, aY as SetNotePitchOptions, b4 as SetStavesOptions, a_ as ShiftNotePitchOptions, ce as StopOctaveShiftOptions, c4 as UpdateChordSymbolOptions, c1 as UpdateHarmonyOptions, bZ as UpdateLyricOptions, cH as ValidationError, K as addArticulation, T as addBeam, aH as addBowing, aO as addBreathMark, aQ as addCaesura, b as addChord, j as addChordNote, p as addChordNoteChecked, aC as addChordSymbol, ao as addCoda, ap as addDaCapo, aq as addDalSegno, M as addDynamics, aj as addEnding, a6 as addFermata, ar as addFine, aF as addFingering, at as addGraceNote, az as addHarmony, aw as addLyric, g as addNote, n as addNoteChecked, aL as addOctaveShift, a8 as addOrnament, x as addPart, aa as addPedal, ae as addRehearsalMark, ah as addRepeat, af as addRepeatBarline, an as addSegno, I as addSlur, aJ as addStringNumber, a1 as addTempo, ad as addText, ac as addTextDirection, G as addTie, as as addToCoda, w as addVoice, a4 as addWedge, W as autoBeam, al as changeBarline, Q as changeClef, C as changeKey, e as changeNoteDuration, D as changeTime, av as convertToGrace, Y as copyNotes, $ as copyNotesMultiMeasure, R as createTuplet, _ as cutNotes, F as deleteMeasure, h as deleteNote, o as deleteNoteChecked, z as duplicatePart, P as insertClefChange, E as insertMeasure, i as insertNote, l as lowerAccidental, O as modifyDynamics, k as modifyNoteDuration, u as modifyNoteDurationChecked, m as modifyNotePitch, q as modifyNotePitchChecked, a3 as modifyTempo, B as moveNoteToStaff, Z as pasteNotes, a0 as pasteNotesMultiMeasure, f as raiseAccidental, L as removeArticulation, U as removeBeam, aI as removeBowing, aP as removeBreathMark, aR as removeCaesura, aD as removeChordSymbol, N as removeDynamics, ak as removeEnding, a7 as removeFermata, aG as removeFingering, au as removeGraceNote, aA as removeHarmony, ax as removeLyric, r as removeNote, aN as removeOctaveShift, a9 as removeOrnament, y as removePart, ab as removePedal, ai as removeRepeat, ag as removeRepeatBarline, J as removeSlur, aK as removeStringNumber, a2 as removeTempo, H as removeTie, S as removeTuplet, a5 as removeWedge, am as setBarline, X as setBeaming, s as setNotePitch, c as setNotePitchBySemitone, A as setStaves, d as shiftNotePitch, aM as stopOctaveShift, t as transpose, v as transposeChecked, aE as updateChordSymbol, aB as updateHarmony, ay as updateLyric } from '../index-DkvcsWdo.js';
|
package/dist/operations/index.js
CHANGED
|
@@ -691,7 +691,7 @@ function validateBeams(measure, location) {
|
|
|
691
691
|
const entry = measure.entries[entryIndex];
|
|
692
692
|
if (entry.type !== "note" || !entry.beam) continue;
|
|
693
693
|
for (const beam of entry.beam) {
|
|
694
|
-
const beamKey = `${beam.number}-${entry.voice}
|
|
694
|
+
const beamKey = `${beam.number}-${entry.voice}`;
|
|
695
695
|
if (beam.type === "begin") {
|
|
696
696
|
if (openBeams.has(beamKey)) {
|
|
697
697
|
errors.push({
|
|
@@ -702,7 +702,7 @@ function validateBeams(measure, location) {
|
|
|
702
702
|
details: { beamNumber: beam.number }
|
|
703
703
|
});
|
|
704
704
|
}
|
|
705
|
-
openBeams.set(beamKey, entryIndex);
|
|
705
|
+
openBeams.set(beamKey, { entryIndex, staff: entry.staff ?? 1 });
|
|
706
706
|
} else if (beam.type === "end") {
|
|
707
707
|
if (!openBeams.has(beamKey)) {
|
|
708
708
|
errors.push({
|
|
@@ -718,8 +718,8 @@ function validateBeams(measure, location) {
|
|
|
718
718
|
}
|
|
719
719
|
}
|
|
720
720
|
}
|
|
721
|
-
for (const [beamKey, startIndex] of openBeams.entries()) {
|
|
722
|
-
const [beamNumber, voice
|
|
721
|
+
for (const [beamKey, { entryIndex: startIndex, staff }] of openBeams.entries()) {
|
|
722
|
+
const [beamNumber, voice] = beamKey.split("-").map(Number);
|
|
723
723
|
errors.push({
|
|
724
724
|
code: "BEAM_BEGIN_WITHOUT_END",
|
|
725
725
|
level: "error",
|
|
@@ -560,7 +560,7 @@ function validateBeams(measure, location) {
|
|
|
560
560
|
const entry = measure.entries[entryIndex];
|
|
561
561
|
if (entry.type !== "note" || !entry.beam) continue;
|
|
562
562
|
for (const beam of entry.beam) {
|
|
563
|
-
const beamKey = `${beam.number}-${entry.voice}
|
|
563
|
+
const beamKey = `${beam.number}-${entry.voice}`;
|
|
564
564
|
if (beam.type === "begin") {
|
|
565
565
|
if (openBeams.has(beamKey)) {
|
|
566
566
|
errors.push({
|
|
@@ -571,7 +571,7 @@ function validateBeams(measure, location) {
|
|
|
571
571
|
details: { beamNumber: beam.number }
|
|
572
572
|
});
|
|
573
573
|
}
|
|
574
|
-
openBeams.set(beamKey, entryIndex);
|
|
574
|
+
openBeams.set(beamKey, { entryIndex, staff: entry.staff ?? 1 });
|
|
575
575
|
} else if (beam.type === "end") {
|
|
576
576
|
if (!openBeams.has(beamKey)) {
|
|
577
577
|
errors.push({
|
|
@@ -587,8 +587,8 @@ function validateBeams(measure, location) {
|
|
|
587
587
|
}
|
|
588
588
|
}
|
|
589
589
|
}
|
|
590
|
-
for (const [beamKey, startIndex] of openBeams.entries()) {
|
|
591
|
-
const [beamNumber, voice
|
|
590
|
+
for (const [beamKey, { entryIndex: startIndex, staff }] of openBeams.entries()) {
|
|
591
|
+
const [beamNumber, voice] = beamKey.split("-").map(Number);
|
|
592
592
|
errors.push({
|
|
593
593
|
code: "BEAM_BEGIN_WITHOUT_END",
|
|
594
594
|
level: "error",
|
package/dist/query/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { M as Measure, N as NoteEntry, V as VoiceGroup, q as StaffGroup, r as NoteWithPosition, s as Chord, S as Score, t as NoteIteratorItem, h as MeasureEntry, x as VoiceToStaffMap, f as Part, C as Clef, G as StaffRange, H as PositionQueryOptions, I as VerticalSlice, J as VoiceLine, E as EntryWithContext, y as NoteWithContext, O as AdjacentNotes, z as DirectionWithContext, a as DirectionEntry, Q as DirectionKind, R as DynamicWithContext, U as TempoWithContext, W as PedalWithContext, X as WedgeWithContext, Y as OctaveShiftWithContext, Z as TiedNoteGroup, _ as SlurSpan, $ as TupletGroup, a0 as BeamGroup, a1 as NotationType, a2 as HarmonyWithContext, ae as HarmonyEntry, a3 as LyricWithContext, a4 as AssembledLyrics, a6 as RepeatInfo, a5 as BarlineWithContext, a7 as EndingInfo, a8 as KeyChangeInfo, a9 as TimeChangeInfo, aa as ClefChangeInfo, ab as StructuralChanges, g as MeasureAttributes, P as Pitch } from '../types-
|
|
1
|
+
import { M as Measure, N as NoteEntry, V as VoiceGroup, q as StaffGroup, r as NoteWithPosition, s as Chord, S as Score, t as NoteIteratorItem, h as MeasureEntry, x as VoiceToStaffMap, f as Part, C as Clef, G as StaffRange, H as PositionQueryOptions, I as VerticalSlice, J as VoiceLine, E as EntryWithContext, y as NoteWithContext, O as AdjacentNotes, z as DirectionWithContext, a as DirectionEntry, Q as DirectionKind, R as DynamicWithContext, U as TempoWithContext, W as PedalWithContext, X as WedgeWithContext, Y as OctaveShiftWithContext, Z as TiedNoteGroup, _ as SlurSpan, $ as TupletGroup, a0 as BeamGroup, a1 as NotationType, a2 as HarmonyWithContext, ae as HarmonyEntry, a3 as LyricWithContext, a4 as AssembledLyrics, a6 as RepeatInfo, a5 as BarlineWithContext, a7 as EndingInfo, a8 as KeyChangeInfo, a9 as TimeChangeInfo, aa as ClefChangeInfo, ab as StructuralChanges, g as MeasureAttributes, P as Pitch } from '../types-JohtsbUB.mjs';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Filter options for voice/staff selection
|
package/dist/query/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { M as Measure, N as NoteEntry, V as VoiceGroup, q as StaffGroup, r as NoteWithPosition, s as Chord, S as Score, t as NoteIteratorItem, h as MeasureEntry, x as VoiceToStaffMap, f as Part, C as Clef, G as StaffRange, H as PositionQueryOptions, I as VerticalSlice, J as VoiceLine, E as EntryWithContext, y as NoteWithContext, O as AdjacentNotes, z as DirectionWithContext, a as DirectionEntry, Q as DirectionKind, R as DynamicWithContext, U as TempoWithContext, W as PedalWithContext, X as WedgeWithContext, Y as OctaveShiftWithContext, Z as TiedNoteGroup, _ as SlurSpan, $ as TupletGroup, a0 as BeamGroup, a1 as NotationType, a2 as HarmonyWithContext, ae as HarmonyEntry, a3 as LyricWithContext, a4 as AssembledLyrics, a6 as RepeatInfo, a5 as BarlineWithContext, a7 as EndingInfo, a8 as KeyChangeInfo, a9 as TimeChangeInfo, aa as ClefChangeInfo, ab as StructuralChanges, g as MeasureAttributes, P as Pitch } from '../types-
|
|
1
|
+
import { M as Measure, N as NoteEntry, V as VoiceGroup, q as StaffGroup, r as NoteWithPosition, s as Chord, S as Score, t as NoteIteratorItem, h as MeasureEntry, x as VoiceToStaffMap, f as Part, C as Clef, G as StaffRange, H as PositionQueryOptions, I as VerticalSlice, J as VoiceLine, E as EntryWithContext, y as NoteWithContext, O as AdjacentNotes, z as DirectionWithContext, a as DirectionEntry, Q as DirectionKind, R as DynamicWithContext, U as TempoWithContext, W as PedalWithContext, X as WedgeWithContext, Y as OctaveShiftWithContext, Z as TiedNoteGroup, _ as SlurSpan, $ as TupletGroup, a0 as BeamGroup, a1 as NotationType, a2 as HarmonyWithContext, ae as HarmonyEntry, a3 as LyricWithContext, a4 as AssembledLyrics, a6 as RepeatInfo, a5 as BarlineWithContext, a7 as EndingInfo, a8 as KeyChangeInfo, a9 as TimeChangeInfo, aa as ClefChangeInfo, ab as StructuralChanges, g as MeasureAttributes, P as Pitch } from '../types-JohtsbUB.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Filter options for voice/staff selection
|