f7d91baAdd composition 4: crashJeremy Magland 1import type { ParamSpec } from "../../core/params.ts";
1995755crash: piano notes at height levels instead of the gliding voiceJeremy Magland 2import { NOTE_INSTRUMENTS } from "../../instruments/index.ts";
f7d91baAdd composition 4: crashJeremy Magland 3import { schema as c01 } from "../c01-poincare/schema.ts";
5const pick = (key: string, o: Partial<ParamSpec> = {}): ParamSpec => {
6 const s = c01.find((x) => x.key === key);
7 if (!s) throw new Error(`no setting ${key} in composition 1`);
8 return { ...s, ...o } as ParamSpec;
9};
11export const schema: ParamSpec[] = [
12 // ── form ──
13 { group: "form", key: "fallAfter", label: "tips after", kind: "number", default: 5, min: 1, max: 30, step: 0.5, unit: "s", hint: "the nudge from straight up is calibrated so the pendulum visibly tips at about this time" },
14 { group: "form", key: "freeTime", label: "swinging", kind: "number", default: 60, min: 5, max: 600, step: 1, unit: "s", hint: "time before the stronger damping begins" },
15 { group: "form", key: "dampTime", label: "damping", kind: "number", default: 20, min: 2, max: 300, step: 0.5, unit: "s", hint: "time over which the damping grows to its final strength" },
16 { group: "form", key: "dampBase", label: "slight damping", kind: "number", default: 0.004, min: 0, max: 0.1, step: 0.0005, unit: "/sim s", hint: "friction throughout (energy loses roughly this fraction per simulated second)" },
17 { group: "form", key: "dampEnd", label: "final damping", kind: "number", default: 0.2, min: 0.01, max: 2, log: true, unit: "/sim s", hint: "friction reached by the end of the damping" },
89519c1crash: extension notes when the arms are fully extendedJeremy Magland 18 pick("restEnergy", { hint: "after the damping, the pendulum counts as at rest below this energy: the last extension note rings out" }),
20 pick("finalFade"),
22 // ── pendulum ──
23 { group: "pendulum", key: "speed", label: "speed", kind: "number", default: 1.5, min: 0.25, max: 20, log: true, unit: "×", hint: "simulated seconds per real second" },
24 { group: "pendulum", key: "tipThreshold", label: "“visibly”", kind: "number", default: 0.02, min: 0.001, max: 0.5, log: true, hint: "sideways bob movement (fraction of the length) that counts as tipping" },
25 pick("massRatio", { group: "pendulum" }),
26 pick("lengthRatio", { group: "pendulum" }),
27 pick("seed", { group: "pendulum", hint: "0 = a different nudge (side and shape) every play" }),
89519c1crash: extension notes when the arms are fully extendedJeremy Magland 29 // ── extension notes: the pendulum fully extended (arms in a straight line, at any angle) ──
30 { group: "extension", key: "extInstrument", label: "instrument", kind: "select", default: "modal: Violin", options: Object.keys(NOTE_INSTRUMENTS) },
31 pick("modalCustom", { group: "extension" }),
32 { group: "extension", key: "extPitch", label: "pitch", kind: "number", default: 55, min: 12, max: 108, step: 0.5, unit: "midi" },
33 { group: "extension", key: "extLength", label: "length", kind: "number", default: 0.4, min: 0.05, max: 5, log: true, unit: "s" },
34 { group: "extension", key: "firstVel", label: "first note", kind: "number", default: 1, min: 0.05, max: 1, step: 0.01, hint: "strength of the first extension note (accent)" },
35 { group: "extension", key: "maxVel", label: "strongest", kind: "number", default: 0.6, min: 0.05, max: 1, step: 0.01, hint: "strength of later extension notes at full speed" },
36 { group: "extension", key: "loudRef", label: "speed for full", kind: "number", default: 0.8, min: 0.05, max: 1, step: 0.01, hint: "bob speed (fraction of the fastest possible) that gives the strongest note" },
37 pick("loudCurve", { group: "extension" }),
38 pick("loudFloor", { group: "extension", default: 0.15 }),
39 pick("notesLevel", { group: "extension", default: 6, max: 18 }),
40 { group: "extension", key: "maxOverlap", label: "overlapping notes", kind: "number", default: 4, min: 1, max: 16, step: 1, hint: "most extension notes ringing at once (a new one replaces the oldest)" },
41 { group: "extension", key: "deviceLimit", label: "limit to device", kind: "bool", default: true, hint: "measure (once per device) how many ringing extension notes it can render, and allow no more" },
42 { group: "extension", key: "streamAudio", label: "render ahead", kind: "bool", default: true, hint: "render the instruments in background threads, ~1 s ahead (applies on the next play)" },
f7d91baAdd composition 4: crashJeremy Magland 43
1b2ce79crash: click (modal-synth Marimba, high and short) when the bob sweeps past the pivotJeremy Magland 44 // ── click: the outer bob sweeping past the pivot (within the minimum depth) ──
89519c1crash: extension notes when the arms are fully extendedJeremy Magland 45 { group: "click", key: "minDepth", label: "near the pivot", kind: "number", default: 0.25, min: 0, max: 0.95, step: 0.01, hint: "a click when the outer bob crosses the vertical within this distance of the pivot (fraction of the length)" },
1b2ce79crash: click (modal-synth Marimba, high and short) when the bob sweeps past the pivotJeremy Magland 46 { group: "click", key: "click", label: "click", kind: "bool", default: true, hint: "a click when the outer bob passes the pivot (closer than the minimum depth)" },
92338afcrash: viola click; height voice from modal-synth (glided with pitch bend)Jeremy Magland 47 { group: "click", key: "clickInstrument", label: "instrument", kind: "select", default: "modal: Viola", options: Object.keys(NOTE_INSTRUMENTS) },
48 { group: "click", key: "clickPitch", label: "pitch", kind: "number", default: 72, min: 24, max: 120, step: 0.5, unit: "midi" },
49 { group: "click", key: "clickLength", label: "length", kind: "number", default: 0.5, min: 0.01, max: 2, log: true, unit: "s" },
89519c1crash: extension notes when the arms are fully extendedJeremy Magland 50 { group: "click", key: "clickMaxVel", label: "strongest", kind: "number", default: 0.7, min: 0.05, max: 1, step: 0.01, hint: "strength at full bob speed (follows the speed like the extension notes)" },
92338afcrash: viola click; height voice from modal-synth (glided with pitch bend)Jeremy Magland 51 { group: "click", key: "clickLevel", label: "level", kind: "number", default: -4, min: -48, max: 6, step: 0.5, unit: "dB" },
1b2ce79crash: click (modal-synth Marimba, high and short) when the bob sweeps past the pivotJeremy Magland 52
1995755crash: piano notes at height levels instead of the gliding voiceJeremy Magland 53 // ── height notes: a short note each time the outer bob's height passes a level ──
54 { group: "height", key: "heightNotes", label: "height notes", kind: "bool", default: true, hint: "levels are the scale's notes between the low and high pitch (every `step`-th); passing one, up or down, plays it" },
55 { group: "height", key: "heightInstrument", label: "instrument", kind: "select", default: "modal: Piano-ish", options: Object.keys(NOTE_INSTRUMENTS) },
56 { group: "height", key: "heightLow", label: "pitch at bottom", kind: "number", default: 60, min: 24, max: 108, step: 0.5, unit: "midi", hint: "bob straight down" },
57 { group: "height", key: "heightHigh", label: "pitch at top", kind: "number", default: 96, min: 24, max: 120, step: 0.5, unit: "midi", hint: "bob straight up" },
58 pick("scale", { group: "height", default: "dorian" }),
59 pick("root", { group: "height" }),
60 { group: "height", key: "heightStep", label: "step", kind: "number", default: 2, min: 1, max: 7, step: 1, hint: "levels every this many scale notes (2 = arpeggio-like)" },
61 { group: "height", key: "heightLength", label: "length", kind: "number", default: 0.3, min: 0.05, max: 3, log: true, unit: "s" },
62 { group: "height", key: "heightVel", label: "strength", kind: "number", default: 0.7, min: 0.05, max: 1, step: 0.01 },
63 { group: "height", key: "heightLevel", label: "level", kind: "number", default: 6, min: -48, max: 18, step: 0.5, unit: "dB" },
64 { group: "height", key: "heightRamp", label: "ramp in", kind: "number", default: 6, min: 0, max: 60, step: 0.5, unit: "s", hint: "the notes grow to full strength over the opening" },
65 { group: "height", key: "heightRampFrom", label: "ramp from", kind: "number", default: 0.5, min: 0, max: 1, step: 0.01, hint: "starting strength, as a fraction of full" },
66 { group: "height", key: "heightFollow", label: "fades with energy", kind: "number", default: 0.3, min: 0, max: 2, step: 0.05, hint: "strength × (energy / start energy)^this" },
f7d91baAdd composition 4: crashJeremy Magland 67
68 // ── visual ──
69 { group: "visual", key: "trails", label: "trail", kind: "bool", default: true },
70 { group: "visual", key: "trailLength", label: "trail length", kind: "number", default: 2.5, min: 0.2, max: 20, log: true, unit: "s" },
89519c1crash: extension notes when the arms are fully extendedJeremy Magland 71 { group: "visual", key: "rings", label: "rings", kind: "bool", default: true, hint: "a brief ring where each extension note (and, smaller, each click) happens" },
73];