musicxml-io 0.12.0 → 0.12.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +96 -8
- package/dist/abc-HXITSXCS.js +9 -0
- package/dist/abc-IAD53SFI.mjs +11 -0
- package/dist/abc-MTGVOYKS.js +11 -0
- package/dist/abc-R7DIJSHG.mjs +9 -0
- package/dist/abc.d.mts +67 -0
- package/dist/abc.d.ts +67 -0
- package/dist/abc.js +17 -0
- package/dist/abc.mjs +17 -0
- package/dist/accessors/index.d.mts +1 -1
- package/dist/accessors/index.d.ts +1 -1
- package/dist/browser.d.mts +11 -187
- package/dist/browser.d.ts +11 -187
- package/dist/browser.js +30 -6
- package/dist/browser.mjs +96 -72
- package/dist/chunk-2EH2MGBY.js +1799 -0
- package/dist/chunk-33IQXDOH.js +1 -0
- package/dist/chunk-5EK7K5X3.js +29 -0
- package/dist/chunk-5VF442RA.mjs +29 -0
- package/dist/chunk-626TXMVP.js +706 -0
- package/dist/chunk-63UT3IEY.mjs +2788 -0
- package/dist/chunk-6EKVRPFF.js +407 -0
- package/dist/chunk-776XPK66.js +45 -0
- package/dist/chunk-7D4MLQKO.js +69 -0
- package/dist/chunk-A2CGW2UF.js +25 -0
- package/dist/chunk-AOSK4RGV.mjs +45 -0
- package/dist/{chunk-FQ3NEYIV.js → chunk-ASPCIBWD.js} +127 -1249
- package/dist/chunk-BDHPMB7Q.mjs +61 -0
- package/dist/chunk-BHHOS2E6.mjs +407 -0
- package/dist/chunk-F2UCOAO6.mjs +155 -0
- package/dist/chunk-HP4DAUGT.js +2788 -0
- package/dist/chunk-JF5TM534.js +1065 -0
- package/dist/chunk-K6DSQPVF.mjs +706 -0
- package/dist/chunk-KJK2IGNN.mjs +0 -0
- package/dist/chunk-KYGLANYG.mjs +2354 -0
- package/dist/chunk-LFQXT7PV.mjs +69 -0
- package/dist/chunk-LS5SHP75.js +155 -0
- package/dist/chunk-MMIZQMIO.mjs +25 -0
- package/dist/chunk-NIUEAHPN.js +2354 -0
- package/dist/{chunk-EWLB5X64.js → chunk-PMPROVJW.js} +66 -770
- package/dist/chunk-QFYOH4DY.mjs +0 -0
- package/dist/chunk-QKUNJEVW.mjs +1401 -0
- package/dist/chunk-SBT2RMUW.mjs +1065 -0
- package/dist/chunk-TCXDBRRT.mjs +1799 -0
- package/dist/chunk-WNQIUYWY.js +61 -0
- package/dist/{chunk-I4X4GRMP.mjs → chunk-WS5LSW3S.mjs} +13 -1135
- package/dist/chunk-YKMNCYOD.js +1 -0
- package/dist/{chunk-UMEH3ENQ.mjs → chunk-ZRKJKEP7.mjs} +0 -704
- package/dist/chunk-ZSEJQPBO.js +1401 -0
- package/dist/core.d.mts +33 -0
- package/dist/core.d.ts +33 -0
- package/dist/core.js +524 -0
- package/dist/core.mjs +524 -0
- package/dist/file.d.mts +37 -0
- package/dist/file.d.ts +37 -0
- package/dist/file.js +14 -0
- package/dist/file.mjs +14 -0
- package/dist/index-C9lLZwol.d.mts +185 -0
- package/dist/index-DNA970t1.d.ts +185 -0
- package/dist/index.d.mts +12 -38
- package/dist/index.d.ts +12 -38
- package/dist/index.js +34 -49
- package/dist/index.mjs +101 -116
- package/dist/midi.d.mts +54 -0
- package/dist/midi.d.ts +54 -0
- package/dist/midi.js +10 -0
- package/dist/midi.mjs +10 -0
- package/dist/musicxml-DWPClEqa.d.ts +25 -0
- package/dist/musicxml-DzuFr2c3.d.mts +25 -0
- package/dist/musicxml-compressed-7NUEGLSF.mjs +8 -0
- package/dist/musicxml-compressed-7RL6QRF7.js +12 -0
- package/dist/musicxml-compressed-WPEIBOZ3.js +8 -0
- package/dist/musicxml-compressed-ZHZYFJ7H.mjs +12 -0
- package/dist/musicxml-compressed.d.mts +33 -0
- package/dist/musicxml-compressed.d.ts +33 -0
- package/dist/musicxml-compressed.js +18 -0
- package/dist/musicxml-compressed.mjs +18 -0
- package/dist/musicxml.d.mts +8 -0
- package/dist/musicxml.d.ts +8 -0
- package/dist/musicxml.js +14 -0
- package/dist/musicxml.mjs +14 -0
- package/dist/operations/index.d.mts +1234 -2
- package/dist/operations/index.d.ts +1234 -2
- package/dist/operations/index.js +7 -3
- package/dist/operations/index.mjs +6 -2
- package/dist/playback-timeline-CVRHsikj.d.mts +129 -0
- package/dist/playback-timeline-CmWA8YDy.d.ts +129 -0
- package/dist/query/index.d.mts +3 -128
- package/dist/query/index.d.ts +3 -128
- package/dist/query/index.js +4 -2
- package/dist/query/index.mjs +7 -5
- package/dist/{types-Cy0veafI.d.mts → types-B-RGHY0c.d.mts} +1 -1
- package/dist/{types-Cy0veafI.d.ts → types-B-RGHY0c.d.ts} +1 -1
- package/package.json +36 -2
- package/dist/chunk-T2USSS5E.mjs +0 -8939
- package/dist/chunk-UT7LQW6V.js +0 -8939
- package/dist/index-CbUtBHLD.d.ts +0 -1415
- package/dist/index-CuMPBK7U.d.mts +0 -1415
package/dist/operations/index.js
CHANGED
|
@@ -108,8 +108,12 @@
|
|
|
108
108
|
|
|
109
109
|
|
|
110
110
|
|
|
111
|
-
var
|
|
112
|
-
require('../chunk-
|
|
111
|
+
var _chunkASPCIBWDjs = require('../chunk-ASPCIBWD.js');
|
|
112
|
+
require('../chunk-PMPROVJW.js');
|
|
113
|
+
require('../chunk-776XPK66.js');
|
|
114
|
+
require('../chunk-626TXMVP.js');
|
|
115
|
+
require('../chunk-JF5TM534.js');
|
|
116
|
+
require('../chunk-5EK7K5X3.js');
|
|
113
117
|
|
|
114
118
|
|
|
115
119
|
|
|
@@ -220,4 +224,4 @@ require('../chunk-EWLB5X64.js');
|
|
|
220
224
|
|
|
221
225
|
|
|
222
226
|
|
|
223
|
-
exports.ALL_COLOR_TARGETS =
|
|
227
|
+
exports.ALL_COLOR_TARGETS = _chunkASPCIBWDjs.ALL_COLOR_TARGETS; exports.addArticulation = _chunkASPCIBWDjs.addArticulation; exports.addBeam = _chunkASPCIBWDjs.addBeam; exports.addBowing = _chunkASPCIBWDjs.addBowing; exports.addBreathMark = _chunkASPCIBWDjs.addBreathMark; exports.addCaesura = _chunkASPCIBWDjs.addCaesura; exports.addChord = _chunkASPCIBWDjs.addChord; exports.addChordNote = _chunkASPCIBWDjs.addChordNote; exports.addChordNoteChecked = _chunkASPCIBWDjs.addChordNoteChecked; exports.addChordSymbol = _chunkASPCIBWDjs.addChordSymbol; exports.addCoda = _chunkASPCIBWDjs.addCoda; exports.addDaCapo = _chunkASPCIBWDjs.addDaCapo; exports.addDalSegno = _chunkASPCIBWDjs.addDalSegno; exports.addDynamics = _chunkASPCIBWDjs.addDynamics; exports.addEnding = _chunkASPCIBWDjs.addEnding; exports.addFermata = _chunkASPCIBWDjs.addFermata; exports.addFine = _chunkASPCIBWDjs.addFine; exports.addFingering = _chunkASPCIBWDjs.addFingering; exports.addGraceNote = _chunkASPCIBWDjs.addGraceNote; exports.addHarmony = _chunkASPCIBWDjs.addHarmony; exports.addLyric = _chunkASPCIBWDjs.addLyric; exports.addNote = _chunkASPCIBWDjs.addNote; exports.addNoteChecked = _chunkASPCIBWDjs.addNoteChecked; exports.addOctaveShift = _chunkASPCIBWDjs.addOctaveShift; exports.addOrnament = _chunkASPCIBWDjs.addOrnament; exports.addPart = _chunkASPCIBWDjs.addPart; exports.addPedal = _chunkASPCIBWDjs.addPedal; exports.addRehearsalMark = _chunkASPCIBWDjs.addRehearsalMark; exports.addRepeat = _chunkASPCIBWDjs.addRepeat; exports.addRepeatBarline = _chunkASPCIBWDjs.addRepeatBarline; exports.addSegno = _chunkASPCIBWDjs.addSegno; exports.addSlur = _chunkASPCIBWDjs.addSlur; exports.addStringNumber = _chunkASPCIBWDjs.addStringNumber; exports.addTempo = _chunkASPCIBWDjs.addTempo; exports.addText = _chunkASPCIBWDjs.addText; exports.addTextDirection = _chunkASPCIBWDjs.addTextDirection; exports.addTie = _chunkASPCIBWDjs.addTie; exports.addToCoda = _chunkASPCIBWDjs.addToCoda; exports.addVoice = _chunkASPCIBWDjs.addVoice; exports.addWedge = _chunkASPCIBWDjs.addWedge; exports.autoBeam = _chunkASPCIBWDjs.autoBeam; exports.changeBarline = _chunkASPCIBWDjs.changeBarline; exports.changeClef = _chunkASPCIBWDjs.changeClef; exports.changeKey = _chunkASPCIBWDjs.changeKey; exports.changeNoteDuration = _chunkASPCIBWDjs.changeNoteDuration; exports.changeTime = _chunkASPCIBWDjs.changeTime; exports.clearColors = _chunkASPCIBWDjs.clearColors; exports.convertToGrace = _chunkASPCIBWDjs.convertToGrace; exports.copyNotes = _chunkASPCIBWDjs.copyNotes; exports.copyNotesMultiMeasure = _chunkASPCIBWDjs.copyNotesMultiMeasure; exports.createTuplet = _chunkASPCIBWDjs.createTuplet; exports.cutNotes = _chunkASPCIBWDjs.cutNotes; exports.deleteMeasure = _chunkASPCIBWDjs.deleteMeasure; exports.deleteNote = _chunkASPCIBWDjs.deleteNote; exports.deleteNoteChecked = _chunkASPCIBWDjs.deleteNoteChecked; exports.duplicatePart = _chunkASPCIBWDjs.duplicatePart; exports.insertClefChange = _chunkASPCIBWDjs.insertClefChange; exports.insertMeasure = _chunkASPCIBWDjs.insertMeasure; exports.insertNote = _chunkASPCIBWDjs.insertNote; exports.lowerAccidental = _chunkASPCIBWDjs.lowerAccidental; exports.modifyDynamics = _chunkASPCIBWDjs.modifyDynamics; exports.modifyNoteDuration = _chunkASPCIBWDjs.modifyNoteDuration; exports.modifyNoteDurationChecked = _chunkASPCIBWDjs.modifyNoteDurationChecked; exports.modifyNotePitch = _chunkASPCIBWDjs.modifyNotePitch; exports.modifyNotePitchChecked = _chunkASPCIBWDjs.modifyNotePitchChecked; exports.modifyTempo = _chunkASPCIBWDjs.modifyTempo; exports.moveNoteToStaff = _chunkASPCIBWDjs.moveNoteToStaff; exports.pasteNotes = _chunkASPCIBWDjs.pasteNotes; exports.pasteNotesMultiMeasure = _chunkASPCIBWDjs.pasteNotesMultiMeasure; exports.raiseAccidental = _chunkASPCIBWDjs.raiseAccidental; exports.removeArticulation = _chunkASPCIBWDjs.removeArticulation; exports.removeBeam = _chunkASPCIBWDjs.removeBeam; exports.removeBowing = _chunkASPCIBWDjs.removeBowing; exports.removeBreathMark = _chunkASPCIBWDjs.removeBreathMark; exports.removeCaesura = _chunkASPCIBWDjs.removeCaesura; exports.removeChordSymbol = _chunkASPCIBWDjs.removeChordSymbol; exports.removeDynamics = _chunkASPCIBWDjs.removeDynamics; exports.removeEnding = _chunkASPCIBWDjs.removeEnding; exports.removeFermata = _chunkASPCIBWDjs.removeFermata; exports.removeFingering = _chunkASPCIBWDjs.removeFingering; exports.removeGraceNote = _chunkASPCIBWDjs.removeGraceNote; exports.removeHarmony = _chunkASPCIBWDjs.removeHarmony; exports.removeLyric = _chunkASPCIBWDjs.removeLyric; exports.removeNote = _chunkASPCIBWDjs.removeNote; exports.removeOctaveShift = _chunkASPCIBWDjs.removeOctaveShift; exports.removeOrnament = _chunkASPCIBWDjs.removeOrnament; exports.removePart = _chunkASPCIBWDjs.removePart; exports.removePedal = _chunkASPCIBWDjs.removePedal; exports.removeRepeat = _chunkASPCIBWDjs.removeRepeat; exports.removeRepeatBarline = _chunkASPCIBWDjs.removeRepeatBarline; exports.removeSlur = _chunkASPCIBWDjs.removeSlur; exports.removeStringNumber = _chunkASPCIBWDjs.removeStringNumber; exports.removeTempo = _chunkASPCIBWDjs.removeTempo; exports.removeTie = _chunkASPCIBWDjs.removeTie; exports.removeTuplet = _chunkASPCIBWDjs.removeTuplet; exports.removeWedge = _chunkASPCIBWDjs.removeWedge; exports.setBarline = _chunkASPCIBWDjs.setBarline; exports.setBeaming = _chunkASPCIBWDjs.setBeaming; exports.setColor = _chunkASPCIBWDjs.setColor; exports.setNotePitch = _chunkASPCIBWDjs.setNotePitch; exports.setNotePitchBySemitone = _chunkASPCIBWDjs.setNotePitchBySemitone; exports.setStaves = _chunkASPCIBWDjs.setStaves; exports.shiftNotePitch = _chunkASPCIBWDjs.shiftNotePitch; exports.stopOctaveShift = _chunkASPCIBWDjs.stopOctaveShift; exports.transpose = _chunkASPCIBWDjs.transpose; exports.transposeChecked = _chunkASPCIBWDjs.transposeChecked; exports.updateChordSymbol = _chunkASPCIBWDjs.updateChordSymbol; exports.updateHarmony = _chunkASPCIBWDjs.updateHarmony; exports.updateLyric = _chunkASPCIBWDjs.updateLyric;
|
|
@@ -108,8 +108,12 @@ import {
|
|
|
108
108
|
updateChordSymbol,
|
|
109
109
|
updateHarmony,
|
|
110
110
|
updateLyric
|
|
111
|
-
} from "../chunk-
|
|
112
|
-
import "../chunk-
|
|
111
|
+
} from "../chunk-WS5LSW3S.mjs";
|
|
112
|
+
import "../chunk-ZRKJKEP7.mjs";
|
|
113
|
+
import "../chunk-AOSK4RGV.mjs";
|
|
114
|
+
import "../chunk-K6DSQPVF.mjs";
|
|
115
|
+
import "../chunk-SBT2RMUW.mjs";
|
|
116
|
+
import "../chunk-5VF442RA.mjs";
|
|
113
117
|
export {
|
|
114
118
|
ALL_COLOR_TARGETS,
|
|
115
119
|
addArticulation,
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { S as Score } from './types-B-RGHY0c.mjs';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Playback Timeline
|
|
5
|
+
*
|
|
6
|
+
* Where {@link generatePlaybackSequence} gives the ORDER measures are played
|
|
7
|
+
* (with repeats/voltas/jumps expanded), this gives the same expanded playback
|
|
8
|
+
* WITH absolute times: a mapping between elapsed seconds and conceptual musical
|
|
9
|
+
* position (measure + beat).
|
|
10
|
+
*
|
|
11
|
+
* This is a pure analysis of the score's playback interpretation (tempo +
|
|
12
|
+
* repeat expansion). It is the one thing a downstream audio-to-score aligner
|
|
13
|
+
* integration cannot recompute from the MusicXML alone — everything else about
|
|
14
|
+
* the score (pitches, parts, voices, durations) the consumer already has and
|
|
15
|
+
* can derive from a musical position. The seconds here are tempo-derived and
|
|
16
|
+
* therefore equal to the playback time of the MIDI produced by `exportMidi`,
|
|
17
|
+
* which shares this exact timeline computation.
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Expressive-timing options shared by the MIDI exporter and the timeline query.
|
|
22
|
+
*
|
|
23
|
+
* These shape the TEMPO map only — never note durations. The whole module
|
|
24
|
+
* follows "method A": notated tick lengths (and therefore `quarterPos`) are the
|
|
25
|
+
* score's, and every expressive change in elapsed time is carried by tempo
|
|
26
|
+
* (`set_tempo`). This keeps `tick ÷ tpqn` exactly equal to the musical quarter
|
|
27
|
+
* position so the sidecar maps with zero drift.
|
|
28
|
+
*/
|
|
29
|
+
interface ExpressionOptions {
|
|
30
|
+
/**
|
|
31
|
+
* Fermata hold factor: a fermata note/rest's tick span is stretched in
|
|
32
|
+
* elapsed time by this factor by dividing the prevailing BPM over the span
|
|
33
|
+
* (e.g. 2 → the span plays at half BPM, lasting twice as long). The note's
|
|
34
|
+
* tick length and `quarterPos` are unchanged. `1` disables. Default `1.75`.
|
|
35
|
+
*/
|
|
36
|
+
fermataHoldMultiplier?: number;
|
|
37
|
+
/**
|
|
38
|
+
* Seconds of extra time a caesura ("railroad tracks") inserts, modelled as a
|
|
39
|
+
* tempo dip over the tail of the note carrying it (no tick is added).
|
|
40
|
+
* Default `0.4`. `0` disables.
|
|
41
|
+
*/
|
|
42
|
+
caesuraSeconds?: number;
|
|
43
|
+
/**
|
|
44
|
+
* Seconds of extra time a breath mark inserts, modelled like a caesura but
|
|
45
|
+
* shorter. Default `0.25`. `0` disables.
|
|
46
|
+
*/
|
|
47
|
+
breathSeconds?: number;
|
|
48
|
+
/**
|
|
49
|
+
* Number of discrete `set_tempo` steps used to approximate a rit./accel.
|
|
50
|
+
* tempo ramp between two tempo anchors. Higher = smoother. Default `12`.
|
|
51
|
+
*/
|
|
52
|
+
tempoRampSteps?: number;
|
|
53
|
+
}
|
|
54
|
+
/** Options controlling the rendered timeline. */
|
|
55
|
+
interface TimingMapOptions extends ExpressionOptions {
|
|
56
|
+
/**
|
|
57
|
+
* Ticks per quarter note (default: 480). Only affects internal tick rounding;
|
|
58
|
+
* `midiSec`/`quarterPos` are otherwise independent of it.
|
|
59
|
+
*/
|
|
60
|
+
ticksPerQuarterNote?: number;
|
|
61
|
+
/** Default tempo in BPM when the score carries no tempo marking (default: 120). */
|
|
62
|
+
defaultTempo?: number;
|
|
63
|
+
}
|
|
64
|
+
/** A single point on the timeline: a time ↔ musical-position correspondence. */
|
|
65
|
+
interface TimingBreakpoint {
|
|
66
|
+
/** Elapsed playback time, in seconds (equals the MIDI time of `exportMidi`). */
|
|
67
|
+
midiSec: number;
|
|
68
|
+
/**
|
|
69
|
+
* Cumulative quarter notes from the start of (repeat-expanded) playback.
|
|
70
|
+
* This is the monotone axis to interpolate against: within a constant-tempo
|
|
71
|
+
* segment `midiSec` is linear in `quarterPos`.
|
|
72
|
+
*/
|
|
73
|
+
quarterPos: number;
|
|
74
|
+
/** Printed measure number (MusicXML `<measure number>`), e.g. "12". */
|
|
75
|
+
measureNumber: string;
|
|
76
|
+
/** Quarter-note offset within the measure (0 at the measure start). */
|
|
77
|
+
beatInMeasure: number;
|
|
78
|
+
/**
|
|
79
|
+
* Which repeat iteration produced this measure (1-based; 0 = not in a
|
|
80
|
+
* repeat). The same measure appears multiple times when repeated.
|
|
81
|
+
*/
|
|
82
|
+
repeatIteration: number;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Maps the playback timeline to conceptual musical positions.
|
|
86
|
+
*
|
|
87
|
+
* Pair it with an audio aligner that returns `audioSec ↔ midiSec` to follow a
|
|
88
|
+
* recording on the score:
|
|
89
|
+
* `audioSec → (aligner) → midiSec → (this, interpolate quarterPos) → (measure, beat)`.
|
|
90
|
+
*/
|
|
91
|
+
interface TimingSidecar {
|
|
92
|
+
/** Sidecar schema version. */
|
|
93
|
+
version: string;
|
|
94
|
+
/** Total duration of the playback, in seconds. */
|
|
95
|
+
durationSec: number;
|
|
96
|
+
/** Ticks per quarter note used internally. */
|
|
97
|
+
ticksPerQuarterNote: number;
|
|
98
|
+
/** Breakpoints, sorted ascending and monotone by `midiSec`. */
|
|
99
|
+
breakpoints: TimingBreakpoint[];
|
|
100
|
+
/**
|
|
101
|
+
* Expressive-timing regions (fermatas, caesuras, breaths, rit./accel.). An
|
|
102
|
+
* aligner can relax its time constraints inside these spans, since the human
|
|
103
|
+
* performance is free to depart most from the grid there. Sorted by
|
|
104
|
+
* `fromMidiSec`. Omitted entirely when there are none.
|
|
105
|
+
*/
|
|
106
|
+
expressions?: ExpressionHint[];
|
|
107
|
+
}
|
|
108
|
+
/** The kind of expressive timing a span represents. */
|
|
109
|
+
type ExpressionKind = 'fermata' | 'caesura' | 'breath' | 'rit' | 'accel';
|
|
110
|
+
/** A time region (in MIDI seconds) carrying expressive tempo change. */
|
|
111
|
+
interface ExpressionHint {
|
|
112
|
+
type: ExpressionKind;
|
|
113
|
+
/** Start of the region in MIDI seconds. */
|
|
114
|
+
fromMidiSec: number;
|
|
115
|
+
/** End of the region in MIDI seconds. */
|
|
116
|
+
toMidiSec: number;
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Generate the playback timeline (MIDI seconds ↔ conceptual musical position)
|
|
120
|
+
* for a score, with repeats/voltas/jumps expanded.
|
|
121
|
+
*
|
|
122
|
+
* @param score - The score to analyze
|
|
123
|
+
* @param options - Tempo/resolution options (use the same values as any MIDI
|
|
124
|
+
* export the timeline is paired with)
|
|
125
|
+
* @returns The timing sidecar
|
|
126
|
+
*/
|
|
127
|
+
declare function generatePlaybackTimeline(score: Score, options?: TimingMapOptions): TimingSidecar;
|
|
128
|
+
|
|
129
|
+
export { type ExpressionOptions as E, type TimingMapOptions as T, type TimingSidecar as a, type TimingBreakpoint as b, type ExpressionHint as c, type ExpressionKind as d, generatePlaybackTimeline as g };
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { S as Score } from './types-B-RGHY0c.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Playback Timeline
|
|
5
|
+
*
|
|
6
|
+
* Where {@link generatePlaybackSequence} gives the ORDER measures are played
|
|
7
|
+
* (with repeats/voltas/jumps expanded), this gives the same expanded playback
|
|
8
|
+
* WITH absolute times: a mapping between elapsed seconds and conceptual musical
|
|
9
|
+
* position (measure + beat).
|
|
10
|
+
*
|
|
11
|
+
* This is a pure analysis of the score's playback interpretation (tempo +
|
|
12
|
+
* repeat expansion). It is the one thing a downstream audio-to-score aligner
|
|
13
|
+
* integration cannot recompute from the MusicXML alone — everything else about
|
|
14
|
+
* the score (pitches, parts, voices, durations) the consumer already has and
|
|
15
|
+
* can derive from a musical position. The seconds here are tempo-derived and
|
|
16
|
+
* therefore equal to the playback time of the MIDI produced by `exportMidi`,
|
|
17
|
+
* which shares this exact timeline computation.
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Expressive-timing options shared by the MIDI exporter and the timeline query.
|
|
22
|
+
*
|
|
23
|
+
* These shape the TEMPO map only — never note durations. The whole module
|
|
24
|
+
* follows "method A": notated tick lengths (and therefore `quarterPos`) are the
|
|
25
|
+
* score's, and every expressive change in elapsed time is carried by tempo
|
|
26
|
+
* (`set_tempo`). This keeps `tick ÷ tpqn` exactly equal to the musical quarter
|
|
27
|
+
* position so the sidecar maps with zero drift.
|
|
28
|
+
*/
|
|
29
|
+
interface ExpressionOptions {
|
|
30
|
+
/**
|
|
31
|
+
* Fermata hold factor: a fermata note/rest's tick span is stretched in
|
|
32
|
+
* elapsed time by this factor by dividing the prevailing BPM over the span
|
|
33
|
+
* (e.g. 2 → the span plays at half BPM, lasting twice as long). The note's
|
|
34
|
+
* tick length and `quarterPos` are unchanged. `1` disables. Default `1.75`.
|
|
35
|
+
*/
|
|
36
|
+
fermataHoldMultiplier?: number;
|
|
37
|
+
/**
|
|
38
|
+
* Seconds of extra time a caesura ("railroad tracks") inserts, modelled as a
|
|
39
|
+
* tempo dip over the tail of the note carrying it (no tick is added).
|
|
40
|
+
* Default `0.4`. `0` disables.
|
|
41
|
+
*/
|
|
42
|
+
caesuraSeconds?: number;
|
|
43
|
+
/**
|
|
44
|
+
* Seconds of extra time a breath mark inserts, modelled like a caesura but
|
|
45
|
+
* shorter. Default `0.25`. `0` disables.
|
|
46
|
+
*/
|
|
47
|
+
breathSeconds?: number;
|
|
48
|
+
/**
|
|
49
|
+
* Number of discrete `set_tempo` steps used to approximate a rit./accel.
|
|
50
|
+
* tempo ramp between two tempo anchors. Higher = smoother. Default `12`.
|
|
51
|
+
*/
|
|
52
|
+
tempoRampSteps?: number;
|
|
53
|
+
}
|
|
54
|
+
/** Options controlling the rendered timeline. */
|
|
55
|
+
interface TimingMapOptions extends ExpressionOptions {
|
|
56
|
+
/**
|
|
57
|
+
* Ticks per quarter note (default: 480). Only affects internal tick rounding;
|
|
58
|
+
* `midiSec`/`quarterPos` are otherwise independent of it.
|
|
59
|
+
*/
|
|
60
|
+
ticksPerQuarterNote?: number;
|
|
61
|
+
/** Default tempo in BPM when the score carries no tempo marking (default: 120). */
|
|
62
|
+
defaultTempo?: number;
|
|
63
|
+
}
|
|
64
|
+
/** A single point on the timeline: a time ↔ musical-position correspondence. */
|
|
65
|
+
interface TimingBreakpoint {
|
|
66
|
+
/** Elapsed playback time, in seconds (equals the MIDI time of `exportMidi`). */
|
|
67
|
+
midiSec: number;
|
|
68
|
+
/**
|
|
69
|
+
* Cumulative quarter notes from the start of (repeat-expanded) playback.
|
|
70
|
+
* This is the monotone axis to interpolate against: within a constant-tempo
|
|
71
|
+
* segment `midiSec` is linear in `quarterPos`.
|
|
72
|
+
*/
|
|
73
|
+
quarterPos: number;
|
|
74
|
+
/** Printed measure number (MusicXML `<measure number>`), e.g. "12". */
|
|
75
|
+
measureNumber: string;
|
|
76
|
+
/** Quarter-note offset within the measure (0 at the measure start). */
|
|
77
|
+
beatInMeasure: number;
|
|
78
|
+
/**
|
|
79
|
+
* Which repeat iteration produced this measure (1-based; 0 = not in a
|
|
80
|
+
* repeat). The same measure appears multiple times when repeated.
|
|
81
|
+
*/
|
|
82
|
+
repeatIteration: number;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Maps the playback timeline to conceptual musical positions.
|
|
86
|
+
*
|
|
87
|
+
* Pair it with an audio aligner that returns `audioSec ↔ midiSec` to follow a
|
|
88
|
+
* recording on the score:
|
|
89
|
+
* `audioSec → (aligner) → midiSec → (this, interpolate quarterPos) → (measure, beat)`.
|
|
90
|
+
*/
|
|
91
|
+
interface TimingSidecar {
|
|
92
|
+
/** Sidecar schema version. */
|
|
93
|
+
version: string;
|
|
94
|
+
/** Total duration of the playback, in seconds. */
|
|
95
|
+
durationSec: number;
|
|
96
|
+
/** Ticks per quarter note used internally. */
|
|
97
|
+
ticksPerQuarterNote: number;
|
|
98
|
+
/** Breakpoints, sorted ascending and monotone by `midiSec`. */
|
|
99
|
+
breakpoints: TimingBreakpoint[];
|
|
100
|
+
/**
|
|
101
|
+
* Expressive-timing regions (fermatas, caesuras, breaths, rit./accel.). An
|
|
102
|
+
* aligner can relax its time constraints inside these spans, since the human
|
|
103
|
+
* performance is free to depart most from the grid there. Sorted by
|
|
104
|
+
* `fromMidiSec`. Omitted entirely when there are none.
|
|
105
|
+
*/
|
|
106
|
+
expressions?: ExpressionHint[];
|
|
107
|
+
}
|
|
108
|
+
/** The kind of expressive timing a span represents. */
|
|
109
|
+
type ExpressionKind = 'fermata' | 'caesura' | 'breath' | 'rit' | 'accel';
|
|
110
|
+
/** A time region (in MIDI seconds) carrying expressive tempo change. */
|
|
111
|
+
interface ExpressionHint {
|
|
112
|
+
type: ExpressionKind;
|
|
113
|
+
/** Start of the region in MIDI seconds. */
|
|
114
|
+
fromMidiSec: number;
|
|
115
|
+
/** End of the region in MIDI seconds. */
|
|
116
|
+
toMidiSec: number;
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Generate the playback timeline (MIDI seconds ↔ conceptual musical position)
|
|
120
|
+
* for a score, with repeats/voltas/jumps expanded.
|
|
121
|
+
*
|
|
122
|
+
* @param score - The score to analyze
|
|
123
|
+
* @param options - Tempo/resolution options (use the same values as any MIDI
|
|
124
|
+
* export the timeline is paired with)
|
|
125
|
+
* @returns The timing sidecar
|
|
126
|
+
*/
|
|
127
|
+
declare function generatePlaybackTimeline(score: Score, options?: TimingMapOptions): TimingSidecar;
|
|
128
|
+
|
|
129
|
+
export { type ExpressionOptions as E, type TimingMapOptions as T, type TimingSidecar as a, type TimingBreakpoint as b, type ExpressionHint as c, type ExpressionKind as d, generatePlaybackTimeline as g };
|
package/dist/query/index.d.mts
CHANGED
|
@@ -1,130 +1,5 @@
|
|
|
1
|
-
import { S as Score, d as Part, M as Measure, N as NoteEntry, V as VoiceGroup, z as StaffGroup, E as NoteWithPosition, G as Chord, I as NoteIteratorItem, f as MeasureEntry, W as VoiceToStaffMap, w as Clef, _ as StaffRange, $ as PositionQueryOptions, a0 as VerticalSlice, a1 as VoiceLine, Y as EntryWithContext, X as NoteWithContext, a2 as AdjacentNotes, Z as DirectionWithContext, D as DirectionEntry, a3 as DirectionKind, a4 as DynamicWithContext, a5 as TempoWithContext, a6 as PedalWithContext, a7 as WedgeWithContext, a8 as OctaveShiftWithContext, a9 as TiedNoteGroup, aa as SlurSpan, ab as TupletGroup, ac as BeamGroup, ad as NotationType, ae as HarmonyWithContext, H as HarmonyEntry, af as LyricWithContext, ag as AssembledLyrics, ai as RepeatInfo, ah as BarlineWithContext, aj as EndingInfo, ak as KeyChangeInfo, al as TimeChangeInfo, am as ClefChangeInfo, an as StructuralChanges, e as MeasureAttributes, g as Pitch } from '../types-
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Playback Timeline
|
|
5
|
-
*
|
|
6
|
-
* Where {@link generatePlaybackSequence} gives the ORDER measures are played
|
|
7
|
-
* (with repeats/voltas/jumps expanded), this gives the same expanded playback
|
|
8
|
-
* WITH absolute times: a mapping between elapsed seconds and conceptual musical
|
|
9
|
-
* position (measure + beat).
|
|
10
|
-
*
|
|
11
|
-
* This is a pure analysis of the score's playback interpretation (tempo +
|
|
12
|
-
* repeat expansion). It is the one thing a downstream audio-to-score aligner
|
|
13
|
-
* integration cannot recompute from the MusicXML alone — everything else about
|
|
14
|
-
* the score (pitches, parts, voices, durations) the consumer already has and
|
|
15
|
-
* can derive from a musical position. The seconds here are tempo-derived and
|
|
16
|
-
* therefore equal to the playback time of the MIDI produced by `exportMidi`,
|
|
17
|
-
* which shares this exact timeline computation.
|
|
18
|
-
*/
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* Expressive-timing options shared by the MIDI exporter and the timeline query.
|
|
22
|
-
*
|
|
23
|
-
* These shape the TEMPO map only — never note durations. The whole module
|
|
24
|
-
* follows "method A": notated tick lengths (and therefore `quarterPos`) are the
|
|
25
|
-
* score's, and every expressive change in elapsed time is carried by tempo
|
|
26
|
-
* (`set_tempo`). This keeps `tick ÷ tpqn` exactly equal to the musical quarter
|
|
27
|
-
* position so the sidecar maps with zero drift.
|
|
28
|
-
*/
|
|
29
|
-
interface ExpressionOptions {
|
|
30
|
-
/**
|
|
31
|
-
* Fermata hold factor: a fermata note/rest's tick span is stretched in
|
|
32
|
-
* elapsed time by this factor by dividing the prevailing BPM over the span
|
|
33
|
-
* (e.g. 2 → the span plays at half BPM, lasting twice as long). The note's
|
|
34
|
-
* tick length and `quarterPos` are unchanged. `1` disables. Default `1.75`.
|
|
35
|
-
*/
|
|
36
|
-
fermataHoldMultiplier?: number;
|
|
37
|
-
/**
|
|
38
|
-
* Seconds of extra time a caesura ("railroad tracks") inserts, modelled as a
|
|
39
|
-
* tempo dip over the tail of the note carrying it (no tick is added).
|
|
40
|
-
* Default `0.4`. `0` disables.
|
|
41
|
-
*/
|
|
42
|
-
caesuraSeconds?: number;
|
|
43
|
-
/**
|
|
44
|
-
* Seconds of extra time a breath mark inserts, modelled like a caesura but
|
|
45
|
-
* shorter. Default `0.25`. `0` disables.
|
|
46
|
-
*/
|
|
47
|
-
breathSeconds?: number;
|
|
48
|
-
/**
|
|
49
|
-
* Number of discrete `set_tempo` steps used to approximate a rit./accel.
|
|
50
|
-
* tempo ramp between two tempo anchors. Higher = smoother. Default `12`.
|
|
51
|
-
*/
|
|
52
|
-
tempoRampSteps?: number;
|
|
53
|
-
}
|
|
54
|
-
/** Options controlling the rendered timeline. */
|
|
55
|
-
interface TimingMapOptions extends ExpressionOptions {
|
|
56
|
-
/**
|
|
57
|
-
* Ticks per quarter note (default: 480). Only affects internal tick rounding;
|
|
58
|
-
* `midiSec`/`quarterPos` are otherwise independent of it.
|
|
59
|
-
*/
|
|
60
|
-
ticksPerQuarterNote?: number;
|
|
61
|
-
/** Default tempo in BPM when the score carries no tempo marking (default: 120). */
|
|
62
|
-
defaultTempo?: number;
|
|
63
|
-
}
|
|
64
|
-
/** A single point on the timeline: a time ↔ musical-position correspondence. */
|
|
65
|
-
interface TimingBreakpoint {
|
|
66
|
-
/** Elapsed playback time, in seconds (equals the MIDI time of `exportMidi`). */
|
|
67
|
-
midiSec: number;
|
|
68
|
-
/**
|
|
69
|
-
* Cumulative quarter notes from the start of (repeat-expanded) playback.
|
|
70
|
-
* This is the monotone axis to interpolate against: within a constant-tempo
|
|
71
|
-
* segment `midiSec` is linear in `quarterPos`.
|
|
72
|
-
*/
|
|
73
|
-
quarterPos: number;
|
|
74
|
-
/** Printed measure number (MusicXML `<measure number>`), e.g. "12". */
|
|
75
|
-
measureNumber: string;
|
|
76
|
-
/** Quarter-note offset within the measure (0 at the measure start). */
|
|
77
|
-
beatInMeasure: number;
|
|
78
|
-
/**
|
|
79
|
-
* Which repeat iteration produced this measure (1-based; 0 = not in a
|
|
80
|
-
* repeat). The same measure appears multiple times when repeated.
|
|
81
|
-
*/
|
|
82
|
-
repeatIteration: number;
|
|
83
|
-
}
|
|
84
|
-
/**
|
|
85
|
-
* Maps the playback timeline to conceptual musical positions.
|
|
86
|
-
*
|
|
87
|
-
* Pair it with an audio aligner that returns `audioSec ↔ midiSec` to follow a
|
|
88
|
-
* recording on the score:
|
|
89
|
-
* `audioSec → (aligner) → midiSec → (this, interpolate quarterPos) → (measure, beat)`.
|
|
90
|
-
*/
|
|
91
|
-
interface TimingSidecar {
|
|
92
|
-
/** Sidecar schema version. */
|
|
93
|
-
version: string;
|
|
94
|
-
/** Total duration of the playback, in seconds. */
|
|
95
|
-
durationSec: number;
|
|
96
|
-
/** Ticks per quarter note used internally. */
|
|
97
|
-
ticksPerQuarterNote: number;
|
|
98
|
-
/** Breakpoints, sorted ascending and monotone by `midiSec`. */
|
|
99
|
-
breakpoints: TimingBreakpoint[];
|
|
100
|
-
/**
|
|
101
|
-
* Expressive-timing regions (fermatas, caesuras, breaths, rit./accel.). An
|
|
102
|
-
* aligner can relax its time constraints inside these spans, since the human
|
|
103
|
-
* performance is free to depart most from the grid there. Sorted by
|
|
104
|
-
* `fromMidiSec`. Omitted entirely when there are none.
|
|
105
|
-
*/
|
|
106
|
-
expressions?: ExpressionHint[];
|
|
107
|
-
}
|
|
108
|
-
/** The kind of expressive timing a span represents. */
|
|
109
|
-
type ExpressionKind = 'fermata' | 'caesura' | 'breath' | 'rit' | 'accel';
|
|
110
|
-
/** A time region (in MIDI seconds) carrying expressive tempo change. */
|
|
111
|
-
interface ExpressionHint {
|
|
112
|
-
type: ExpressionKind;
|
|
113
|
-
/** Start of the region in MIDI seconds. */
|
|
114
|
-
fromMidiSec: number;
|
|
115
|
-
/** End of the region in MIDI seconds. */
|
|
116
|
-
toMidiSec: number;
|
|
117
|
-
}
|
|
118
|
-
/**
|
|
119
|
-
* Generate the playback timeline (MIDI seconds ↔ conceptual musical position)
|
|
120
|
-
* for a score, with repeats/voltas/jumps expanded.
|
|
121
|
-
*
|
|
122
|
-
* @param score - The score to analyze
|
|
123
|
-
* @param options - Tempo/resolution options (use the same values as any MIDI
|
|
124
|
-
* export the timeline is paired with)
|
|
125
|
-
* @returns The timing sidecar
|
|
126
|
-
*/
|
|
127
|
-
declare function generatePlaybackTimeline(score: Score, options?: TimingMapOptions): TimingSidecar;
|
|
1
|
+
import { S as Score, d as Part, M as Measure, N as NoteEntry, V as VoiceGroup, z as StaffGroup, E as NoteWithPosition, G as Chord, I as NoteIteratorItem, f as MeasureEntry, W as VoiceToStaffMap, w as Clef, _ as StaffRange, $ as PositionQueryOptions, a0 as VerticalSlice, a1 as VoiceLine, Y as EntryWithContext, X as NoteWithContext, a2 as AdjacentNotes, Z as DirectionWithContext, D as DirectionEntry, a3 as DirectionKind, a4 as DynamicWithContext, a5 as TempoWithContext, a6 as PedalWithContext, a7 as WedgeWithContext, a8 as OctaveShiftWithContext, a9 as TiedNoteGroup, aa as SlurSpan, ab as TupletGroup, ac as BeamGroup, ad as NotationType, ae as HarmonyWithContext, H as HarmonyEntry, af as LyricWithContext, ag as AssembledLyrics, ai as RepeatInfo, ah as BarlineWithContext, aj as EndingInfo, ak as KeyChangeInfo, al as TimeChangeInfo, am as ClefChangeInfo, an as StructuralChanges, e as MeasureAttributes, g as Pitch } from '../types-B-RGHY0c.mjs';
|
|
2
|
+
export { c as ExpressionHint, d as ExpressionKind, E as ExpressionOptions, b as TimingBreakpoint, T as TimingMapOptions, a as TimingSidecar, g as generatePlaybackTimeline } from '../playback-timeline-CVRHsikj.mjs';
|
|
128
3
|
|
|
129
4
|
/**
|
|
130
5
|
* Playback Sequence Generator
|
|
@@ -670,4 +545,4 @@ declare function countNotes(score: Score): number;
|
|
|
670
545
|
*/
|
|
671
546
|
declare function scoresEqual(a: Score, b: Score): boolean;
|
|
672
547
|
|
|
673
|
-
export { type
|
|
548
|
+
export { type FindNotesFilter, type NormalizedPositionOptions, type PitchRange, type PlaybackControls, type PlaybackMeasure, type RoundtripMetrics, type VoiceFilter, buildVoiceToStaffMap, buildVoiceToStaffMapForPart, countNotes, extractPlaybackControls, findBarlines, findDirectionsByType, findNotes, findNotesWithNotation, generatePlaybackSequence, 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 };
|
package/dist/query/index.d.ts
CHANGED
|
@@ -1,130 +1,5 @@
|
|
|
1
|
-
import { S as Score, d as Part, M as Measure, N as NoteEntry, V as VoiceGroup, z as StaffGroup, E as NoteWithPosition, G as Chord, I as NoteIteratorItem, f as MeasureEntry, W as VoiceToStaffMap, w as Clef, _ as StaffRange, $ as PositionQueryOptions, a0 as VerticalSlice, a1 as VoiceLine, Y as EntryWithContext, X as NoteWithContext, a2 as AdjacentNotes, Z as DirectionWithContext, D as DirectionEntry, a3 as DirectionKind, a4 as DynamicWithContext, a5 as TempoWithContext, a6 as PedalWithContext, a7 as WedgeWithContext, a8 as OctaveShiftWithContext, a9 as TiedNoteGroup, aa as SlurSpan, ab as TupletGroup, ac as BeamGroup, ad as NotationType, ae as HarmonyWithContext, H as HarmonyEntry, af as LyricWithContext, ag as AssembledLyrics, ai as RepeatInfo, ah as BarlineWithContext, aj as EndingInfo, ak as KeyChangeInfo, al as TimeChangeInfo, am as ClefChangeInfo, an as StructuralChanges, e as MeasureAttributes, g as Pitch } from '../types-
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Playback Timeline
|
|
5
|
-
*
|
|
6
|
-
* Where {@link generatePlaybackSequence} gives the ORDER measures are played
|
|
7
|
-
* (with repeats/voltas/jumps expanded), this gives the same expanded playback
|
|
8
|
-
* WITH absolute times: a mapping between elapsed seconds and conceptual musical
|
|
9
|
-
* position (measure + beat).
|
|
10
|
-
*
|
|
11
|
-
* This is a pure analysis of the score's playback interpretation (tempo +
|
|
12
|
-
* repeat expansion). It is the one thing a downstream audio-to-score aligner
|
|
13
|
-
* integration cannot recompute from the MusicXML alone — everything else about
|
|
14
|
-
* the score (pitches, parts, voices, durations) the consumer already has and
|
|
15
|
-
* can derive from a musical position. The seconds here are tempo-derived and
|
|
16
|
-
* therefore equal to the playback time of the MIDI produced by `exportMidi`,
|
|
17
|
-
* which shares this exact timeline computation.
|
|
18
|
-
*/
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* Expressive-timing options shared by the MIDI exporter and the timeline query.
|
|
22
|
-
*
|
|
23
|
-
* These shape the TEMPO map only — never note durations. The whole module
|
|
24
|
-
* follows "method A": notated tick lengths (and therefore `quarterPos`) are the
|
|
25
|
-
* score's, and every expressive change in elapsed time is carried by tempo
|
|
26
|
-
* (`set_tempo`). This keeps `tick ÷ tpqn` exactly equal to the musical quarter
|
|
27
|
-
* position so the sidecar maps with zero drift.
|
|
28
|
-
*/
|
|
29
|
-
interface ExpressionOptions {
|
|
30
|
-
/**
|
|
31
|
-
* Fermata hold factor: a fermata note/rest's tick span is stretched in
|
|
32
|
-
* elapsed time by this factor by dividing the prevailing BPM over the span
|
|
33
|
-
* (e.g. 2 → the span plays at half BPM, lasting twice as long). The note's
|
|
34
|
-
* tick length and `quarterPos` are unchanged. `1` disables. Default `1.75`.
|
|
35
|
-
*/
|
|
36
|
-
fermataHoldMultiplier?: number;
|
|
37
|
-
/**
|
|
38
|
-
* Seconds of extra time a caesura ("railroad tracks") inserts, modelled as a
|
|
39
|
-
* tempo dip over the tail of the note carrying it (no tick is added).
|
|
40
|
-
* Default `0.4`. `0` disables.
|
|
41
|
-
*/
|
|
42
|
-
caesuraSeconds?: number;
|
|
43
|
-
/**
|
|
44
|
-
* Seconds of extra time a breath mark inserts, modelled like a caesura but
|
|
45
|
-
* shorter. Default `0.25`. `0` disables.
|
|
46
|
-
*/
|
|
47
|
-
breathSeconds?: number;
|
|
48
|
-
/**
|
|
49
|
-
* Number of discrete `set_tempo` steps used to approximate a rit./accel.
|
|
50
|
-
* tempo ramp between two tempo anchors. Higher = smoother. Default `12`.
|
|
51
|
-
*/
|
|
52
|
-
tempoRampSteps?: number;
|
|
53
|
-
}
|
|
54
|
-
/** Options controlling the rendered timeline. */
|
|
55
|
-
interface TimingMapOptions extends ExpressionOptions {
|
|
56
|
-
/**
|
|
57
|
-
* Ticks per quarter note (default: 480). Only affects internal tick rounding;
|
|
58
|
-
* `midiSec`/`quarterPos` are otherwise independent of it.
|
|
59
|
-
*/
|
|
60
|
-
ticksPerQuarterNote?: number;
|
|
61
|
-
/** Default tempo in BPM when the score carries no tempo marking (default: 120). */
|
|
62
|
-
defaultTempo?: number;
|
|
63
|
-
}
|
|
64
|
-
/** A single point on the timeline: a time ↔ musical-position correspondence. */
|
|
65
|
-
interface TimingBreakpoint {
|
|
66
|
-
/** Elapsed playback time, in seconds (equals the MIDI time of `exportMidi`). */
|
|
67
|
-
midiSec: number;
|
|
68
|
-
/**
|
|
69
|
-
* Cumulative quarter notes from the start of (repeat-expanded) playback.
|
|
70
|
-
* This is the monotone axis to interpolate against: within a constant-tempo
|
|
71
|
-
* segment `midiSec` is linear in `quarterPos`.
|
|
72
|
-
*/
|
|
73
|
-
quarterPos: number;
|
|
74
|
-
/** Printed measure number (MusicXML `<measure number>`), e.g. "12". */
|
|
75
|
-
measureNumber: string;
|
|
76
|
-
/** Quarter-note offset within the measure (0 at the measure start). */
|
|
77
|
-
beatInMeasure: number;
|
|
78
|
-
/**
|
|
79
|
-
* Which repeat iteration produced this measure (1-based; 0 = not in a
|
|
80
|
-
* repeat). The same measure appears multiple times when repeated.
|
|
81
|
-
*/
|
|
82
|
-
repeatIteration: number;
|
|
83
|
-
}
|
|
84
|
-
/**
|
|
85
|
-
* Maps the playback timeline to conceptual musical positions.
|
|
86
|
-
*
|
|
87
|
-
* Pair it with an audio aligner that returns `audioSec ↔ midiSec` to follow a
|
|
88
|
-
* recording on the score:
|
|
89
|
-
* `audioSec → (aligner) → midiSec → (this, interpolate quarterPos) → (measure, beat)`.
|
|
90
|
-
*/
|
|
91
|
-
interface TimingSidecar {
|
|
92
|
-
/** Sidecar schema version. */
|
|
93
|
-
version: string;
|
|
94
|
-
/** Total duration of the playback, in seconds. */
|
|
95
|
-
durationSec: number;
|
|
96
|
-
/** Ticks per quarter note used internally. */
|
|
97
|
-
ticksPerQuarterNote: number;
|
|
98
|
-
/** Breakpoints, sorted ascending and monotone by `midiSec`. */
|
|
99
|
-
breakpoints: TimingBreakpoint[];
|
|
100
|
-
/**
|
|
101
|
-
* Expressive-timing regions (fermatas, caesuras, breaths, rit./accel.). An
|
|
102
|
-
* aligner can relax its time constraints inside these spans, since the human
|
|
103
|
-
* performance is free to depart most from the grid there. Sorted by
|
|
104
|
-
* `fromMidiSec`. Omitted entirely when there are none.
|
|
105
|
-
*/
|
|
106
|
-
expressions?: ExpressionHint[];
|
|
107
|
-
}
|
|
108
|
-
/** The kind of expressive timing a span represents. */
|
|
109
|
-
type ExpressionKind = 'fermata' | 'caesura' | 'breath' | 'rit' | 'accel';
|
|
110
|
-
/** A time region (in MIDI seconds) carrying expressive tempo change. */
|
|
111
|
-
interface ExpressionHint {
|
|
112
|
-
type: ExpressionKind;
|
|
113
|
-
/** Start of the region in MIDI seconds. */
|
|
114
|
-
fromMidiSec: number;
|
|
115
|
-
/** End of the region in MIDI seconds. */
|
|
116
|
-
toMidiSec: number;
|
|
117
|
-
}
|
|
118
|
-
/**
|
|
119
|
-
* Generate the playback timeline (MIDI seconds ↔ conceptual musical position)
|
|
120
|
-
* for a score, with repeats/voltas/jumps expanded.
|
|
121
|
-
*
|
|
122
|
-
* @param score - The score to analyze
|
|
123
|
-
* @param options - Tempo/resolution options (use the same values as any MIDI
|
|
124
|
-
* export the timeline is paired with)
|
|
125
|
-
* @returns The timing sidecar
|
|
126
|
-
*/
|
|
127
|
-
declare function generatePlaybackTimeline(score: Score, options?: TimingMapOptions): TimingSidecar;
|
|
1
|
+
import { S as Score, d as Part, M as Measure, N as NoteEntry, V as VoiceGroup, z as StaffGroup, E as NoteWithPosition, G as Chord, I as NoteIteratorItem, f as MeasureEntry, W as VoiceToStaffMap, w as Clef, _ as StaffRange, $ as PositionQueryOptions, a0 as VerticalSlice, a1 as VoiceLine, Y as EntryWithContext, X as NoteWithContext, a2 as AdjacentNotes, Z as DirectionWithContext, D as DirectionEntry, a3 as DirectionKind, a4 as DynamicWithContext, a5 as TempoWithContext, a6 as PedalWithContext, a7 as WedgeWithContext, a8 as OctaveShiftWithContext, a9 as TiedNoteGroup, aa as SlurSpan, ab as TupletGroup, ac as BeamGroup, ad as NotationType, ae as HarmonyWithContext, H as HarmonyEntry, af as LyricWithContext, ag as AssembledLyrics, ai as RepeatInfo, ah as BarlineWithContext, aj as EndingInfo, ak as KeyChangeInfo, al as TimeChangeInfo, am as ClefChangeInfo, an as StructuralChanges, e as MeasureAttributes, g as Pitch } from '../types-B-RGHY0c.js';
|
|
2
|
+
export { c as ExpressionHint, d as ExpressionKind, E as ExpressionOptions, b as TimingBreakpoint, T as TimingMapOptions, a as TimingSidecar, g as generatePlaybackTimeline } from '../playback-timeline-CmWA8YDy.js';
|
|
128
3
|
|
|
129
4
|
/**
|
|
130
5
|
* Playback Sequence Generator
|
|
@@ -670,4 +545,4 @@ declare function countNotes(score: Score): number;
|
|
|
670
545
|
*/
|
|
671
546
|
declare function scoresEqual(a: Score, b: Score): boolean;
|
|
672
547
|
|
|
673
|
-
export { type
|
|
548
|
+
export { type FindNotesFilter, type NormalizedPositionOptions, type PitchRange, type PlaybackControls, type PlaybackMeasure, type RoundtripMetrics, type VoiceFilter, buildVoiceToStaffMap, buildVoiceToStaffMapForPart, countNotes, extractPlaybackControls, findBarlines, findDirectionsByType, findNotes, findNotesWithNotation, generatePlaybackSequence, 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 };
|
package/dist/query/index.js
CHANGED
|
@@ -76,12 +76,13 @@
|
|
|
76
76
|
|
|
77
77
|
|
|
78
78
|
|
|
79
|
+
var _chunkPMPROVJWjs = require('../chunk-PMPROVJW.js');
|
|
79
80
|
|
|
80
81
|
|
|
81
82
|
|
|
82
83
|
|
|
83
|
-
var _chunkEWLB5X64js = require('../chunk-EWLB5X64.js');
|
|
84
84
|
|
|
85
|
+
var _chunk626TXMVPjs = require('../chunk-626TXMVP.js');
|
|
85
86
|
|
|
86
87
|
|
|
87
88
|
|
|
@@ -163,4 +164,5 @@ var _chunkEWLB5X64js = require('../chunk-EWLB5X64.js');
|
|
|
163
164
|
|
|
164
165
|
|
|
165
166
|
|
|
166
|
-
|
|
167
|
+
|
|
168
|
+
exports.buildVoiceToStaffMap = _chunkPMPROVJWjs.buildVoiceToStaffMap; exports.buildVoiceToStaffMapForPart = _chunkPMPROVJWjs.buildVoiceToStaffMapForPart; exports.countNotes = _chunkPMPROVJWjs.countNotes; exports.extractPlaybackControls = _chunk626TXMVPjs.extractPlaybackControls; exports.findBarlines = _chunkPMPROVJWjs.findBarlines; exports.findDirectionsByType = _chunkPMPROVJWjs.findDirectionsByType; exports.findNotes = _chunkPMPROVJWjs.findNotes; exports.findNotesWithNotation = _chunkPMPROVJWjs.findNotesWithNotation; exports.generatePlaybackSequence = _chunk626TXMVPjs.generatePlaybackSequence; exports.generatePlaybackTimeline = _chunk626TXMVPjs.generatePlaybackTimeline; exports.getAbsolutePosition = _chunkPMPROVJWjs.getAbsolutePosition; exports.getAdjacentNotes = _chunkPMPROVJWjs.getAdjacentNotes; exports.getAllNotes = _chunkPMPROVJWjs.getAllNotes; exports.getAttributesAtMeasure = _chunkPMPROVJWjs.getAttributesAtMeasure; exports.getBeamGroups = _chunkPMPROVJWjs.getBeamGroups; exports.getChordProgression = _chunkPMPROVJWjs.getChordProgression; exports.getChords = _chunkPMPROVJWjs.getChords; exports.getClefChanges = _chunkPMPROVJWjs.getClefChanges; exports.getClefForStaff = _chunkPMPROVJWjs.getClefForStaff; exports.getDirections = _chunkPMPROVJWjs.getDirections; exports.getDirectionsAtPosition = _chunkPMPROVJWjs.getDirectionsAtPosition; exports.getDivisions = _chunkPMPROVJWjs.getDivisions; exports.getDuration = _chunkPMPROVJWjs.getDuration; exports.getDynamics = _chunkPMPROVJWjs.getDynamics; exports.getEffectiveStaff = _chunkPMPROVJWjs.getEffectiveStaff; exports.getEndings = _chunkPMPROVJWjs.getEndings; exports.getEntriesAtPosition = _chunkPMPROVJWjs.getEntriesAtPosition; exports.getEntriesForStaff = _chunkPMPROVJWjs.getEntriesForStaff; exports.getEntriesInRange = _chunkPMPROVJWjs.getEntriesInRange; exports.getHarmonies = _chunkPMPROVJWjs.getHarmonies; exports.getHarmonyAtPosition = _chunkPMPROVJWjs.getHarmonyAtPosition; exports.getKeyChanges = _chunkPMPROVJWjs.getKeyChanges; exports.getLyricText = _chunkPMPROVJWjs.getLyricText; exports.getLyrics = _chunkPMPROVJWjs.getLyrics; exports.getMeasure = _chunkPMPROVJWjs.getMeasure; exports.getMeasureByIndex = _chunkPMPROVJWjs.getMeasureByIndex; exports.getMeasureCount = _chunkPMPROVJWjs.getMeasureCount; exports.getNextNote = _chunkPMPROVJWjs.getNextNote; exports.getNormalizedDuration = _chunkPMPROVJWjs.getNormalizedDuration; exports.getNormalizedPosition = _chunkPMPROVJWjs.getNormalizedPosition; exports.getNotesAtPosition = _chunkPMPROVJWjs.getNotesAtPosition; exports.getNotesForStaff = _chunkPMPROVJWjs.getNotesForStaff; exports.getNotesForVoice = _chunkPMPROVJWjs.getNotesForVoice; exports.getNotesInRange = _chunkPMPROVJWjs.getNotesInRange; exports.getOctaveShifts = _chunkPMPROVJWjs.getOctaveShifts; exports.getPartById = _chunkPMPROVJWjs.getPartById; exports.getPartByIndex = _chunkPMPROVJWjs.getPartByIndex; exports.getPartCount = _chunkPMPROVJWjs.getPartCount; exports.getPartIds = _chunkPMPROVJWjs.getPartIds; exports.getPartIndex = _chunkPMPROVJWjs.getPartIndex; exports.getPedalMarkings = _chunkPMPROVJWjs.getPedalMarkings; exports.getPrevNote = _chunkPMPROVJWjs.getPrevNote; exports.getRepeatStructure = _chunkPMPROVJWjs.getRepeatStructure; exports.getSlurSpans = _chunkPMPROVJWjs.getSlurSpans; exports.getStaffRange = _chunkPMPROVJWjs.getStaffRange; exports.getStaveCount = _chunkPMPROVJWjs.getStaveCount; exports.getStaves = _chunkPMPROVJWjs.getStaves; exports.getStructuralChanges = _chunkPMPROVJWjs.getStructuralChanges; exports.getTempoMarkings = _chunkPMPROVJWjs.getTempoMarkings; exports.getTiedNoteGroups = _chunkPMPROVJWjs.getTiedNoteGroups; exports.getTimeChanges = _chunkPMPROVJWjs.getTimeChanges; exports.getTupletGroups = _chunkPMPROVJWjs.getTupletGroups; exports.getVerseCount = _chunkPMPROVJWjs.getVerseCount; exports.getVerticalSlice = _chunkPMPROVJWjs.getVerticalSlice; exports.getVoiceLine = _chunkPMPROVJWjs.getVoiceLine; exports.getVoiceLineInRange = _chunkPMPROVJWjs.getVoiceLineInRange; exports.getVoices = _chunkPMPROVJWjs.getVoices; exports.getVoicesForStaff = _chunkPMPROVJWjs.getVoicesForStaff; exports.getWedges = _chunkPMPROVJWjs.getWedges; exports.groupByStaff = _chunkPMPROVJWjs.groupByStaff; exports.groupByVoice = _chunkPMPROVJWjs.groupByVoice; exports.hasMultipleStaves = _chunkPMPROVJWjs.hasMultipleStaves; exports.hasNotes = _chunkPMPROVJWjs.hasNotes; exports.hasPlaybackControls = _chunk626TXMVPjs.hasPlaybackControls; exports.inferStaff = _chunkPMPROVJWjs.inferStaff; exports.isRestMeasure = _chunkPMPROVJWjs.isRestMeasure; exports.iterateEntries = _chunkPMPROVJWjs.iterateEntries; exports.iterateNotes = _chunkPMPROVJWjs.iterateNotes; exports.measureRoundtrip = _chunkPMPROVJWjs.measureRoundtrip; exports.scoresEqual = _chunkPMPROVJWjs.scoresEqual; exports.withAbsolutePositions = _chunkPMPROVJWjs.withAbsolutePositions;
|