// Shared between the lab page and the pendulum-voice worklet. export const SIGNALS = ["x2", "y2", "vx2", "vy2", "x1", "vx1", "θ1", "θ2", "θ2−θ1", "ω1", "ω2", "p1", "p2", "speed2"] as const; export type Signal = (typeof SIGNALS)[number]; export interface LabSettings { mode: "strike" | "sustain" | "swell"; pitch: number; // Hz of the lower small-swing mode energy: number; // normalized (E / E_top) ringTime: number; // s (audio): amplitude falls 60 dB, without the energy controller restrike: number; // s between strikes / swells (0 = once) swellTime: number; // s massRatio: number; lengthRatio: number; left: Signal; right: Signal; gain: number; // linear dcCut: number; // Hz follow: number; // sustain/swell: energy controller time constant, in periods of the lower mode } export type LabMsg = { type: "settings"; s: LabSettings } | { type: "strike" }; export interface LabSnap { type: "snap"; energy: number; phase: string; trail: Float32Array; // recent bob positions [x1, y1, x2, y2, …] (pendulum units) k: number; // sim seconds per audio second }