@sudobility/music_types 0.11.30 → 0.11.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/domain/commands/edit-commands.d.ts +3 -3
- package/dist/domain/commands/edit-commands.d.ts.map +1 -1
- package/dist/domain/commands/edit-commands.js +25 -25
- package/dist/domain/commands/edit-commands.js.map +1 -1
- package/dist/domain/commands/history.d.ts +32 -0
- package/dist/domain/commands/history.d.ts.map +1 -0
- package/dist/domain/commands/history.js +63 -0
- package/dist/domain/commands/history.js.map +1 -0
- package/dist/domain/commands/note-commands.d.ts +9 -12
- package/dist/domain/commands/note-commands.d.ts.map +1 -1
- package/dist/domain/commands/note-commands.js +42 -72
- package/dist/domain/commands/note-commands.js.map +1 -1
- package/dist/domain/commands/note-marks.d.ts +171 -0
- package/dist/domain/commands/note-marks.d.ts.map +1 -0
- package/dist/domain/commands/note-marks.js +427 -0
- package/dist/domain/commands/note-marks.js.map +1 -0
- package/dist/domain/commands/reflow.d.ts +1 -1
- package/dist/domain/commands/reflow.js +17 -17
- package/dist/domain/commands/reflow.js.map +1 -1
- package/dist/domain/commands/region-commands.d.ts +4 -4
- package/dist/domain/commands/region-commands.d.ts.map +1 -1
- package/dist/domain/commands/region-commands.js +7 -7
- package/dist/domain/commands/region-commands.js.map +1 -1
- package/dist/domain/commands/relocate-commands.d.ts +3 -3
- package/dist/domain/commands/relocate-commands.js +15 -15
- package/dist/domain/commands/relocate-commands.js.map +1 -1
- package/dist/domain/commands/ripple-commands.d.ts +2 -2
- package/dist/domain/commands/ripple-commands.js +13 -13
- package/dist/domain/commands/ripple-commands.js.map +1 -1
- package/dist/domain/commands/snapshot.d.ts +3 -3
- package/dist/domain/commands/snapshot.js +5 -5
- package/dist/domain/commands/snapshot.js.map +1 -1
- package/dist/domain/commands/structure-commands.d.ts +86 -5
- package/dist/domain/commands/structure-commands.d.ts.map +1 -1
- package/dist/domain/commands/structure-commands.js +272 -36
- package/dist/domain/commands/structure-commands.js.map +1 -1
- package/dist/domain/commands/track-commands.d.ts +2 -2
- package/dist/domain/commands/track-commands.js +7 -7
- package/dist/domain/commands/track-commands.js.map +1 -1
- package/dist/domain/commands/types.d.ts +2 -2
- package/dist/domain/generation/replacement-region.d.ts +32 -0
- package/dist/domain/generation/replacement-region.d.ts.map +1 -0
- package/dist/domain/generation/replacement-region.js +79 -0
- package/dist/domain/generation/replacement-region.js.map +1 -0
- package/dist/domain/instruments/gm-icon.d.ts +12 -0
- package/dist/domain/instruments/gm-icon.d.ts.map +1 -0
- package/dist/domain/instruments/gm-icon.js +327 -0
- package/dist/domain/instruments/gm-icon.js.map +1 -0
- package/dist/domain/instruments/gm-kit.js +9 -9
- package/dist/domain/instruments/gm-kit.js.map +1 -1
- package/dist/domain/instruments/gm-percussion.js +48 -48
- package/dist/domain/instruments/gm-percussion.js.map +1 -1
- package/dist/domain/instruments/gm-polyphony.js +6 -6
- package/dist/domain/instruments/gm-range.js +6 -6
- package/dist/domain/instruments/gm-transposition.js +1 -1
- package/dist/domain/instruments/gm.d.ts +1 -1
- package/dist/domain/instruments/gm.js +161 -161
- package/dist/domain/instruments/gm.js.map +1 -1
- package/dist/domain/instruments/icon-art.d.ts +75 -0
- package/dist/domain/instruments/icon-art.d.ts.map +1 -0
- package/dist/domain/instruments/icon-art.js +93 -0
- package/dist/domain/instruments/icon-art.js.map +1 -0
- package/dist/domain/instruments/instrument-fit.d.ts +31 -0
- package/dist/domain/instruments/instrument-fit.d.ts.map +1 -0
- package/dist/domain/instruments/instrument-fit.js +117 -0
- package/dist/domain/instruments/instrument-fit.js.map +1 -0
- package/dist/domain/instruments/instrument-options.d.ts +62 -0
- package/dist/domain/instruments/instrument-options.d.ts.map +1 -0
- package/dist/domain/instruments/instrument-options.js +69 -0
- package/dist/domain/instruments/instrument-options.js.map +1 -0
- package/dist/domain/instruments/track-instrument.d.ts +80 -0
- package/dist/domain/instruments/track-instrument.d.ts.map +1 -0
- package/dist/domain/instruments/track-instrument.js +102 -0
- package/dist/domain/instruments/track-instrument.js.map +1 -0
- package/dist/domain/notation/chord-symbol.d.ts +26 -0
- package/dist/domain/notation/chord-symbol.d.ts.map +1 -0
- package/dist/domain/notation/chord-symbol.js +32 -0
- package/dist/domain/notation/chord-symbol.js.map +1 -0
- package/dist/domain/notation/lyric-syllables.d.ts +15 -0
- package/dist/domain/notation/lyric-syllables.d.ts.map +1 -0
- package/dist/domain/notation/lyric-syllables.js +15 -0
- package/dist/domain/notation/lyric-syllables.js.map +1 -0
- package/dist/domain/notation/music-vocabulary.d.ts +59 -0
- package/dist/domain/notation/music-vocabulary.d.ts.map +1 -0
- package/dist/domain/notation/music-vocabulary.js +164 -0
- package/dist/domain/notation/music-vocabulary.js.map +1 -0
- package/dist/domain/pitch/pitch.d.ts +1 -1
- package/dist/domain/pitch/pitch.js +29 -29
- package/dist/domain/pitch/transpose.d.ts +1 -1
- package/dist/domain/pitch/transpose.js +2 -2
- package/dist/domain/quantization/quantize.d.ts +2 -2
- package/dist/domain/quantization/quantize.js +9 -9
- package/dist/domain/quantization/quantize.js.map +1 -1
- package/dist/domain/score/articulation.d.ts +56 -0
- package/dist/domain/score/articulation.d.ts.map +1 -0
- package/dist/domain/score/articulation.js +56 -0
- package/dist/domain/score/articulation.js.map +1 -0
- package/dist/domain/score/bar-numbers.d.ts +38 -0
- package/dist/domain/score/bar-numbers.d.ts.map +1 -0
- package/dist/domain/score/bar-numbers.js +49 -0
- package/dist/domain/score/bar-numbers.js.map +1 -0
- package/dist/domain/score/collapse-rests.d.ts +23 -0
- package/dist/domain/score/collapse-rests.d.ts.map +1 -0
- package/dist/domain/score/collapse-rests.js +78 -0
- package/dist/domain/score/collapse-rests.js.map +1 -0
- package/dist/domain/score/cue-notes.d.ts +24 -0
- package/dist/domain/score/cue-notes.d.ts.map +1 -0
- package/dist/domain/score/cue-notes.js +105 -0
- package/dist/domain/score/cue-notes.js.map +1 -0
- package/dist/domain/score/dynamics.d.ts +62 -0
- package/dist/domain/score/dynamics.d.ts.map +1 -0
- package/dist/domain/score/dynamics.js +142 -0
- package/dist/domain/score/dynamics.js.map +1 -0
- package/dist/domain/score/effective-clef.d.ts +42 -0
- package/dist/domain/score/effective-clef.d.ts.map +1 -0
- package/dist/domain/score/effective-clef.js +39 -0
- package/dist/domain/score/effective-clef.js.map +1 -0
- package/dist/domain/score/extract-part.d.ts +10 -0
- package/dist/domain/score/extract-part.d.ts.map +1 -0
- package/dist/domain/score/extract-part.js +44 -0
- package/dist/domain/score/extract-part.js.map +1 -0
- package/dist/domain/score/factory.d.ts +1 -1
- package/dist/domain/score/factory.js +12 -12
- package/dist/domain/score/factory.js.map +1 -1
- package/dist/domain/score/fermata-tempo.d.ts +40 -0
- package/dist/domain/score/fermata-tempo.d.ts.map +1 -0
- package/dist/domain/score/fermata-tempo.js +95 -0
- package/dist/domain/score/fermata-tempo.js.map +1 -0
- package/dist/domain/score/flatten.d.ts +32 -0
- package/dist/domain/score/flatten.d.ts.map +1 -0
- package/dist/domain/score/flatten.js +132 -0
- package/dist/domain/score/flatten.js.map +1 -0
- package/dist/domain/score/fragment.d.ts +4 -8
- package/dist/domain/score/fragment.d.ts.map +1 -1
- package/dist/domain/score/fragment.js +8 -8
- package/dist/domain/score/fragment.js.map +1 -1
- package/dist/domain/score/ids.d.ts +1 -1
- package/dist/domain/score/ids.js +6 -6
- package/dist/domain/score/ottava.d.ts +41 -0
- package/dist/domain/score/ottava.d.ts.map +1 -0
- package/dist/domain/score/ottava.js +98 -0
- package/dist/domain/score/ottava.js.map +1 -0
- package/dist/domain/score/performance-timeline.d.ts +42 -0
- package/dist/domain/score/performance-timeline.d.ts.map +1 -0
- package/dist/domain/score/performance-timeline.js +78 -0
- package/dist/domain/score/performance-timeline.js.map +1 -0
- package/dist/domain/score/queries.d.ts +2 -2
- package/dist/domain/score/queries.js +7 -7
- package/dist/domain/score/queries.js.map +1 -1
- package/dist/domain/score/rehearsal-marks.d.ts +30 -0
- package/dist/domain/score/rehearsal-marks.d.ts.map +1 -0
- package/dist/domain/score/rehearsal-marks.js +126 -0
- package/dist/domain/score/rehearsal-marks.js.map +1 -0
- package/dist/domain/score/repeat-order.d.ts +21 -0
- package/dist/domain/score/repeat-order.d.ts.map +1 -0
- package/dist/domain/score/repeat-order.js +123 -0
- package/dist/domain/score/repeat-order.js.map +1 -0
- package/dist/domain/score/snapshot-tree.d.ts +23 -0
- package/dist/domain/score/snapshot-tree.d.ts.map +1 -0
- package/dist/domain/score/snapshot-tree.js +45 -0
- package/dist/domain/score/snapshot-tree.js.map +1 -0
- package/dist/domain/score/ties.d.ts +1 -1
- package/dist/domain/score/ties.js +7 -7
- package/dist/domain/score/ties.js.map +1 -1
- package/dist/domain/score/written-pitch.d.ts +33 -0
- package/dist/domain/score/written-pitch.d.ts.map +1 -0
- package/dist/domain/score/written-pitch.js +110 -0
- package/dist/domain/score/written-pitch.js.map +1 -0
- package/dist/domain/selection/range-select.d.ts +13 -0
- package/dist/domain/selection/range-select.d.ts.map +1 -0
- package/dist/domain/selection/range-select.js +40 -0
- package/dist/domain/selection/range-select.js.map +1 -0
- package/dist/domain/selection/selection-editing.d.ts +30 -0
- package/dist/domain/selection/selection-editing.d.ts.map +1 -0
- package/dist/domain/selection/selection-editing.js +31 -0
- package/dist/domain/selection/selection-editing.js.map +1 -0
- package/dist/domain/selection/selection.d.ts +2 -2
- package/dist/domain/selection/selection.js +7 -7
- package/dist/domain/selection/selection.js.map +1 -1
- package/dist/domain/selection/types.d.ts +2 -2
- package/dist/domain/selection/types.d.ts.map +1 -1
- package/dist/domain/time/duration-modifiers.d.ts +40 -0
- package/dist/domain/time/duration-modifiers.d.ts.map +1 -0
- package/dist/domain/time/duration-modifiers.js +50 -0
- package/dist/domain/time/duration-modifiers.js.map +1 -0
- package/dist/domain/time/duration-selection.d.ts +23 -0
- package/dist/domain/time/duration-selection.d.ts.map +1 -0
- package/dist/domain/time/duration-selection.js +50 -0
- package/dist/domain/time/duration-selection.js.map +1 -0
- package/dist/domain/time/durations.js +6 -6
- package/dist/domain/time/durations.js.map +1 -1
- package/dist/domain/time/fraction.d.ts +1 -1
- package/dist/domain/time/fraction.js +1 -1
- package/dist/domain/time/tap-to-note.d.ts +21 -0
- package/dist/domain/time/tap-to-note.d.ts.map +1 -0
- package/dist/domain/time/tap-to-note.js +43 -0
- package/dist/domain/time/tap-to-note.js.map +1 -0
- package/dist/domain/time/tempo-map.d.ts +1 -1
- package/dist/domain/time/ticks.d.ts +1 -1
- package/dist/domain/time/ticks.d.ts.map +1 -1
- package/dist/domain/time/ticks.js +14 -14
- package/dist/domain/time/ticks.js.map +1 -1
- package/dist/domain/time/tuplets.d.ts +42 -0
- package/dist/domain/time/tuplets.d.ts.map +1 -0
- package/dist/domain/time/tuplets.js +53 -0
- package/dist/domain/time/tuplets.js.map +1 -0
- package/dist/domain/validation/issues.d.ts +1 -1
- package/dist/domain/validation/issues.js +20 -20
- package/dist/domain/validation/validator.d.ts +2 -2
- package/dist/domain/validation/validator.d.ts.map +1 -1
- package/dist/domain/validation/validator.js +31 -31
- package/dist/domain/validation/validator.js.map +1 -1
- package/dist/domain/voicing/allocate.d.ts +2 -2
- package/dist/domain/voicing/allocate.js +6 -6
- package/dist/domain/voicing/allocate.js.map +1 -1
- package/dist/index.d.ts +72 -5535
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +79 -462
- package/dist/index.js.map +1 -1
- package/dist/model/api.d.ts +1696 -0
- package/dist/model/api.d.ts.map +1 -0
- package/dist/model/api.js +125 -0
- package/dist/model/api.js.map +1 -0
- package/dist/model/generation.d.ts +2178 -0
- package/dist/model/generation.d.ts.map +1 -0
- package/dist/model/generation.js +142 -0
- package/dist/model/generation.js.map +1 -0
- package/dist/model/schemas.d.ts +1200 -0
- package/dist/model/schemas.d.ts.map +1 -0
- package/dist/model/schemas.js +200 -0
- package/dist/model/schemas.js.map +1 -0
- package/dist/model/score.d.ts +462 -0
- package/dist/model/score.d.ts.map +1 -0
- package/dist/model/score.js +34 -0
- package/dist/model/score.js.map +1 -0
- package/dist/platform/audio.d.ts.map +1 -1
- package/dist/platform/file.d.ts.map +1 -1
- package/dist/platform/index.d.ts +7 -7
- package/dist/platform/index.js +7 -7
- package/dist/platform/midi-input.d.ts +2 -2
- package/dist/platform/midi.d.ts.map +1 -1
- package/dist/platform/mod.d.ts +2 -2
- package/dist/platform/playback.d.ts +7 -7
- package/dist/platform/xml.js +1 -1
- package/dist/services/regeneration/controller.d.ts +6 -6
- package/dist/services/regeneration/controller.js +12 -12
- package/dist/services/regeneration/controller.js.map +1 -1
- package/dist/test/fixtures.d.ts +1 -1
- package/dist/test/fixtures.js +103 -103
- package/dist/test/fixtures.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"quantize.js","sourceRoot":"","sources":["../../../src/domain/quantization/quantize.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAE3C,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAG7C,iHAAiH;AACjH,SAAS,kBAAkB,CAAC,IAAqB;IAC/C,OAAO,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;AAC5D,CAAC;AAED;;;;;;;GAOG;AACH,SAAS,mBAAmB,CAAC,QAAgB,EAAE,IAAqB;IAClE,MAAM,IAAI,GAAG,kBAAkB,CAAC,IAAI,CAAC,CAAC;IACtC,IAAI,IAAI,IAAI,CAAC;QAAE,OAAO,QAAQ,CAAC;IAE/B,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,GAAG,IAAI,CAAC,CAAC;IAC9C,IAAI,MAAM,GAAG,SAAS,GAAG,IAAI,CAAC;IAC9B,IAAI,IAAI,CAAC,KAAK,IAAI,SAAS,GAAG,CAAC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AG,cAAc,CAAC,MAAM,EAAE,IAAI,CAAC,gBAAgB,CAAC,CAAC;IAEhE,MAAM,UAAU,GAAG,SAAS,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CACzC,IAAI,CAAC,cAAc;QACjB,CAAC,CAAC,EAAE,GAAG,KAAK,EAAE,SAAS,EAAE,mBAAmB,CAAC,KAAK,CAAC,SAAS,EAAE,IAAI,CAAC,EAAE;QACrE,CAAC,CAAC,EAAE,GAAG,KAAK,EAAE,CACjB,CAAC;IAEF,MAAM,aAAa,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAC7C,IAAI,CAAC,iBAAiB;QACpB,CAAC,CAAC;YACE,GAAG,KAAK;YACR,aAAa,EAAE,sBAAsB,CAAC,KAAK,CAAC,aAAa,EAAE,IAAI,CAAC;SACjE;QACH,CAAC,CAAC,KAAK,CACV,CAAC;IAEF,OAAO,YAAY,CAAC,aAAa,CAAC;SAC/B,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,iBAAiB,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;SAC9C,IAAI,EAAE,CAAC;AACZ,CAAC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What an articulation does to the sound.
|
|
3
|
+
*
|
|
4
|
+
* A staccato dot, an accent, a tenuto line and a marcato wedge were modelled,
|
|
5
|
+
* drawn, exported and imported long before anything played them — so a passage
|
|
6
|
+
* marked staccato sounded exactly as long as a legato one, and an accent was no
|
|
7
|
+
* louder than the note beside it. The marking was decoration.
|
|
8
|
+
*
|
|
9
|
+
* This resolves it, in the same place and by the same rules as a dynamic:
|
|
10
|
+
* inside `flattenScoreNotes`, the single traversal live playback and offline
|
|
11
|
+
* export already share, so the two cannot disagree about how a bar is played.
|
|
12
|
+
*
|
|
13
|
+
* **Two axes, because that is what these four markings actually say.** Staccato
|
|
14
|
+
* is about *length* and accent is about *weight*; marcato is both, and tenuto
|
|
15
|
+
* is the full length it would have had anyway. So each marking resolves to a
|
|
16
|
+
* length factor and a velocity offset rather than to one number.
|
|
17
|
+
*
|
|
18
|
+
* **It applies on top of the dynamic, never instead of it.** `effectiveVelocity`
|
|
19
|
+
* has already turned the marking in force plus the note's own written deviation
|
|
20
|
+
* into a velocity; the articulation is a further offset on that. This is the
|
|
21
|
+
* same doctrine dynamics established — an accent inside a quiet passage stays
|
|
22
|
+
* an accent, and an accent under `ff` is still louder than its neighbours
|
|
23
|
+
* rather than being flattened against the ceiling by a fixed level.
|
|
24
|
+
*
|
|
25
|
+
* **Shortening never moves anything.** A staccato note releases early; it still
|
|
26
|
+
* occupies its written length in the bar, so every following note starts
|
|
27
|
+
* exactly where it did. That is what keeps this a performance detail rather
|
|
28
|
+
* than an edit — and it is why the score is not rewritten to short notes plus
|
|
29
|
+
* rests, which is the other way to make staccato audible and which would make
|
|
30
|
+
* the marking impossible to remove.
|
|
31
|
+
*/
|
|
32
|
+
import type { Articulation } from "../../index.js";
|
|
33
|
+
/** How a marking is performed: a proportion of the written length, and a weight. */
|
|
34
|
+
export type ArticulationSound = {
|
|
35
|
+
/** The fraction of its written length the note actually sounds for. */
|
|
36
|
+
lengthFactor: number;
|
|
37
|
+
/** Added to the velocity the dynamic and the note's own deviation produced. */
|
|
38
|
+
velocityDelta: number;
|
|
39
|
+
};
|
|
40
|
+
/** How `articulation` is performed. An absent marking plays plain. */
|
|
41
|
+
export declare function articulationSound(articulation: Articulation | undefined): ArticulationSound;
|
|
42
|
+
/**
|
|
43
|
+
* The velocity `velocity` sounds at once `articulation` is applied.
|
|
44
|
+
*
|
|
45
|
+
* `velocity` is what the dynamic in force and the note's own written deviation
|
|
46
|
+
* already produced, so this is the last step before the engine sees it.
|
|
47
|
+
*/
|
|
48
|
+
export declare function articulatedVelocity(velocity: number, articulation: Articulation | undefined): number;
|
|
49
|
+
/**
|
|
50
|
+
* How long a note of `durationTicks` actually sounds under `articulation`.
|
|
51
|
+
*
|
|
52
|
+
* Never rounds down to nothing: a thirty-second note marked staccato at a fast
|
|
53
|
+
* tempo is still a note, and a zero-length one would simply not play.
|
|
54
|
+
*/
|
|
55
|
+
export declare function articulatedDuration(durationTicks: number, articulation: Articulation | undefined): number;
|
|
56
|
+
//# sourceMappingURL=articulation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"articulation.d.ts","sourceRoot":"","sources":["../../../src/domain/score/articulation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEnD,oFAAoF;AACpF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,uEAAuE;IACvE,YAAY,EAAE,MAAM,CAAC;IACrB,+EAA+E;IAC/E,aAAa,EAAE,MAAM,CAAC;CACvB,CAAC;AA+BF,sEAAsE;AACtE,wBAAgB,iBAAiB,CAC/B,YAAY,EAAE,YAAY,GAAG,SAAS,GACrC,iBAAiB,CAEnB;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,MAAM,EAChB,YAAY,EAAE,YAAY,GAAG,SAAS,GACrC,MAAM,CAIR;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CACjC,aAAa,EAAE,MAAM,EACrB,YAAY,EAAE,YAAY,GAAG,SAAS,GACrC,MAAM,CAIR"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/** An unmarked note: full length, no added weight. */
|
|
2
|
+
const PLAIN = { lengthFactor: 1, velocityDelta: 0 };
|
|
3
|
+
/**
|
|
4
|
+
* The performance of each marking.
|
|
5
|
+
*
|
|
6
|
+
* - `staccato` — detached, at half its written length. The conventional
|
|
7
|
+
* reading, and short enough to hear as detached at any tempo.
|
|
8
|
+
* - `tenuto` — held. Its length factor is 1, which is *already* the default,
|
|
9
|
+
* so the emphasis is the only audible part; see the note below.
|
|
10
|
+
* - `accent` — struck harder, full length. A weight, not a shortening.
|
|
11
|
+
* - `marcato` — marked: harder than an accent and somewhat detached, which is
|
|
12
|
+
* the difference between the two.
|
|
13
|
+
*
|
|
14
|
+
* **Tenuto is deliberately near-inaudible, and that is the honest answer.** It
|
|
15
|
+
* means "hold this note its full value", and an unmarked note here is already
|
|
16
|
+
* held its full value — so the alternative was to shorten *every* unmarked note
|
|
17
|
+
* slightly to make room for tenuto to be longer. That would change the playback
|
|
18
|
+
* of every score ever written in this app to give one rare marking something to
|
|
19
|
+
* contrast against, and it would break the rule the dynamics work established:
|
|
20
|
+
* an unmarked score plays exactly as it did before the feature existed.
|
|
21
|
+
*/
|
|
22
|
+
const ARTICULATION_SOUND = {
|
|
23
|
+
staccato: { lengthFactor: 0.5, velocityDelta: 0 },
|
|
24
|
+
tenuto: { lengthFactor: 1, velocityDelta: 4 },
|
|
25
|
+
accent: { lengthFactor: 1, velocityDelta: 20 },
|
|
26
|
+
marcato: { lengthFactor: 0.8, velocityDelta: 28 },
|
|
27
|
+
};
|
|
28
|
+
/** How `articulation` is performed. An absent marking plays plain. */
|
|
29
|
+
export function articulationSound(articulation) {
|
|
30
|
+
return articulation ? ARTICULATION_SOUND[articulation] : PLAIN;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* The velocity `velocity` sounds at once `articulation` is applied.
|
|
34
|
+
*
|
|
35
|
+
* `velocity` is what the dynamic in force and the note's own written deviation
|
|
36
|
+
* already produced, so this is the last step before the engine sees it.
|
|
37
|
+
*/
|
|
38
|
+
export function articulatedVelocity(velocity, articulation) {
|
|
39
|
+
const { velocityDelta } = articulationSound(articulation);
|
|
40
|
+
if (velocityDelta === 0)
|
|
41
|
+
return velocity;
|
|
42
|
+
return Math.max(1, Math.min(127, velocity + velocityDelta));
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* How long a note of `durationTicks` actually sounds under `articulation`.
|
|
46
|
+
*
|
|
47
|
+
* Never rounds down to nothing: a thirty-second note marked staccato at a fast
|
|
48
|
+
* tempo is still a note, and a zero-length one would simply not play.
|
|
49
|
+
*/
|
|
50
|
+
export function articulatedDuration(durationTicks, articulation) {
|
|
51
|
+
const { lengthFactor } = articulationSound(articulation);
|
|
52
|
+
if (lengthFactor === 1)
|
|
53
|
+
return durationTicks;
|
|
54
|
+
return Math.max(1, Math.round(durationTicks * lengthFactor));
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=articulation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"articulation.js","sourceRoot":"","sources":["../../../src/domain/score/articulation.ts"],"names":[],"mappings":"AAyCA,sDAAsD;AACtD,MAAM,KAAK,GAAsB,EAAE,YAAY,EAAE,CAAC,EAAE,aAAa,EAAE,CAAC,EAAE,CAAC;AAEvE;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,kBAAkB,GAA4C;IAClE,QAAQ,EAAE,EAAE,YAAY,EAAE,GAAG,EAAE,aAAa,EAAE,CAAC,EAAE;IACjD,MAAM,EAAE,EAAE,YAAY,EAAE,CAAC,EAAE,aAAa,EAAE,CAAC,EAAE;IAC7C,MAAM,EAAE,EAAE,YAAY,EAAE,CAAC,EAAE,aAAa,EAAE,EAAE,EAAE;IAC9C,OAAO,EAAE,EAAE,YAAY,EAAE,GAAG,EAAE,aAAa,EAAE,EAAE,EAAE;CAClD,CAAC;AAEF,sEAAsE;AACtE,MAAM,UAAU,iBAAiB,CAC/B,YAAsC;IAEtC,OAAO,YAAY,CAAC,CAAC,CAAC,kBAAkB,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;AACjE,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,mBAAmB,CACjC,QAAgB,EAChB,YAAsC;IAEtC,MAAM,EAAE,aAAa,EAAE,GAAG,iBAAiB,CAAC,YAAY,CAAC,CAAC;IAC1D,IAAI,aAAa,KAAK,CAAC;QAAE,OAAO,QAAQ,CAAC;IACzC,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,QAAQ,GAAG,aAAa,CAAC,CAAC,CAAC;AAC9D,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,mBAAmB,CACjC,aAAqB,EACrB,YAAsC;IAEtC,MAAM,EAAE,YAAY,EAAE,GAAG,iBAAiB,CAAC,YAAY,CAAC,CAAC;IACzD,IAAI,YAAY,KAAK,CAAC;QAAE,OAAO,aAAa,CAAC;IAC7C,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,aAAa,GAAG,YAAY,CAAC,CAAC,CAAC;AAC/D,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What number a bar is called.
|
|
3
|
+
*
|
|
4
|
+
* Almost always its position plus one — but a pickup is not counted, so a
|
|
5
|
+
* score that opens with one has its first *full* bar as bar 1 and the pickup
|
|
6
|
+
* as no number at all. That is not a display nicety: "go to bar 33" and the
|
|
7
|
+
* inspector's Bar/Beat field have to mean the same 33 the player's part does,
|
|
8
|
+
* and a score with a pickup shifts every one of them by one.
|
|
9
|
+
*
|
|
10
|
+
* Kept as a pure function over the measure list so the renderer, the go-to-bar
|
|
11
|
+
* prompt and the inspector all answer identically without any of them knowing
|
|
12
|
+
* how a pickup is stored.
|
|
13
|
+
*/
|
|
14
|
+
import type { Measure } from "../../index.js";
|
|
15
|
+
/**
|
|
16
|
+
* The number printed over `measures[index]`, or `null` for a bar that is not
|
|
17
|
+
* counted.
|
|
18
|
+
*
|
|
19
|
+
* `null` rather than 0: a pickup has no number, and printing one would claim
|
|
20
|
+
* it does. The renderer draws nothing there, which is what an engraver does.
|
|
21
|
+
*/
|
|
22
|
+
export declare function barNumberAt(measures: readonly Measure[], index: number): number | null;
|
|
23
|
+
/**
|
|
24
|
+
* The index of the bar a player would call `barNumber`.
|
|
25
|
+
*
|
|
26
|
+
* `null` when no such bar exists, so "go to bar 500" in a 40-bar score fails
|
|
27
|
+
* rather than silently landing somewhere.
|
|
28
|
+
*/
|
|
29
|
+
export declare function indexOfBarNumber(measures: readonly Measure[], barNumber: number): number | null;
|
|
30
|
+
/**
|
|
31
|
+
* Whether `measures` opens with a pickup.
|
|
32
|
+
*
|
|
33
|
+
* Only the first bar can be one — an anacrusis is the run-up to the first full
|
|
34
|
+
* bar, and a short bar anywhere else is an irregular bar, which is a different
|
|
35
|
+
* thing and keeps its number.
|
|
36
|
+
*/
|
|
37
|
+
export declare function hasPickup(measures: readonly Measure[]): boolean;
|
|
38
|
+
//# sourceMappingURL=bar-numbers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bar-numbers.d.ts","sourceRoot":"","sources":["../../../src/domain/score/bar-numbers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAE9C;;;;;;GAMG;AACH,wBAAgB,WAAW,CACzB,QAAQ,EAAE,SAAS,OAAO,EAAE,EAC5B,KAAK,EAAE,MAAM,GACZ,MAAM,GAAG,IAAI,CASf;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,SAAS,OAAO,EAAE,EAC5B,SAAS,EAAE,MAAM,GAChB,MAAM,GAAG,IAAI,CASf;AAED;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,QAAQ,EAAE,SAAS,OAAO,EAAE,GAAG,OAAO,CAE/D"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The number printed over `measures[index]`, or `null` for a bar that is not
|
|
3
|
+
* counted.
|
|
4
|
+
*
|
|
5
|
+
* `null` rather than 0: a pickup has no number, and printing one would claim
|
|
6
|
+
* it does. The renderer draws nothing there, which is what an engraver does.
|
|
7
|
+
*/
|
|
8
|
+
export function barNumberAt(measures, index) {
|
|
9
|
+
if (index < 0 || index >= measures.length)
|
|
10
|
+
return null;
|
|
11
|
+
if (measures[index].pickup)
|
|
12
|
+
return null;
|
|
13
|
+
let number = 0;
|
|
14
|
+
for (let i = 0; i <= index; i += 1) {
|
|
15
|
+
if (!measures[i].pickup)
|
|
16
|
+
number += 1;
|
|
17
|
+
}
|
|
18
|
+
return number;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* The index of the bar a player would call `barNumber`.
|
|
22
|
+
*
|
|
23
|
+
* `null` when no such bar exists, so "go to bar 500" in a 40-bar score fails
|
|
24
|
+
* rather than silently landing somewhere.
|
|
25
|
+
*/
|
|
26
|
+
export function indexOfBarNumber(measures, barNumber) {
|
|
27
|
+
if (barNumber < 1)
|
|
28
|
+
return null;
|
|
29
|
+
let number = 0;
|
|
30
|
+
for (let i = 0; i < measures.length; i += 1) {
|
|
31
|
+
if (measures[i].pickup)
|
|
32
|
+
continue;
|
|
33
|
+
number += 1;
|
|
34
|
+
if (number === barNumber)
|
|
35
|
+
return i;
|
|
36
|
+
}
|
|
37
|
+
return null;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Whether `measures` opens with a pickup.
|
|
41
|
+
*
|
|
42
|
+
* Only the first bar can be one — an anacrusis is the run-up to the first full
|
|
43
|
+
* bar, and a short bar anywhere else is an irregular bar, which is a different
|
|
44
|
+
* thing and keeps its number.
|
|
45
|
+
*/
|
|
46
|
+
export function hasPickup(measures) {
|
|
47
|
+
return measures[0]?.pickup === true;
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=bar-numbers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bar-numbers.js","sourceRoot":"","sources":["../../../src/domain/score/bar-numbers.ts"],"names":[],"mappings":"AAeA;;;;;;GAMG;AACH,MAAM,UAAU,WAAW,CACzB,QAA4B,EAC5B,KAAa;IAEb,IAAI,KAAK,GAAG,CAAC,IAAI,KAAK,IAAI,QAAQ,CAAC,MAAM;QAAE,OAAO,IAAI,CAAC;IACvD,IAAI,QAAQ,CAAC,KAAK,CAAC,CAAC,MAAM;QAAE,OAAO,IAAI,CAAC;IAExC,IAAI,MAAM,GAAG,CAAC,CAAC;IACf,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,KAAK,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC;QACnC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,MAAM;YAAE,MAAM,IAAI,CAAC,CAAC;IACvC,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,gBAAgB,CAC9B,QAA4B,EAC5B,SAAiB;IAEjB,IAAI,SAAS,GAAG,CAAC;QAAE,OAAO,IAAI,CAAC;IAC/B,IAAI,MAAM,GAAG,CAAC,CAAC;IACf,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC;QAC5C,IAAI,QAAQ,CAAC,CAAC,CAAC,CAAC,MAAM;YAAE,SAAS;QACjC,MAAM,IAAI,CAAC,CAAC;QACZ,IAAI,MAAM,KAAK,SAAS;YAAE,OAAO,CAAC,CAAC;IACrC,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,SAAS,CAAC,QAA4B;IACpD,OAAO,QAAQ,CAAC,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;AACtC,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { Measure } from "../../index.js";
|
|
2
|
+
/**
|
|
3
|
+
* Whether nothing sounds in `measure`.
|
|
4
|
+
*
|
|
5
|
+
* One note in any voice disqualifies it: the player still has to play that
|
|
6
|
+
* bar, so it cannot disappear into a count.
|
|
7
|
+
*/
|
|
8
|
+
export declare function isSilentMeasure(measure: Measure): boolean;
|
|
9
|
+
/**
|
|
10
|
+
* `measures` with every run of two or more silent measures replaced by a
|
|
11
|
+
* single measure carrying the count.
|
|
12
|
+
*
|
|
13
|
+
* The survivor is the run's **first** measure, keeping its own `index`,
|
|
14
|
+
* `startTick` and signatures. That is what makes the numbering work: the
|
|
15
|
+
* renderer draws measure numbers from `measure.index`, so the bar after a
|
|
16
|
+
* 24-bar rest still reports 25.
|
|
17
|
+
*
|
|
18
|
+
* The returned list is therefore shorter than the input, and its measures are
|
|
19
|
+
* no longer contiguous in `startTick`. Only a print-only derived score may
|
|
20
|
+
* carry that.
|
|
21
|
+
*/
|
|
22
|
+
export declare function collapseRests(measures: readonly Measure[]): Measure[];
|
|
23
|
+
//# sourceMappingURL=collapse-rests.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collapse-rests.d.ts","sourceRoot":"","sources":["../../../src/domain/score/collapse-rests.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAK9C;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAEzD;AAsBD;;;;;;;;;;;;GAYG;AACH,wBAAgB,aAAa,CAAC,QAAQ,EAAE,SAAS,OAAO,EAAE,GAAG,OAAO,EAAE,CAkCrE"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Collapsing runs of silence into multi-measure rests.
|
|
3
|
+
*
|
|
4
|
+
* Pure over a measure list — no score, no renderer — so the rules about what
|
|
5
|
+
* counts as silent and where a run may not span are testable on their own.
|
|
6
|
+
*
|
|
7
|
+
* For **printed parts only**. A stored score always writes its rests out:
|
|
8
|
+
* collapsing loses which bar is which, and the editor needs every bar.
|
|
9
|
+
*/
|
|
10
|
+
import { isNoteEvent } from "../../index.js";
|
|
11
|
+
/** Below this, a run is written out — "1" over a bar is noise, not notation. */
|
|
12
|
+
const MIN_RUN = 2;
|
|
13
|
+
/**
|
|
14
|
+
* Whether nothing sounds in `measure`.
|
|
15
|
+
*
|
|
16
|
+
* One note in any voice disqualifies it: the player still has to play that
|
|
17
|
+
* bar, so it cannot disappear into a count.
|
|
18
|
+
*/
|
|
19
|
+
export function isSilentMeasure(measure) {
|
|
20
|
+
return measure.voices.every((voice) => !voice.events.some(isNoteEvent));
|
|
21
|
+
}
|
|
22
|
+
/** Whether a run may continue from `previous` into `next`. */
|
|
23
|
+
function runContinues(previous, next) {
|
|
24
|
+
// A mark inside a rest would be invisible, and "from B" would point at
|
|
25
|
+
// nothing. The bar carrying it has to start its own rest.
|
|
26
|
+
if (next.rehearsalMark !== undefined)
|
|
27
|
+
return false;
|
|
28
|
+
// A cue bar is written out: it is silent in the player's own voices, so
|
|
29
|
+
// without this it would vanish into the count it exists to end.
|
|
30
|
+
if (next.cue !== undefined)
|
|
31
|
+
return false;
|
|
32
|
+
// A multi-measure rest asserts the bars inside it are alike. Spanning a
|
|
33
|
+
// change would hide from the player exactly where it happened.
|
|
34
|
+
return (previous.timeSignature.numerator === next.timeSignature.numerator &&
|
|
35
|
+
previous.timeSignature.denominator === next.timeSignature.denominator &&
|
|
36
|
+
previous.keySignature.fifths === next.keySignature.fifths &&
|
|
37
|
+
previous.keySignature.mode === next.keySignature.mode);
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* `measures` with every run of two or more silent measures replaced by a
|
|
41
|
+
* single measure carrying the count.
|
|
42
|
+
*
|
|
43
|
+
* The survivor is the run's **first** measure, keeping its own `index`,
|
|
44
|
+
* `startTick` and signatures. That is what makes the numbering work: the
|
|
45
|
+
* renderer draws measure numbers from `measure.index`, so the bar after a
|
|
46
|
+
* 24-bar rest still reports 25.
|
|
47
|
+
*
|
|
48
|
+
* The returned list is therefore shorter than the input, and its measures are
|
|
49
|
+
* no longer contiguous in `startTick`. Only a print-only derived score may
|
|
50
|
+
* carry that.
|
|
51
|
+
*/
|
|
52
|
+
export function collapseRests(measures) {
|
|
53
|
+
const out = [];
|
|
54
|
+
let index = 0;
|
|
55
|
+
while (index < measures.length) {
|
|
56
|
+
const start = measures[index];
|
|
57
|
+
// A cue bar may not *start* a run either, or a cue followed by more
|
|
58
|
+
// silence would be collapsed away from the other end.
|
|
59
|
+
if (!isSilentMeasure(start) || start.cue !== undefined) {
|
|
60
|
+
out.push(start);
|
|
61
|
+
index += 1;
|
|
62
|
+
continue;
|
|
63
|
+
}
|
|
64
|
+
let end = index + 1;
|
|
65
|
+
while (end < measures.length &&
|
|
66
|
+
isSilentMeasure(measures[end]) &&
|
|
67
|
+
runContinues(measures[end - 1], measures[end])) {
|
|
68
|
+
end += 1;
|
|
69
|
+
}
|
|
70
|
+
const runLength = end - index;
|
|
71
|
+
out.push(runLength >= MIN_RUN
|
|
72
|
+
? { ...start, multiMeasureRestCount: runLength }
|
|
73
|
+
: start);
|
|
74
|
+
index = end;
|
|
75
|
+
}
|
|
76
|
+
return out;
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=collapse-rests.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collapse-rests.js","sourceRoot":"","sources":["../../../src/domain/score/collapse-rests.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAG7C,gFAAgF;AAChF,MAAM,OAAO,GAAG,CAAC,CAAC;AAElB;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAAC,OAAgB;IAC9C,OAAO,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC;AAC1E,CAAC;AAED,8DAA8D;AAC9D,SAAS,YAAY,CAAC,QAAiB,EAAE,IAAa;IACpD,uEAAuE;IACvE,0DAA0D;IAC1D,IAAI,IAAI,CAAC,aAAa,KAAK,SAAS;QAAE,OAAO,KAAK,CAAC;IAEnD,wEAAwE;IACxE,gEAAgE;IAChE,IAAI,IAAI,C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N,SAAS,IAAI,OAAO;YAClB,CAAC,CAAC,EAAE,GAAG,KAAK,EAAE,qBAAqB,EAAE,SAAS,EAAE;YAChD,CAAC,CAAC,KAAK,CACV,CAAC;QACF,KAAK,GAAG,GAAG,CAAC;IACd,CAAC;IAED,OAAO,GAAG,CAAC;AACb,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { Measure, MeasureCue, Score } from "../../index.js";
|
|
2
|
+
/**
|
|
3
|
+
* Shortest rest that earns a cue.
|
|
4
|
+
*
|
|
5
|
+
* Below this nobody is lost, and the cue costs a bar that would otherwise be
|
|
6
|
+
* counted inside a multi-measure rest. A chosen number, not a derived one.
|
|
7
|
+
*/
|
|
8
|
+
export declare const MIN_REST_FOR_CUE = 8;
|
|
9
|
+
/**
|
|
10
|
+
* Cues for `trackId`'s part, keyed by measure index.
|
|
11
|
+
*
|
|
12
|
+
* One bar, on the last bar of any rest of `MIN_REST_FOR_CUE` or more that is
|
|
13
|
+
* followed by an entry. A rest running to the end of the piece gets none:
|
|
14
|
+
* there is nothing to prepare for.
|
|
15
|
+
*/
|
|
16
|
+
export declare function measureCues(score: Score, trackId: string): Map<number, MeasureCue>;
|
|
17
|
+
/**
|
|
18
|
+
* `measures` with each cue written onto the measure carrying that **index**.
|
|
19
|
+
*
|
|
20
|
+
* Keyed by `measure.index` for the same reason marks are: a part's measures
|
|
21
|
+
* may already have been thinned, so array position means nothing.
|
|
22
|
+
*/
|
|
23
|
+
export declare function applyCues(measures: readonly Measure[], cues: ReadonlyMap<number, MeasureCue>): Measure[];
|
|
24
|
+
//# sourceMappingURL=cue-notes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cue-notes.d.ts","sourceRoot":"","sources":["../../../src/domain/score/cue-notes.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EACV,OAAO,EACP,UAAU,EAEV,KAAK,EAEN,MAAM,gBAAgB,CAAC;AAExB;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,IAAI,CAAC;AA+ClC;;;;;;GAMG;AACH,wBAAgB,WAAW,CACzB,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,MAAM,GACd,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,CAkCzB;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CACvB,QAAQ,EAAE,SAAS,OAAO,EAAE,EAC5B,IAAI,EAAE,WAAW,CAAC,MAAM,EAAE,UAAU,CAAC,GACpC,OAAO,EAAE,CAKX"}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Where cue notes go, and whose notes they are.
|
|
3
|
+
*
|
|
4
|
+
* **Derived per part, from the rest of the score** — the opposite of rehearsal
|
|
5
|
+
* marks. A mark must mean the same bar to everybody; a cue is for one player's
|
|
6
|
+
* entry, drawn from the tracks they are about to come in against.
|
|
7
|
+
*
|
|
8
|
+
* Print-only: a stored score carries none, and the whole-score print gets none
|
|
9
|
+
* either, because a conductor is already looking at every part.
|
|
10
|
+
*/
|
|
11
|
+
import { isNoteEvent } from "../../index.js";
|
|
12
|
+
import { isSilentMeasure } from "./collapse-rests.js";
|
|
13
|
+
/**
|
|
14
|
+
* Shortest rest that earns a cue.
|
|
15
|
+
*
|
|
16
|
+
* Below this nobody is lost, and the cue costs a bar that would otherwise be
|
|
17
|
+
* counted inside a multi-measure rest. A chosen number, not a derived one.
|
|
18
|
+
*/
|
|
19
|
+
export const MIN_REST_FOR_CUE = 8;
|
|
20
|
+
/** How many notes sound in `measure`, across every voice. */
|
|
21
|
+
function noteCount(measure) {
|
|
22
|
+
return measure.voices.reduce((total, voice) => total + voice.events.filter(isNoteEvent).length, 0);
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* The events of `measure`'s busiest voice.
|
|
26
|
+
*
|
|
27
|
+
* One voice, not all of them: a cue is a landmark, and stacking a piano's two
|
|
28
|
+
* hands into one small-print bar makes it harder to read, not more informative.
|
|
29
|
+
*/
|
|
30
|
+
function busiestVoiceEvents(measure) {
|
|
31
|
+
let best = [];
|
|
32
|
+
let bestCount = 0;
|
|
33
|
+
for (const voice of measure.voices) {
|
|
34
|
+
const count = voice.events.filter(isNoteEvent).length;
|
|
35
|
+
if (count > bestCount) {
|
|
36
|
+
best = voice.events;
|
|
37
|
+
bestCount = count;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
return best;
|
|
41
|
+
}
|
|
42
|
+
/** The other track with the most notes in bar `index`, or undefined if none plays. */
|
|
43
|
+
function busiestOtherTrack(others, index) {
|
|
44
|
+
let best;
|
|
45
|
+
let bestCount = 0;
|
|
46
|
+
for (const track of others) {
|
|
47
|
+
const measure = track.measures[index];
|
|
48
|
+
const count = measure ? noteCount(measure) : 0;
|
|
49
|
+
if (count > bestCount) {
|
|
50
|
+
best = track;
|
|
51
|
+
bestCount = count;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
return best;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Cues for `trackId`'s part, keyed by measure index.
|
|
58
|
+
*
|
|
59
|
+
* One bar, on the last bar of any rest of `MIN_REST_FOR_CUE` or more that is
|
|
60
|
+
* followed by an entry. A rest running to the end of the piece gets none:
|
|
61
|
+
* there is nothing to prepare for.
|
|
62
|
+
*/
|
|
63
|
+
export function measureCues(score, trackId) {
|
|
64
|
+
const cues = new Map();
|
|
65
|
+
const track = score.tracks.find((t) => t.id === trackId);
|
|
66
|
+
if (!track)
|
|
67
|
+
return cues;
|
|
68
|
+
const others = score.tracks.filter((t) => t.id !== trackId);
|
|
69
|
+
let index = 0;
|
|
70
|
+
while (index < track.measures.length) {
|
|
71
|
+
if (!isSilentMeasure(track.measures[index])) {
|
|
72
|
+
index += 1;
|
|
73
|
+
continue;
|
|
74
|
+
}
|
|
75
|
+
let end = index;
|
|
76
|
+
while (end < track.measures.length && isSilentMeasure(track.measures[end]))
|
|
77
|
+
end += 1;
|
|
78
|
+
const entersAfter = end < track.measures.length;
|
|
79
|
+
if (end - index >= MIN_REST_FOR_CUE && entersAfter) {
|
|
80
|
+
const cueIndex = end - 1;
|
|
81
|
+
const source = busiestOtherTrack(others, cueIndex);
|
|
82
|
+
if (source) {
|
|
83
|
+
cues.set(cueIndex, {
|
|
84
|
+
label: source.name,
|
|
85
|
+
events: busiestVoiceEvents(source.measures[cueIndex]),
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
index = end;
|
|
90
|
+
}
|
|
91
|
+
return cues;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* `measures` with each cue written onto the measure carrying that **index**.
|
|
95
|
+
*
|
|
96
|
+
* Keyed by `measure.index` for the same reason marks are: a part's measures
|
|
97
|
+
* may already have been thinned, so array position means nothing.
|
|
98
|
+
*/
|
|
99
|
+
export function applyCues(measures, cues) {
|
|
100
|
+
return measures.map((measure) => {
|
|
101
|
+
const cue = cues.get(measure.index);
|
|
102
|
+
return cue === undefined ? measure : { ...measure, cue };
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
//# sourceMappingURL=cue-notes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cue-notes.js","sourceRoot":"","sources":["../../../src/domain/score/cue-notes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAStD;;;;;GAKG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC;AAElC,6DAA6D;AAC7D,SAAS,SAAS,CAAC,OAAgB;IACjC,OAAO,OAAO,CAAC,MAAM,CAAC,MAAM,CAC1B,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,MAAM,EACjE,CAAC,CACF,CAAC;AACJ,CAAC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CAAC,OAAO,EAAE,EAAE;QAC9B,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QACpC,OAAO,GAAG,KAAK,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,GAAG,OAAO,EAAE,GAAG,EAAE,CAAC;IAC3D,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What a dynamic marking does to the sound.
|
|
3
|
+
*
|
|
4
|
+
* A dynamic is stored on the note it starts at and is in force until the next
|
|
5
|
+
* one on that track — the way it is read on paper. Resolving that into a
|
|
6
|
+
* velocity per note is what makes the marking audible rather than decorative,
|
|
7
|
+
* and it happens in `flattenScoreNotes`, the single traversal both live
|
|
8
|
+
* playback and offline export already share, so the two cannot disagree about
|
|
9
|
+
* how loud a passage is.
|
|
10
|
+
*
|
|
11
|
+
* **The note's own velocity survives.** A dynamic sets the level; the velocity
|
|
12
|
+
* written on a note is kept as its deviation from the default, so an accent
|
|
13
|
+
* inside a quiet passage stays an accent. The three rules that follow from it:
|
|
14
|
+
*
|
|
15
|
+
* - a score with no dynamics plays exactly as it did before they existed;
|
|
16
|
+
* - a note left at the default under `ff` plays at `ff`;
|
|
17
|
+
* - a note written louder than default under `ff` plays louder still.
|
|
18
|
+
*
|
|
19
|
+
* The alternative — a dynamic overwriting velocity outright, which is what
|
|
20
|
+
* most notation software does — would have made the inspector's Velocity field
|
|
21
|
+
* silently inert the moment a passage was marked, which is worse than either
|
|
22
|
+
* behaviour on its own.
|
|
23
|
+
*/
|
|
24
|
+
import type { Dynamic, MusicalEvent, NoteEvent } from "../../index.js";
|
|
25
|
+
/** The velocity a note is written at when nobody has said otherwise. */
|
|
26
|
+
export declare const DEFAULT_VELOCITY = 80;
|
|
27
|
+
export declare function velocityForDynamic(dynamic: Dynamic): number;
|
|
28
|
+
/**
|
|
29
|
+
* The velocity a note actually sounds at under `dynamic`.
|
|
30
|
+
*
|
|
31
|
+
* `null` means no dynamic is in force, and the written velocity stands.
|
|
32
|
+
*/
|
|
33
|
+
export declare function effectiveVelocity(note: NoteEvent, dynamic: Dynamic | null): number;
|
|
34
|
+
/**
|
|
35
|
+
* Walks one voice's events in order, reporting the dynamic in force at each.
|
|
36
|
+
*
|
|
37
|
+
* Takes an already-ordered channel — the caller has sorted and joined ties —
|
|
38
|
+
* because "the next dynamic" only means anything in tick order.
|
|
39
|
+
*/
|
|
40
|
+
export declare function dynamicsInForce(events: readonly MusicalEvent[]): Map<string, Dynamic>;
|
|
41
|
+
/**
|
|
42
|
+
* The velocity each note in a hairpin ramps to.
|
|
43
|
+
*
|
|
44
|
+
* A dynamic sets a level; a hairpin is the *change* between two of them, so
|
|
45
|
+
* the only honest way to sound one is to ramp. The span runs from the note
|
|
46
|
+
* carrying `hairpinStart` to the one carrying `hairpinStop`, and velocity
|
|
47
|
+
* moves linearly from the level in force at the opening to the level in force
|
|
48
|
+
* just **after** the close — which is how a player reads it: the wedge takes
|
|
49
|
+
* you to the next marking.
|
|
50
|
+
*
|
|
51
|
+
* **Where there is no next marking**, the wedge still has to arrive somewhere.
|
|
52
|
+
* A crescendo with nothing after it goes one dynamic step up from where it
|
|
53
|
+
* started, and a diminuendo one step down. That is what a player does with an
|
|
54
|
+
* unresolved hairpin, and it beats the alternatives: leaving it flat makes the
|
|
55
|
+
* marking silent, and ramping to full or to nothing turns an unmarked detail
|
|
56
|
+
* into the loudest or quietest thing in the piece.
|
|
57
|
+
*
|
|
58
|
+
* Returns an empty map for a score with no hairpin, so an unmarked passage
|
|
59
|
+
* costs one allocation and no arithmetic.
|
|
60
|
+
*/
|
|
61
|
+
export declare function hairpinVelocities(events: readonly MusicalEvent[], inForce: Map<string, Dynamic>): Map<string, number>;
|
|
62
|
+
//# sourceMappingURL=dynamics.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dynamics.d.ts","sourceRoot":"","sources":["../../../src/domain/score/dynamics.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAoBvE,wEAAwE;AACxE,eAAO,MAAM,gBAAgB,KAAK,CAAC;AAEnC,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,CAE3D;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,SAAS,EACf,OAAO,EAAE,OAAO,GAAG,IAAI,GACtB,MAAM,CAIR;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAC7B,MAAM,EAAE,SAAS,YAAY,EAAE,GAC9B,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAStB;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,SAAS,YAAY,EAAE,EAC/B,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,GAC5B,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CA4CrB"}
|