musicxml-io 0.7.0 → 0.7.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 +40 -0
- package/dist/{chunk-CJZK2DGV.js → chunk-CHMV7XWY.js} +428 -66
- package/dist/{chunk-LS5OLRZP.mjs → chunk-IM3FS32Q.mjs} +1 -1
- package/dist/{chunk-YCNKCOR2.js → chunk-S5MWUJU2.js} +23 -23
- package/dist/{chunk-CCSOG7HU.mjs → chunk-VQUFSGB5.mjs} +362 -0
- package/dist/index.d.mts +35 -3
- package/dist/index.d.ts +35 -3
- package/dist/index.js +180 -254
- package/dist/index.mjs +64 -138
- package/dist/operations/index.js +3 -3
- package/dist/operations/index.mjs +2 -2
- package/dist/query/index.d.mts +127 -1
- package/dist/query/index.d.ts +127 -1
- package/dist/query/index.js +4 -2
- package/dist/query/index.mjs +3 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -127,10 +127,13 @@ import {
|
|
|
127
127
|
validateTiesAcrossMeasures,
|
|
128
128
|
validateTuplets,
|
|
129
129
|
validateVoiceStaff
|
|
130
|
-
} from "./chunk-
|
|
130
|
+
} from "./chunk-IM3FS32Q.mjs";
|
|
131
131
|
import {
|
|
132
132
|
STEPS,
|
|
133
133
|
STEP_SEMITONES,
|
|
134
|
+
bpmToUsPerQuarter,
|
|
135
|
+
buildGridTimeline,
|
|
136
|
+
buildTimingSidecar,
|
|
134
137
|
buildVoiceToStaffMap,
|
|
135
138
|
buildVoiceToStaffMapForPart,
|
|
136
139
|
countNotes,
|
|
@@ -140,6 +143,7 @@ import {
|
|
|
140
143
|
findNotes,
|
|
141
144
|
findNotesWithNotation,
|
|
142
145
|
generatePlaybackSequence,
|
|
146
|
+
generatePlaybackTimeline,
|
|
143
147
|
getAbsolutePosition,
|
|
144
148
|
getAdjacentNotes,
|
|
145
149
|
getAllNotes,
|
|
@@ -209,11 +213,12 @@ import {
|
|
|
209
213
|
isRestMeasure,
|
|
210
214
|
iterateEntries,
|
|
211
215
|
iterateNotes,
|
|
216
|
+
measureEndTick,
|
|
212
217
|
measureRoundtrip,
|
|
213
218
|
pitchToSemitone,
|
|
214
219
|
scoresEqual,
|
|
215
220
|
withAbsolutePositions
|
|
216
|
-
} from "./chunk-
|
|
221
|
+
} from "./chunk-VQUFSGB5.mjs";
|
|
217
222
|
|
|
218
223
|
// src/importers/musicxml.ts
|
|
219
224
|
import { parse as txmlParse } from "txml";
|
|
@@ -6489,13 +6494,31 @@ function scheduleGraceNotes(graceNotes, targetTick, baseVelocity, chromaticTrans
|
|
|
6489
6494
|
}
|
|
6490
6495
|
}
|
|
6491
6496
|
function exportMidi(score, options = {}) {
|
|
6497
|
+
const { tracks, ticksPerQuarterNote } = buildMidiTracks(score, options);
|
|
6498
|
+
return buildMidiFile(tracks, ticksPerQuarterNote);
|
|
6499
|
+
}
|
|
6500
|
+
function exportMidiWithTimingMap(score, options = {}) {
|
|
6501
|
+
const { tracks, ticksPerQuarterNote, defaultTempo, grid } = buildMidiTracks(score, options);
|
|
6502
|
+
return {
|
|
6503
|
+
midi: buildMidiFile(tracks, ticksPerQuarterNote),
|
|
6504
|
+
sidecar: buildTimingSidecar(grid, defaultTempo, ticksPerQuarterNote)
|
|
6505
|
+
};
|
|
6506
|
+
}
|
|
6507
|
+
function buildMidiTracks(score, options) {
|
|
6492
6508
|
const ticksPerQuarterNote = options.ticksPerQuarterNote ?? 480;
|
|
6493
6509
|
const defaultTempo = options.defaultTempo ?? 120;
|
|
6494
6510
|
const defaultVelocity = options.defaultVelocity ?? 80;
|
|
6495
6511
|
const tracks = [];
|
|
6496
|
-
const
|
|
6497
|
-
const
|
|
6498
|
-
|
|
6512
|
+
const sequence = generatePlaybackSequence(score);
|
|
6513
|
+
const measureOrder = sequence.map((m) => m.measureIndex);
|
|
6514
|
+
const grid = buildGridTimeline(score, ticksPerQuarterNote, sequence, {
|
|
6515
|
+
defaultTempo,
|
|
6516
|
+
fermataHoldMultiplier: options.fermataHoldMultiplier,
|
|
6517
|
+
caesuraSeconds: options.caesuraSeconds,
|
|
6518
|
+
breathSeconds: options.breathSeconds,
|
|
6519
|
+
tempoRampSteps: options.tempoRampSteps
|
|
6520
|
+
});
|
|
6521
|
+
tracks.push(createConductorTrack(score, defaultTempo, grid));
|
|
6499
6522
|
const scoreParts = score.partList.filter((entry) => entry.type === "score-part");
|
|
6500
6523
|
for (let partIndex = 0; partIndex < score.parts.length; partIndex++) {
|
|
6501
6524
|
const part = score.parts[partIndex];
|
|
@@ -6518,7 +6541,7 @@ function exportMidi(score, options = {}) {
|
|
|
6518
6541
|
);
|
|
6519
6542
|
tracks.push(trackData);
|
|
6520
6543
|
}
|
|
6521
|
-
return
|
|
6544
|
+
return { tracks, ticksPerQuarterNote, defaultTempo, grid };
|
|
6522
6545
|
}
|
|
6523
6546
|
function pitchToMidiNote(pitch, chromaticTranspose = 0) {
|
|
6524
6547
|
const stepValues = {
|
|
@@ -6533,130 +6556,46 @@ function pitchToMidiNote(pitch, chromaticTranspose = 0) {
|
|
|
6533
6556
|
const baseMidi = (pitch.octave + 1) * 12 + stepValues[pitch.step] + (pitch.alter ?? 0);
|
|
6534
6557
|
return baseMidi + chromaticTranspose;
|
|
6535
6558
|
}
|
|
6536
|
-
function
|
|
6537
|
-
|
|
6538
|
-
|
|
6539
|
-
|
|
6540
|
-
|
|
6541
|
-
if (!entry.chord && !entry.grace) {
|
|
6542
|
-
position += entry.duration;
|
|
6543
|
-
if (position > max) max = position;
|
|
6544
|
-
}
|
|
6545
|
-
} else if (entry.type === "backup") {
|
|
6546
|
-
position -= entry.duration;
|
|
6547
|
-
} else if (entry.type === "forward") {
|
|
6548
|
-
position += entry.duration;
|
|
6549
|
-
if (position > max) max = position;
|
|
6550
|
-
}
|
|
6551
|
-
}
|
|
6552
|
-
return max;
|
|
6553
|
-
}
|
|
6554
|
-
function measureEndTick(measure, part, divisions, measureStartTick, maxPosition, ticksPerQuarterNote) {
|
|
6555
|
-
const actualTicks = Math.round(maxPosition * ticksPerQuarterNote / divisions);
|
|
6556
|
-
if (measure.implicit) {
|
|
6557
|
-
return measureStartTick + actualTicks;
|
|
6558
|
-
}
|
|
6559
|
-
const timeAttrs = findTimeSignature(part, measure.number);
|
|
6560
|
-
if (timeAttrs) {
|
|
6561
|
-
const measureDuration = timeAttrs.beats / timeAttrs.beatType * 4 * divisions;
|
|
6562
|
-
const calculatedTicks = Math.round(measureDuration * ticksPerQuarterNote / divisions);
|
|
6563
|
-
const ticksToAdd = Math.min(calculatedTicks, actualTicks > 0 ? actualTicks : calculatedTicks);
|
|
6564
|
-
return measureStartTick + ticksToAdd;
|
|
6565
|
-
}
|
|
6566
|
-
return measureStartTick + actualTicks;
|
|
6567
|
-
}
|
|
6568
|
-
function metronomeBpm(perMinute) {
|
|
6569
|
-
if (perMinute === void 0) return null;
|
|
6570
|
-
const bpm = typeof perMinute === "number" ? perMinute : parseFloat(perMinute);
|
|
6571
|
-
return isNaN(bpm) ? null : bpm;
|
|
6572
|
-
}
|
|
6573
|
-
function createConductorTrack(score, defaultTempo, ticksPerQuarterNote, measureOrder) {
|
|
6574
|
-
const events = [];
|
|
6575
|
-
const tempoEvents = [];
|
|
6576
|
-
if (score.parts.length > 0) {
|
|
6577
|
-
const part = score.parts[0];
|
|
6578
|
-
let divisions = 1;
|
|
6579
|
-
let currentTick = 0;
|
|
6580
|
-
for (const measureIndex of measureOrder) {
|
|
6581
|
-
const measure = part.measures[measureIndex];
|
|
6582
|
-
if (!measure) continue;
|
|
6583
|
-
if (measure.attributes?.divisions) {
|
|
6584
|
-
divisions = measure.attributes.divisions;
|
|
6585
|
-
}
|
|
6586
|
-
const measureStartTick = currentTick;
|
|
6587
|
-
let position = 0;
|
|
6588
|
-
const tickAt = (pos) => measureStartTick + Math.round(pos * ticksPerQuarterNote / divisions);
|
|
6589
|
-
for (const entry of measure.entries) {
|
|
6590
|
-
if (entry.type === "direction") {
|
|
6591
|
-
for (const dirType of entry.directionTypes) {
|
|
6592
|
-
if (dirType.kind === "metronome") {
|
|
6593
|
-
const bpm = metronomeBpm(dirType.perMinute);
|
|
6594
|
-
if (bpm !== null) tempoEvents.push({ tick: tickAt(position), bpm });
|
|
6595
|
-
}
|
|
6596
|
-
}
|
|
6597
|
-
if (entry.sound?.tempo) {
|
|
6598
|
-
tempoEvents.push({ tick: tickAt(position), bpm: entry.sound.tempo });
|
|
6599
|
-
}
|
|
6600
|
-
} else if (entry.type === "sound") {
|
|
6601
|
-
if (entry.tempo) tempoEvents.push({ tick: tickAt(position), bpm: entry.tempo });
|
|
6602
|
-
} else if (entry.type === "note" && !entry.chord) {
|
|
6603
|
-
position += entry.duration;
|
|
6604
|
-
} else if (entry.type === "backup") {
|
|
6605
|
-
position -= entry.duration;
|
|
6606
|
-
} else if (entry.type === "forward") {
|
|
6607
|
-
position += entry.duration;
|
|
6608
|
-
}
|
|
6609
|
-
}
|
|
6610
|
-
currentTick = measureEndTick(
|
|
6611
|
-
measure,
|
|
6612
|
-
part,
|
|
6613
|
-
divisions,
|
|
6614
|
-
measureStartTick,
|
|
6615
|
-
measureMaxPosition(measure),
|
|
6616
|
-
ticksPerQuarterNote
|
|
6617
|
-
);
|
|
6618
|
-
}
|
|
6619
|
-
}
|
|
6620
|
-
tempoEvents.sort((a, b) => a.tick - b.tick);
|
|
6621
|
-
const startBpm = tempoEvents.length > 0 && tempoEvents[0].tick === 0 ? tempoEvents[0].bpm : defaultTempo;
|
|
6622
|
-
const pushTempo = (deltaTick, bpm) => {
|
|
6623
|
-
const usPerQuarter = Math.round(6e7 / bpm);
|
|
6624
|
-
events.push(
|
|
6625
|
-
...writeVariableLength(deltaTick),
|
|
6626
|
-
255,
|
|
6627
|
-
81,
|
|
6628
|
-
3,
|
|
6629
|
-
usPerQuarter >> 16 & 255,
|
|
6630
|
-
usPerQuarter >> 8 & 255,
|
|
6631
|
-
usPerQuarter & 255
|
|
6632
|
-
);
|
|
6559
|
+
function createConductorTrack(score, defaultTempo, grid) {
|
|
6560
|
+
const metaEvents = [];
|
|
6561
|
+
const tempoBytes = (bpm) => {
|
|
6562
|
+
const us = bpmToUsPerQuarter(bpm);
|
|
6563
|
+
return [255, 81, 3, us >> 16 & 255, us >> 8 & 255, us & 255];
|
|
6633
6564
|
};
|
|
6634
|
-
|
|
6635
|
-
|
|
6636
|
-
|
|
6637
|
-
|
|
6565
|
+
const tempoEvents = [...grid.tempoEvents].sort((a, b) => a.tick - b.tick);
|
|
6566
|
+
const startBpm = tempoEvents.length > 0 && tempoEvents[0].tick === 0 ? tempoEvents[0].bpm : defaultTempo;
|
|
6567
|
+
metaEvents.push({ tick: 0, order: 0, bytes: tempoBytes(startBpm) });
|
|
6568
|
+
let lastBpm = startBpm;
|
|
6569
|
+
for (const ev of tempoEvents) {
|
|
6570
|
+
if (ev.tick === 0) continue;
|
|
6571
|
+
if (ev.bpm === lastBpm) continue;
|
|
6572
|
+
metaEvents.push({ tick: ev.tick, order: 0, bytes: tempoBytes(ev.bpm) });
|
|
6573
|
+
lastBpm = ev.bpm;
|
|
6574
|
+
}
|
|
6575
|
+
const part = score.parts.length > 0 ? score.parts[0] : void 0;
|
|
6576
|
+
if (part) {
|
|
6577
|
+
let lastSig = null;
|
|
6578
|
+
for (const m of grid.measures) {
|
|
6579
|
+
const time = part.measures[m.measureIndex]?.attributes?.time;
|
|
6580
|
+
if (!time) continue;
|
|
6638
6581
|
const numerator = parseInt(time.beats, 10) || 4;
|
|
6639
6582
|
const denominator = Math.log2(time.beatType);
|
|
6640
|
-
|
|
6641
|
-
|
|
6642
|
-
|
|
6643
|
-
|
|
6644
|
-
|
|
6645
|
-
|
|
6646
|
-
denominator,
|
|
6647
|
-
|
|
6648
|
-
8
|
|
6649
|
-
);
|
|
6583
|
+
const sig = `${numerator}/${denominator}`;
|
|
6584
|
+
if (sig === lastSig) continue;
|
|
6585
|
+
lastSig = sig;
|
|
6586
|
+
metaEvents.push({
|
|
6587
|
+
tick: m.startTick,
|
|
6588
|
+
order: 1,
|
|
6589
|
+
bytes: [255, 88, 4, numerator, denominator, 24, 8]
|
|
6590
|
+
});
|
|
6650
6591
|
}
|
|
6651
6592
|
}
|
|
6593
|
+
metaEvents.sort((a, b) => a.tick - b.tick || a.order - b.order);
|
|
6594
|
+
const events = [];
|
|
6652
6595
|
let lastTick = 0;
|
|
6653
|
-
|
|
6654
|
-
|
|
6655
|
-
if (ev.tick === 0) continue;
|
|
6656
|
-
if (ev.bpm === lastBpm) continue;
|
|
6657
|
-
pushTempo(ev.tick - lastTick, ev.bpm);
|
|
6596
|
+
for (const ev of metaEvents) {
|
|
6597
|
+
events.push(...writeVariableLength(ev.tick - lastTick), ...ev.bytes);
|
|
6658
6598
|
lastTick = ev.tick;
|
|
6659
|
-
lastBpm = ev.bpm;
|
|
6660
6599
|
}
|
|
6661
6600
|
events.push(...writeVariableLength(0), 255, 47, 0);
|
|
6662
6601
|
return new Uint8Array(events);
|
|
@@ -6807,21 +6746,6 @@ function createPartTrack(part, _score, channel, program, ticksPerQuarterNote, de
|
|
|
6807
6746
|
events.push(...writeVariableLength(0), 255, 47, 0);
|
|
6808
6747
|
return new Uint8Array(events);
|
|
6809
6748
|
}
|
|
6810
|
-
function findTimeSignature(part, measureNumber) {
|
|
6811
|
-
const targetMeasure = parseInt(String(measureNumber), 10);
|
|
6812
|
-
let time;
|
|
6813
|
-
for (const measure of part.measures) {
|
|
6814
|
-
const mNum = parseInt(measure.number, 10);
|
|
6815
|
-
if (!isNaN(targetMeasure) && !isNaN(mNum) && mNum > targetMeasure) break;
|
|
6816
|
-
if (measure.attributes?.time) {
|
|
6817
|
-
time = {
|
|
6818
|
-
beats: parseInt(measure.attributes.time.beats, 10) || 4,
|
|
6819
|
-
beatType: measure.attributes.time.beatType
|
|
6820
|
-
};
|
|
6821
|
-
}
|
|
6822
|
-
}
|
|
6823
|
-
return time;
|
|
6824
|
-
}
|
|
6825
6749
|
function writeVariableLength(value) {
|
|
6826
6750
|
if (value < 0) value = 0;
|
|
6827
6751
|
const bytes = [];
|
|
@@ -8100,6 +8024,7 @@ export {
|
|
|
8100
8024
|
deleteNoteChecked,
|
|
8101
8025
|
duplicatePart,
|
|
8102
8026
|
exportMidi,
|
|
8027
|
+
exportMidiWithTimingMap,
|
|
8103
8028
|
extractPlaybackControls,
|
|
8104
8029
|
findBarlines,
|
|
8105
8030
|
findDirectionsByType,
|
|
@@ -8108,6 +8033,7 @@ export {
|
|
|
8108
8033
|
formatLocation,
|
|
8109
8034
|
generateId,
|
|
8110
8035
|
generatePlaybackSequence,
|
|
8036
|
+
generatePlaybackTimeline,
|
|
8111
8037
|
getAbsolutePosition,
|
|
8112
8038
|
getAdjacentNotes,
|
|
8113
8039
|
getAllNotes,
|
package/dist/operations/index.js
CHANGED
|
@@ -105,8 +105,8 @@
|
|
|
105
105
|
|
|
106
106
|
|
|
107
107
|
|
|
108
|
-
var
|
|
109
|
-
require('../chunk-
|
|
108
|
+
var _chunkS5MWUJU2js = require('../chunk-S5MWUJU2.js');
|
|
109
|
+
require('../chunk-CHMV7XWY.js');
|
|
110
110
|
|
|
111
111
|
|
|
112
112
|
|
|
@@ -214,4 +214,4 @@ require('../chunk-CJZK2DGV.js');
|
|
|
214
214
|
|
|
215
215
|
|
|
216
216
|
|
|
217
|
-
exports.addArticulation =
|
|
217
|
+
exports.addArticulation = _chunkS5MWUJU2js.addArticulation; exports.addBeam = _chunkS5MWUJU2js.addBeam; exports.addBowing = _chunkS5MWUJU2js.addBowing; exports.addBreathMark = _chunkS5MWUJU2js.addBreathMark; exports.addCaesura = _chunkS5MWUJU2js.addCaesura; exports.addChord = _chunkS5MWUJU2js.addChord; exports.addChordNote = _chunkS5MWUJU2js.addChordNote; exports.addChordNoteChecked = _chunkS5MWUJU2js.addChordNoteChecked; exports.addChordSymbol = _chunkS5MWUJU2js.addChordSymbol; exports.addCoda = _chunkS5MWUJU2js.addCoda; exports.addDaCapo = _chunkS5MWUJU2js.addDaCapo; exports.addDalSegno = _chunkS5MWUJU2js.addDalSegno; exports.addDynamics = _chunkS5MWUJU2js.addDynamics; exports.addEnding = _chunkS5MWUJU2js.addEnding; exports.addFermata = _chunkS5MWUJU2js.addFermata; exports.addFine = _chunkS5MWUJU2js.addFine; exports.addFingering = _chunkS5MWUJU2js.addFingering; exports.addGraceNote = _chunkS5MWUJU2js.addGraceNote; exports.addHarmony = _chunkS5MWUJU2js.addHarmony; exports.addLyric = _chunkS5MWUJU2js.addLyric; exports.addNote = _chunkS5MWUJU2js.addNote; exports.addNoteChecked = _chunkS5MWUJU2js.addNoteChecked; exports.addOctaveShift = _chunkS5MWUJU2js.addOctaveShift; exports.addOrnament = _chunkS5MWUJU2js.addOrnament; exports.addPart = _chunkS5MWUJU2js.addPart; exports.addPedal = _chunkS5MWUJU2js.addPedal; exports.addRehearsalMark = _chunkS5MWUJU2js.addRehearsalMark; exports.addRepeat = _chunkS5MWUJU2js.addRepeat; exports.addRepeatBarline = _chunkS5MWUJU2js.addRepeatBarline; exports.addSegno = _chunkS5MWUJU2js.addSegno; exports.addSlur = _chunkS5MWUJU2js.addSlur; exports.addStringNumber = _chunkS5MWUJU2js.addStringNumber; exports.addTempo = _chunkS5MWUJU2js.addTempo; exports.addText = _chunkS5MWUJU2js.addText; exports.addTextDirection = _chunkS5MWUJU2js.addTextDirection; exports.addTie = _chunkS5MWUJU2js.addTie; exports.addToCoda = _chunkS5MWUJU2js.addToCoda; exports.addVoice = _chunkS5MWUJU2js.addVoice; exports.addWedge = _chunkS5MWUJU2js.addWedge; exports.autoBeam = _chunkS5MWUJU2js.autoBeam; exports.changeBarline = _chunkS5MWUJU2js.changeBarline; exports.changeClef = _chunkS5MWUJU2js.changeClef; exports.changeKey = _chunkS5MWUJU2js.changeKey; exports.changeNoteDuration = _chunkS5MWUJU2js.changeNoteDuration; exports.changeTime = _chunkS5MWUJU2js.changeTime; exports.convertToGrace = _chunkS5MWUJU2js.convertToGrace; exports.copyNotes = _chunkS5MWUJU2js.copyNotes; exports.copyNotesMultiMeasure = _chunkS5MWUJU2js.copyNotesMultiMeasure; exports.createTuplet = _chunkS5MWUJU2js.createTuplet; exports.cutNotes = _chunkS5MWUJU2js.cutNotes; exports.deleteMeasure = _chunkS5MWUJU2js.deleteMeasure; exports.deleteNote = _chunkS5MWUJU2js.deleteNote; exports.deleteNoteChecked = _chunkS5MWUJU2js.deleteNoteChecked; exports.duplicatePart = _chunkS5MWUJU2js.duplicatePart; exports.insertClefChange = _chunkS5MWUJU2js.insertClefChange; exports.insertMeasure = _chunkS5MWUJU2js.insertMeasure; exports.insertNote = _chunkS5MWUJU2js.insertNote; exports.lowerAccidental = _chunkS5MWUJU2js.lowerAccidental; exports.modifyDynamics = _chunkS5MWUJU2js.modifyDynamics; exports.modifyNoteDuration = _chunkS5MWUJU2js.modifyNoteDuration; exports.modifyNoteDurationChecked = _chunkS5MWUJU2js.modifyNoteDurationChecked; exports.modifyNotePitch = _chunkS5MWUJU2js.modifyNotePitch; exports.modifyNotePitchChecked = _chunkS5MWUJU2js.modifyNotePitchChecked; exports.modifyTempo = _chunkS5MWUJU2js.modifyTempo; exports.moveNoteToStaff = _chunkS5MWUJU2js.moveNoteToStaff; exports.pasteNotes = _chunkS5MWUJU2js.pasteNotes; exports.pasteNotesMultiMeasure = _chunkS5MWUJU2js.pasteNotesMultiMeasure; exports.raiseAccidental = _chunkS5MWUJU2js.raiseAccidental; exports.removeArticulation = _chunkS5MWUJU2js.removeArticulation; exports.removeBeam = _chunkS5MWUJU2js.removeBeam; exports.removeBowing = _chunkS5MWUJU2js.removeBowing; exports.removeBreathMark = _chunkS5MWUJU2js.removeBreathMark; exports.removeCaesura = _chunkS5MWUJU2js.removeCaesura; exports.removeChordSymbol = _chunkS5MWUJU2js.removeChordSymbol; exports.removeDynamics = _chunkS5MWUJU2js.removeDynamics; exports.removeEnding = _chunkS5MWUJU2js.removeEnding; exports.removeFermata = _chunkS5MWUJU2js.removeFermata; exports.removeFingering = _chunkS5MWUJU2js.removeFingering; exports.removeGraceNote = _chunkS5MWUJU2js.removeGraceNote; exports.removeHarmony = _chunkS5MWUJU2js.removeHarmony; exports.removeLyric = _chunkS5MWUJU2js.removeLyric; exports.removeNote = _chunkS5MWUJU2js.removeNote; exports.removeOctaveShift = _chunkS5MWUJU2js.removeOctaveShift; exports.removeOrnament = _chunkS5MWUJU2js.removeOrnament; exports.removePart = _chunkS5MWUJU2js.removePart; exports.removePedal = _chunkS5MWUJU2js.removePedal; exports.removeRepeat = _chunkS5MWUJU2js.removeRepeat; exports.removeRepeatBarline = _chunkS5MWUJU2js.removeRepeatBarline; exports.removeSlur = _chunkS5MWUJU2js.removeSlur; exports.removeStringNumber = _chunkS5MWUJU2js.removeStringNumber; exports.removeTempo = _chunkS5MWUJU2js.removeTempo; exports.removeTie = _chunkS5MWUJU2js.removeTie; exports.removeTuplet = _chunkS5MWUJU2js.removeTuplet; exports.removeWedge = _chunkS5MWUJU2js.removeWedge; exports.setBarline = _chunkS5MWUJU2js.setBarline; exports.setBeaming = _chunkS5MWUJU2js.setBeaming; exports.setNotePitch = _chunkS5MWUJU2js.setNotePitch; exports.setNotePitchBySemitone = _chunkS5MWUJU2js.setNotePitchBySemitone; exports.setStaves = _chunkS5MWUJU2js.setStaves; exports.shiftNotePitch = _chunkS5MWUJU2js.shiftNotePitch; exports.stopOctaveShift = _chunkS5MWUJU2js.stopOctaveShift; exports.transpose = _chunkS5MWUJU2js.transpose; exports.transposeChecked = _chunkS5MWUJU2js.transposeChecked; exports.updateChordSymbol = _chunkS5MWUJU2js.updateChordSymbol; exports.updateHarmony = _chunkS5MWUJU2js.updateHarmony; exports.updateLyric = _chunkS5MWUJU2js.updateLyric;
|
|
@@ -105,8 +105,8 @@ import {
|
|
|
105
105
|
updateChordSymbol,
|
|
106
106
|
updateHarmony,
|
|
107
107
|
updateLyric
|
|
108
|
-
} from "../chunk-
|
|
109
|
-
import "../chunk-
|
|
108
|
+
} from "../chunk-IM3FS32Q.mjs";
|
|
109
|
+
import "../chunk-VQUFSGB5.mjs";
|
|
110
110
|
export {
|
|
111
111
|
addArticulation,
|
|
112
112
|
addBeam,
|
package/dist/query/index.d.mts
CHANGED
|
@@ -1,5 +1,131 @@
|
|
|
1
1
|
import { S as Score, f as Part, M as Measure, N as NoteEntry, V as VoiceGroup, q as StaffGroup, r as NoteWithPosition, s as Chord, t as NoteIteratorItem, h as MeasureEntry, x as VoiceToStaffMap, 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-CkeI8vw6.mjs';
|
|
2
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
|
+
|
|
3
129
|
/**
|
|
4
130
|
* Playback Sequence Generator
|
|
5
131
|
*
|
|
@@ -544,4 +670,4 @@ declare function countNotes(score: Score): number;
|
|
|
544
670
|
*/
|
|
545
671
|
declare function scoresEqual(a: Score, b: Score): boolean;
|
|
546
672
|
|
|
547
|
-
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 };
|
|
673
|
+
export { type ExpressionHint, type ExpressionKind, type ExpressionOptions, type FindNotesFilter, type NormalizedPositionOptions, type PitchRange, type PlaybackControls, type PlaybackMeasure, type RoundtripMetrics, type TimingBreakpoint, type TimingMapOptions, type TimingSidecar, type 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 };
|
package/dist/query/index.d.ts
CHANGED
|
@@ -1,5 +1,131 @@
|
|
|
1
1
|
import { S as Score, f as Part, M as Measure, N as NoteEntry, V as VoiceGroup, q as StaffGroup, r as NoteWithPosition, s as Chord, t as NoteIteratorItem, h as MeasureEntry, x as VoiceToStaffMap, 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-CkeI8vw6.js';
|
|
2
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
|
+
|
|
3
129
|
/**
|
|
4
130
|
* Playback Sequence Generator
|
|
5
131
|
*
|
|
@@ -544,4 +670,4 @@ declare function countNotes(score: Score): number;
|
|
|
544
670
|
*/
|
|
545
671
|
declare function scoresEqual(a: Score, b: Score): boolean;
|
|
546
672
|
|
|
547
|
-
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 };
|
|
673
|
+
export { type ExpressionHint, type ExpressionKind, type ExpressionOptions, type FindNotesFilter, type NormalizedPositionOptions, type PitchRange, type PlaybackControls, type PlaybackMeasure, type RoundtripMetrics, type TimingBreakpoint, type TimingMapOptions, type TimingSidecar, type 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 };
|
package/dist/query/index.js
CHANGED
|
@@ -79,8 +79,8 @@
|
|
|
79
79
|
|
|
80
80
|
|
|
81
81
|
|
|
82
|
-
var _chunkCJZK2DGVjs = require('../chunk-CJZK2DGV.js');
|
|
83
82
|
|
|
83
|
+
var _chunkCHMV7XWYjs = require('../chunk-CHMV7XWY.js');
|
|
84
84
|
|
|
85
85
|
|
|
86
86
|
|
|
@@ -161,4 +161,6 @@ var _chunkCJZK2DGVjs = require('../chunk-CJZK2DGV.js');
|
|
|
161
161
|
|
|
162
162
|
|
|
163
163
|
|
|
164
|
-
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
exports.buildVoiceToStaffMap = _chunkCHMV7XWYjs.buildVoiceToStaffMap; exports.buildVoiceToStaffMapForPart = _chunkCHMV7XWYjs.buildVoiceToStaffMapForPart; exports.countNotes = _chunkCHMV7XWYjs.countNotes; exports.extractPlaybackControls = _chunkCHMV7XWYjs.extractPlaybackControls; exports.findBarlines = _chunkCHMV7XWYjs.findBarlines; exports.findDirectionsByType = _chunkCHMV7XWYjs.findDirectionsByType; exports.findNotes = _chunkCHMV7XWYjs.findNotes; exports.findNotesWithNotation = _chunkCHMV7XWYjs.findNotesWithNotation; exports.generatePlaybackSequence = _chunkCHMV7XWYjs.generatePlaybackSequence; exports.generatePlaybackTimeline = _chunkCHMV7XWYjs.generatePlaybackTimeline; exports.getAbsolutePosition = _chunkCHMV7XWYjs.getAbsolutePosition; exports.getAdjacentNotes = _chunkCHMV7XWYjs.getAdjacentNotes; exports.getAllNotes = _chunkCHMV7XWYjs.getAllNotes; exports.getAttributesAtMeasure = _chunkCHMV7XWYjs.getAttributesAtMeasure; exports.getBeamGroups = _chunkCHMV7XWYjs.getBeamGroups; exports.getChordProgression = _chunkCHMV7XWYjs.getChordProgression; exports.getChords = _chunkCHMV7XWYjs.getChords; exports.getClefChanges = _chunkCHMV7XWYjs.getClefChanges; exports.getClefForStaff = _chunkCHMV7XWYjs.getClefForStaff; exports.getDirections = _chunkCHMV7XWYjs.getDirections; exports.getDirectionsAtPosition = _chunkCHMV7XWYjs.getDirectionsAtPosition; exports.getDivisions = _chunkCHMV7XWYjs.getDivisions; exports.getDuration = _chunkCHMV7XWYjs.getDuration; exports.getDynamics = _chunkCHMV7XWYjs.getDynamics; exports.getEffectiveStaff = _chunkCHMV7XWYjs.getEffectiveStaff; exports.getEndings = _chunkCHMV7XWYjs.getEndings; exports.getEntriesAtPosition = _chunkCHMV7XWYjs.getEntriesAtPosition; exports.getEntriesForStaff = _chunkCHMV7XWYjs.getEntriesForStaff; exports.getEntriesInRange = _chunkCHMV7XWYjs.getEntriesInRange; exports.getHarmonies = _chunkCHMV7XWYjs.getHarmonies; exports.getHarmonyAtPosition = _chunkCHMV7XWYjs.getHarmonyAtPosition; exports.getKeyChanges = _chunkCHMV7XWYjs.getKeyChanges; exports.getLyricText = _chunkCHMV7XWYjs.getLyricText; exports.getLyrics = _chunkCHMV7XWYjs.getLyrics; exports.getMeasure = _chunkCHMV7XWYjs.getMeasure; exports.getMeasureByIndex = _chunkCHMV7XWYjs.getMeasureByIndex; exports.getMeasureCount = _chunkCHMV7XWYjs.getMeasureCount; exports.getNextNote = _chunkCHMV7XWYjs.getNextNote; exports.getNormalizedDuration = _chunkCHMV7XWYjs.getNormalizedDuration; exports.getNormalizedPosition = _chunkCHMV7XWYjs.getNormalizedPosition; exports.getNotesAtPosition = _chunkCHMV7XWYjs.getNotesAtPosition; exports.getNotesForStaff = _chunkCHMV7XWYjs.getNotesForStaff; exports.getNotesForVoice = _chunkCHMV7XWYjs.getNotesForVoice; exports.getNotesInRange = _chunkCHMV7XWYjs.getNotesInRange; exports.getOctaveShifts = _chunkCHMV7XWYjs.getOctaveShifts; exports.getPartById = _chunkCHMV7XWYjs.getPartById; exports.getPartByIndex = _chunkCHMV7XWYjs.getPartByIndex; exports.getPartCount = _chunkCHMV7XWYjs.getPartCount; exports.getPartIds = _chunkCHMV7XWYjs.getPartIds; exports.getPartIndex = _chunkCHMV7XWYjs.getPartIndex; exports.getPedalMarkings = _chunkCHMV7XWYjs.getPedalMarkings; exports.getPrevNote = _chunkCHMV7XWYjs.getPrevNote; exports.getRepeatStructure = _chunkCHMV7XWYjs.getRepeatStructure; exports.getSlurSpans = _chunkCHMV7XWYjs.getSlurSpans; exports.getStaffRange = _chunkCHMV7XWYjs.getStaffRange; exports.getStaveCount = _chunkCHMV7XWYjs.getStaveCount; exports.getStaves = _chunkCHMV7XWYjs.getStaves; exports.getStructuralChanges = _chunkCHMV7XWYjs.getStructuralChanges; exports.getTempoMarkings = _chunkCHMV7XWYjs.getTempoMarkings; exports.getTiedNoteGroups = _chunkCHMV7XWYjs.getTiedNoteGroups; exports.getTimeChanges = _chunkCHMV7XWYjs.getTimeChanges; exports.getTupletGroups = _chunkCHMV7XWYjs.getTupletGroups; exports.getVerseCount = _chunkCHMV7XWYjs.getVerseCount; exports.getVerticalSlice = _chunkCHMV7XWYjs.getVerticalSlice; exports.getVoiceLine = _chunkCHMV7XWYjs.getVoiceLine; exports.getVoiceLineInRange = _chunkCHMV7XWYjs.getVoiceLineInRange; exports.getVoices = _chunkCHMV7XWYjs.getVoices; exports.getVoicesForStaff = _chunkCHMV7XWYjs.getVoicesForStaff; exports.getWedges = _chunkCHMV7XWYjs.getWedges; exports.groupByStaff = _chunkCHMV7XWYjs.groupByStaff; exports.groupByVoice = _chunkCHMV7XWYjs.groupByVoice; exports.hasMultipleStaves = _chunkCHMV7XWYjs.hasMultipleStaves; exports.hasNotes = _chunkCHMV7XWYjs.hasNotes; exports.hasPlaybackControls = _chunkCHMV7XWYjs.hasPlaybackControls; exports.inferStaff = _chunkCHMV7XWYjs.inferStaff; exports.isRestMeasure = _chunkCHMV7XWYjs.isRestMeasure; exports.iterateEntries = _chunkCHMV7XWYjs.iterateEntries; exports.iterateNotes = _chunkCHMV7XWYjs.iterateNotes; exports.measureRoundtrip = _chunkCHMV7XWYjs.measureRoundtrip; exports.scoresEqual = _chunkCHMV7XWYjs.scoresEqual; exports.withAbsolutePositions = _chunkCHMV7XWYjs.withAbsolutePositions;
|