@sudobility/music_types 0.11.15 → 0.11.17
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.
|
@@ -15,9 +15,25 @@ export type TransportPlaybackState = 'stopped' | 'playing' | 'paused';
|
|
|
15
15
|
* currently-sounding note ids changes; `onStateChange` fires on every
|
|
16
16
|
* play/pause/stop transition, including ones the engine itself initiates.
|
|
17
17
|
*/
|
|
18
|
+
export type SoundingNote = {
|
|
19
|
+
/** The `NoteEvent.id` this voice came from, for notation highlighting. */
|
|
20
|
+
noteId: string;
|
|
21
|
+
/** Which track it is on, so a consumer can filter without searching the score. */
|
|
22
|
+
trackId: string;
|
|
23
|
+
/** Its sounding MIDI pitch, so a keyboard can light a key without resolving the event. */
|
|
24
|
+
midi: number;
|
|
25
|
+
};
|
|
18
26
|
export type PlaybackObserver = {
|
|
19
27
|
onPositionTick(tick: number): void;
|
|
20
|
-
|
|
28
|
+
/**
|
|
29
|
+
* The notes currently sounding, whenever that set changes.
|
|
30
|
+
*
|
|
31
|
+
* Resolved rather than bare ids. The scheduler already knows each note's
|
|
32
|
+
* track and pitch — it scheduled them — and emitting only the id forced every
|
|
33
|
+
* consumer to search the whole score to get it back: `playingPitchesForTrack`
|
|
34
|
+
* was an O(score) scan per sounding note, twenty times a second.
|
|
35
|
+
*/
|
|
36
|
+
onActiveNotes(notes: SoundingNote[]): void;
|
|
21
37
|
onStateChange(state: TransportPlaybackState): void;
|
|
22
38
|
/**
|
|
23
39
|
* How far along the engine is in becoming able to make a sound.
|
|
@@ -59,6 +75,21 @@ export interface PlaybackEngine {
|
|
|
59
75
|
setLoop(range: ScoreRange | null): void;
|
|
60
76
|
setTrackMute(trackId: string, muted: boolean): void;
|
|
61
77
|
setTrackSolo(trackId: string, solo: boolean): void;
|
|
78
|
+
/**
|
|
79
|
+
* Re-reads every track's volume, pan, mute and solo from `score` and pushes
|
|
80
|
+
* them, touching nothing that is scheduled.
|
|
81
|
+
*
|
|
82
|
+
* The mixing counterpart to `loadScore`. Mute and solo had setters; volume
|
|
83
|
+
* and pan did not, and a track's volume was only ever read at load time — so
|
|
84
|
+
* once a mix change stopped reloading the score (the playback edit lock, see
|
|
85
|
+
* `music_lib`'s `score-slice`), moving a fader during playback moved the
|
|
86
|
+
* fader and not the sound.
|
|
87
|
+
*
|
|
88
|
+
* Idempotent, and takes the whole score rather than one property: the caller
|
|
89
|
+
* says "the mix changed, here it is" and does not work out which property it
|
|
90
|
+
* was.
|
|
91
|
+
*/
|
|
92
|
+
applyMix(score: Score): void;
|
|
62
93
|
/** Toggles the metronome click. */
|
|
63
94
|
setMetronome(enabled: boolean): void;
|
|
64
95
|
/** Sets overall output level, 0-1 linear gain. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"playback.d.ts","sourceRoot":"","sources":["../../src/platform/playback.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAErD,MAAM,MAAM,sBAAsB,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,CAAC;AAEtE;;;;;GAKG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACnC,aAAa,CAAC,
|
|
1
|
+
{"version":3,"file":"playback.d.ts","sourceRoot":"","sources":["../../src/platform/playback.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAErD,MAAM,MAAM,sBAAsB,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,CAAC;AAEtE;;;;;GAKG;AACH,MAAM,MAAM,YAAY,GAAG;IACzB,0EAA0E;IAC1E,MAAM,EAAE,MAAM,CAAC;IACf,kFAAkF;IAClF,OAAO,EAAE,MAAM,CAAC;IAChB,0FAA0F;IAC1F,IAAI,EA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