/ music / double-pendulum
Sign in
music / double-pendulum
double-pendulum / src / stream / layout.ts
35 lines · 1.2 KBCodeBlameHistory
75ca48aOverhaul playback: background-computed, buffered, one clockJeremy Magland 1// How a composition's performance is laid out: its stems (each rendered by one producer) and the
2// outputs they play on (each with its effects and live level on the page). Worker-safe: the score
3// uses the same layout to know its stem numbers.
5import type { Params as SynthParams } from "@modal-synth/engine/params.ts";
6import type { Params } from "../core/params.ts";
8export interface StemSpec {
9 /** "synth": a modal-synth instrument in its own worker, played by the score's notes;
10 * "score": audio the score renders itself (e.g. the ensemble's pendulums) */
11 kind: "synth" | "score";
12 sound?: SynthParams;
13 output: number;
16export interface OutputSpec {
17 /**
18 * "own": the sound's own modal-synth effects (saturation, delay, reverb);
19 * "shared": dry at the sound's volume plus a send to the piece's one shared reverb;
20 * "none": dry (at the sound's volume, if it has one)
21 */
22 effects: "own" | "shared" | "none";
23 sound?: SynthParams;
24 /** dB, read live */
25 level: (P: Params) => number;
26 /** −1..1, read live */
27 pan?: (P: Params) => number;
30export interface Layout {
31 stems: StemSpec[];
32 outputs: OutputSpec[];
33 /** T60 of the shared reverb (outputs with effects "shared") */
34 reverbTime?: number;
↑↓ move↵openescclose