/ music / double-pendulum
Sign in
music / double-pendulum
double-pendulum / src / compositions / lab / schema.ts
23 lines · 2.7 KBCodeBlameHistory
d8370f3Lab: the double pendulum as an instrument (#/lab/edit)Jeremy Magland 1import type { ParamSpec } from "../../core/params.ts";
2import { SIGNALS } from "../../lab/protocol.ts";
4export const schema: ParamSpec[] = [
5 { group: "play", key: "mode", label: "mode", kind: "select", default: "strike", options: ["strike", "sustain", "swell"], hint: "strike: start at the energy and ring down; sustain: energy held (like bowing); swell: energy rises, then rings down" },
6 { group: "play", key: "energy", label: "energy", kind: "number", default: 1, min: 0.001, max: 5, log: true, hint: "units of E_top (both arms up). Low: nearly periodic, two inharmonic modes. ~0.3–1.5: chaos. High: regular again (rotations)" },
7 { group: "play", key: "pitch", label: "pitch", kind: "number", default: 110, min: 5, max: 2000, log: true, unit: "Hz", hint: "the lower small-swing mode lands here (time scaling)" },
8 { group: "play", key: "ringTime", label: "ring time", kind: "number", default: 4, min: 0.05, max: 60, log: true, unit: "s", hint: "damping: amplitude falls 60 dB in this time (strike and swell)" },
9 { group: "play", key: "restrike", label: "restrike every", kind: "number", default: 5, min: 0, max: 60, step: 0.1, unit: "s", hint: "0 = strike once" },
10 { group: "play", key: "swellTime", label: "swell time", kind: "number", default: 2, min: 0.05, max: 30, log: true, unit: "s" },
11 { group: "play", key: "follow", label: "energy follow", kind: "number", default: 3, min: 0.2, max: 200, log: true, unit: "periods", hint: "sustain/swell: how quickly the energy controller corrects" },
13 { group: "sound", key: "left", label: "left signal", kind: "select", default: "x2", options: [...SIGNALS], hint: "x/y: bob position, v: velocity, θ: angles, ω: angular velocities, p: momenta" },
14 { group: "sound", key: "right", label: "right signal", kind: "select", default: "x1", options: [...SIGNALS] },
15 { group: "sound", key: "gain", label: "gain", kind: "number", default: -6, min: -40, max: 30, step: 0.5, unit: "dB", hint: "before a soft limiter (high gain = saturated)" },
16 { group: "sound", key: "dcCut", label: "low cut", kind: "number", default: 15, min: 1, max: 500, log: true, unit: "Hz", hint: "removes constant offsets and very slow drift" },
17 { group: "sound", key: "level", label: "level", kind: "number", default: -12, min: -48, max: 6, step: 0.5, unit: "dB" },
19 { group: "pendulum", key: "massRatio", label: "m2 / m1", kind: "number", default: 1, min: 0.05, max: 20, log: true },
20 { group: "pendulum", key: "lengthRatio", label: "l2 / l1", kind: "number", default: 1, min: 0.05, max: 20, log: true },
22 { group: "visual", key: "trailMs", label: "path length", kind: "number", default: 12, min: 1, max: 16, step: 0.5, unit: "ms", hint: "how much of the bob's recent path to draw" },
23];
↑↓ move↵openescclose