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-CkeI8vw6.js'; 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-CkeI8vw6.js'; import { V as ValidateOptions, a as ValidationResult } from './index-DxLMCMTr.js'; 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-DxLMCMTr.js'; import { TimingSidecar } from './query/index.js'; export { FindNotesFilter, NormalizedPositionOptions, PitchRange, PlaybackControls, PlaybackMeasure, RoundtripMetrics, TimingBreakpoint, TimingMapOptions, VoiceFilter, buildVoiceToStaffMap, buildVoiceToStaffMapForPart, countNotes, extractPlaybackControls, findBarlines, findDirectionsByType, findNotes, findNotesWithNotation, generatePlaybackSequence, generatePlaybackTimeline, 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, hasPlaybackControls, inferStaff, isRestMeasure, iterateEntries, iterateNotes, measureRoundtrip, scoresEqual, withAbsolutePositions } from './query/index.js'; declare function parse(input: string | Uint8Array): Score; /** * Parse a compressed MusicXML (.mxl) file * @param data - The compressed file data as Uint8Array or Buffer * @returns The parsed Score */ declare function parseCompressed(data: Uint8Array): Score; /** * Check if data is a compressed MusicXML file * @param data - The file data * @returns true if the data appears to be a ZIP file */ declare function isCompressed(data: Uint8Array): boolean; /** * Parse either compressed (.mxl) or uncompressed (.xml/.musicxml) MusicXML * Automatically detects the format * @param data - The file data as Uint8Array or string * @returns The parsed Score */ declare function parseAuto(data: Uint8Array | string): Score; /** * ABC Notation Parser * Parses ABC notation format into the Score internal model. * * Supports ABC standard v2.1 core features: * - Header fields (X, T, C, M, L, Q, K, V, w) * - Notes with pitch, duration, accidentals, octave modifiers * - Rests (z, Z) * - Bar lines (|, ||, |], [|, |:, :|, ::) * - Repeats and volta endings ([1, [2) * - Chords (simultaneous notes: [CEG]) * - Chord symbols ("Am", "G7", etc.) * - Ties (-) and slurs ((...)) * - Grace notes ({...}) * - Tuplets ((3..., (p:q:r...) * - Dynamics (!p!, !f!, etc.) * - Lyrics (w: field) * - Multi-voice (V: field) */ /** * Parse an ABC notation string into a Score object. */ declare function parseAbc(abcString: string): Score; interface SerializeOptions { version?: string; indent?: string; /** Validate score before serializing (default: false) */ validate?: boolean; /** Options for validation (if validate is true) */ validateOptions?: ValidateOptions; /** Throw error if validation fails (default: false, will only warn) */ throwOnValidationError?: boolean; /** Callback to receive validation result */ onValidation?: (result: ValidationResult) => void; } declare function serialize(score: Score, options?: SerializeOptions): string; /** * Serialize a Score to compressed MusicXML (.mxl) format * @param score - The Score to serialize * @param options - Serialization options * @returns The compressed file data as Uint8Array */ declare function serializeCompressed(score: Score, options?: SerializeOptions): Uint8Array; /** * MIDI export options */ interface MidiExportOptions { /** Ticks per quarter note (default: 480) */ ticksPerQuarterNote?: number; /** Default tempo in BPM (default: 120) */ defaultTempo?: number; /** Default velocity for notes when no dynamics are present (default: 80) */ defaultVelocity?: number; } /** * A single point on the timing sidecar: a correspondence between a time in the * generated MIDI and a conceptual musical position (measure + beat). * * Breakpoints are emitted at every played-measure start and every tempo change * (plus a terminal point). Between two consecutive breakpoints the relationship * `midiSec ↔ quarterPos` is linear (tempo is piecewise-constant), so a consumer * can interpolate any intermediate time exactly. */ /** Result of {@link exportMidiWithTimingMap}. */ interface MidiWithTimingMap { /** The Standard MIDI File data. */ midi: Uint8Array; /** The MIDI-time ↔ musical-position sidecar. */ sidecar: TimingSidecar; } /** * Export a Score to Standard MIDI File format (SMF Type 1) * @param score - The Score to export * @param options - Export options * @returns The MIDI file data as Uint8Array */ declare function exportMidi(score: Score, options?: MidiExportOptions): Uint8Array; /** * Export a Score to MIDI together with a timing sidecar that maps the generated * MIDI timeline to conceptual musical positions (measure + beat). * * The MIDI bytes are byte-for-byte identical to {@link exportMidi}; the sidecar * is derived from the same internal time computation so the two can never drift. * * @param score - The Score to export * @param options - Export options (must match those used for any aligned audio) * @returns The MIDI data and its timing sidecar */ declare function exportMidiWithTimingMap(score: Score, options?: MidiExportOptions): MidiWithTimingMap; /** * ABC Notation Serializer * Converts Score internal model to ABC notation format string. */ interface AbcSerializeOptions { /** Reference number (X: field). Default: 1 */ referenceNumber?: number; /** Maximum notes per line before wrapping. Default: no limit */ notesPerLine?: number; /** Include chord symbols. Default: true */ includeChordSymbols?: boolean; /** Include dynamics. Default: true */ includeDynamics?: boolean; /** Include lyrics. Default: true */ includeLyrics?: boolean; } /** * Serialize a Score object to ABC notation format string. */ declare function serializeAbc(score: Score, options?: AbcSerializeOptions): string; /** * Parse a MusicXML file from disk * Automatically handles both .xml/.musicxml and .mxl formats * @param filePath - Path to the file * @returns The parsed Score */ declare function parseFile(filePath: string): Promise; /** * Detect encoding from BOM and decode buffer to string * Supports UTF-8, UTF-16BE, UTF-16LE */ declare function decodeBuffer(buffer: Buffer): string; /** * Export options combining all format options */ interface ExportOptions extends SerializeOptions, MidiExportOptions { } /** * Serialize a Score to a file * Format is determined by file extension: * - .mxl: Compressed MusicXML * - .xml/.musicxml: Uncompressed MusicXML * - .mid/.midi: Standard MIDI File * - .abc: ABC notation * @param score - The Score to serialize * @param filePath - Path to write the file * @param options - Serialization options */ declare function serializeToFile(score: Score, filePath: string, options?: ExportOptions): Promise; declare const STEPS: Pitch['step'][]; declare const STEP_SEMITONES: Record; /** Convert pitch to semitone value (MIDI-like) */ declare function pitchToSemitone(pitch: Pitch): number; /** Get position at end of measure */ declare function getMeasureEndPosition(measure: Measure): number; /** * Entry-level accessors for DirectionEntry, NoteEntry, and PartInfo * * These are simple helper functions for working with individual entries, * complementing the score-level query functions in ./query. */ /** * Extracts a specific DirectionType union member by its kind */ type DirectionTypeOfKind = Extract; /** * Get the first direction type of a specific kind from a DirectionEntry * * @example * const dynamics = getDirectionOfKind(entry, 'dynamics'); * if (dynamics) { * console.log(dynamics.value); // 'ff', 'pp', etc. * } */ declare function getDirectionOfKind(entry: DirectionEntry, kind: K): DirectionTypeOfKind | undefined; /** * Get all direction types of a specific kind from a DirectionEntry * * @example * const allWords = getDirectionsOfKind(entry, 'words'); * allWords.forEach(w => console.log(w.text)); */ declare function getDirectionsOfKind(entry: DirectionEntry, kind: K): DirectionTypeOfKind[]; /** * Check if a DirectionEntry contains a specific direction type * * @example * if (hasDirectionOfKind(entry, 'metronome')) { * // Handle tempo marking * } */ declare function hasDirectionOfKind(entry: DirectionEntry, kind: DirectionType['kind']): boolean; /** * Get tempo from DirectionEntry.sound * * @example * const tempo = getSoundTempo(entry); // 120 */ declare function getSoundTempo(entry: DirectionEntry): number | undefined; /** * Get dynamics value from DirectionEntry.sound (MIDI velocity 0-127) * * @example * const dynamics = getSoundDynamics(entry); // 80 */ declare function getSoundDynamics(entry: DirectionEntry): number | undefined; /** * Get damper pedal state from DirectionEntry.sound */ declare function getSoundDamperPedal(entry: DirectionEntry): 'yes' | 'no' | undefined; /** * Get soft pedal state from DirectionEntry.sound */ declare function getSoundSoftPedal(entry: DirectionEntry): 'yes' | 'no' | undefined; /** * Get sostenuto pedal state from DirectionEntry.sound */ declare function getSoundSostenutoPedal(entry: DirectionEntry): 'yes' | 'no' | undefined; /** * Check if a NoteEntry is a rest * * @example * if (isRest(note)) { * console.log('This is a rest'); * } */ declare function isRest(entry: NoteEntry): boolean; /** * Check if a NoteEntry is a pitched note (has pitch information) * * @example * if (isPitchedNote(note)) { * console.log(`Note: ${note.pitch!.step}${note.pitch!.octave}`); * } */ declare function isPitchedNote(entry: NoteEntry): boolean; /** * Check if a NoteEntry is an unpitched note (percussion) */ declare function isUnpitchedNote(entry: NoteEntry): boolean; /** * Check if a NoteEntry is part of a chord (shares onset with previous note) * * @example * const chordNotes = notes.filter(isChordNote); */ declare function isChordNote(entry: NoteEntry): boolean; /** * Check if a NoteEntry is a grace note * * @example * if (isGraceNote(note)) { * console.log('Grace note with slash:', note.grace?.slash); * } */ declare function isGraceNote(entry: NoteEntry): boolean; /** * Check if a NoteEntry has any tie (start, stop, or continue) * * @example * if (hasTie(note)) { * // Note is tied to another note * } */ declare function hasTie(entry: NoteEntry): boolean; /** * Check if a NoteEntry has a tie start */ declare function hasTieStart(entry: NoteEntry): boolean; /** * Check if a NoteEntry has a tie stop */ declare function hasTieStop(entry: NoteEntry): boolean; /** * Check if a NoteEntry is a cue note */ declare function isCueNote(entry: NoteEntry): boolean; /** * Check if a NoteEntry has any beams */ declare function hasBeam(entry: NoteEntry): boolean; /** * Check if a NoteEntry has any lyrics */ declare function hasLyrics(entry: NoteEntry): boolean; /** * Check if a NoteEntry has any notations (articulations, slurs, ornaments, etc.) */ declare function hasNotations(entry: NoteEntry): boolean; /** * Check if a NoteEntry is part of a tuplet */ declare function hasTuplet(entry: NoteEntry): boolean; /** * Check if a PartListEntry is a PartInfo (score-part) */ declare function isPartInfo(entry: PartListEntry): entry is PartInfo; /** * Get PartInfo by part ID * * @example * const partInfo = getPartInfo(score, 'P1'); * if (partInfo) { * console.log(partInfo.name); // 'Piano' * } */ declare function getPartInfo(score: Score, partId: string): PartInfo | undefined; /** * Get part name by part ID * * @example * const name = getPartName(score, 'P1'); // 'Piano' */ declare function getPartName(score: Score, partId: string): string | undefined; /** * Get part abbreviation by part ID * * @example * const abbr = getPartAbbreviation(score, 'P1'); // 'Pno.' */ declare function getPartAbbreviation(score: Score, partId: string): string | undefined; /** * Get all PartInfo entries from a score */ declare function getAllPartInfos(score: Score): PartInfo[]; /** * Get a map of part ID to part name * * @example * const names = getPartNameMap(score); * // { 'P1': 'Piano', 'P2': 'Violin' } */ declare function getPartNameMap(score: Score): Record; /** * Generates a unique ID for elements in the Score structure. * * The ID format is "i" + nanoid(10), where: * - "i" prefix ensures XML ID compatibility (XML IDs must start with a letter or underscore) * - nanoid(10) generates a 10-character URL-safe unique identifier * * Example: "iV1StGXR8_" * * @returns A unique 11-character ID string */ declare function generateId(): string; export { type AbcSerializeOptions, DirectionEntry, DirectionType, type DirectionTypeOfKind, Measure, type MidiExportOptions, type MidiWithTimingMap, NoteEntry, PartInfo, PartListEntry, Pitch, STEPS, STEP_SEMITONES, Score, type SerializeOptions, TimingSidecar, ValidateOptions, ValidationResult, decodeBuffer, exportMidi, exportMidiWithTimingMap, generateId, getAllPartInfos, getDirectionOfKind, getDirectionsOfKind, getMeasureEndPosition, getPartAbbreviation, getPartInfo, getPartName, getPartNameMap, getSoundDamperPedal, getSoundDynamics, getSoundSoftPedal, getSoundSostenutoPedal, getSoundTempo, hasBeam, hasDirectionOfKind, hasLyrics, hasNotations, hasTie, hasTieStart, hasTieStop, hasTuplet, isChordNote, isCompressed, isCueNote, isGraceNote, isPartInfo, isPitchedNote, isRest, isUnpitchedNote, parse, parseAbc, parseAuto, parseCompressed, parseFile, pitchToSemitone, serialize, serializeAbc, serializeCompressed, serializeToFile };