# Lab notes Experimental slides for testing and exploring, outside the recipe, at the end of the deck (after the recipe's slides): "Lab – orbits played by instruments" and "How the instruments are driven". Claude keeps these notes up to date. ## Orbits in phase space Moved here from the recipe: Title: Duffing Oscillator - orbits in phase space Handles all cases (conservative, damped, driven), always in 2D. Starts on a double well, undamped, driven at 490 Hz (f_0 = -220 Hz, alpha = 2e7, delta = 0, F = 5.6e4, Omega / 2 pi = 490 Hz), also the first preset. Left panel: Parameter selection including dropdowns: a presets dropdown (conservative, damped, and the driven presets) and sliders for f_0 (can be negative), alpha, delta (up to 200 here), F and Omega. Right panel: Phase space horizontal: displacement vertical: momentum per unit mass, \dot{x} = p/m Calculates and depicts orbits from a set of starting points, to show the structure of phase space. For a driven system, each is drawn after it settles, projected onto the plane. Click any point to start an orbit there and play it (driven: from drive phase 0). No hover highlighting. During play we will see the trajectory through phase space with a tail. Toggle trajectory speed in phase space (a) 1/100x (b) real time (same as audio) Optional live spectrogram of the sound (with an instrument, the instrument's sound); while it shows, the phase-space plot is shorter. ## Instruments The oscillator's sound u(t) (x over time at full speed, normalized) is sent through an instrument: a fixed linear, time-invariant filter h, mixed with the sound itself by the dry / wet setting w, y = (1 - w) u + w (h * u). Each filter is a sum of resonances (decaying sinusoids in h, peaks in |H(f)|), scaled so that |H| peaks at 1, and applied by convolution. Loudness normalization (a toggle, on by default; an automatic gain control boosting by at most 26 dB) and a limiter (untouched below 0.8, rounding off peaks above) are the only non-linear steps. Optionally (a toggle, off by default), a notch filter (Q = 30) removes the driving frequency before the instrument, leaving the oscillator's own response: subharmonics, the nonlinearity's harmonics, chaos. - Raw (default): the oscillator alone. - Wooden body: broad body resonances, 100 to 2500 Hz. - Metal plate: 96 inharmonic resonances, 100 to 4000 Hz, not tuned. - Marimba: bars on the chosen scale from |f_0|, each with partials at 1, 3.93 and 9.2 times its pitch. - Harp: strings on the chosen scale from |f_0|/2, each with six harmonics. The marimba and harp use a selectable scale (equal-tempered, from |f_0|): major pentatonic (default), minor pentatonic, major, natural minor, harmonic minor, blues, whole tone, chromatic. - Bell: church-bell partials of |f_0|. The dry / wet setting defaults to 0.95. A linear filter only reweights the frequencies in u, so a steady tone keeps its pitch; the instrument's character shows at onsets, glides and in chaos. The wooden body colors any pitch; the metal plate's many narrow, untuned resonances ring most with changing and chaotic sound; the tuned ones (marimba, harp, bell; 220 Hz when f_0 = 0) have narrow peaks and pass a steady tone only when it lands on a note. The second lab slide, "How the instruments are driven", explains this, with plots of each instrument's |H(f)|.