# LILA Extended Strudel Language & IDE Manual > Official reference for LILA extensions on Strudel 1.3.0: declarative 60fps preset banks (presets() + P.slider()), live performance controls (select(), pills(), toggle(), stepper(), slider().label().private(), @select/@pills/@toggle/@stepper, Auto-Sweep @slider LFOs, Public vs. Private /listen gating), 1-click Copy for strudel.cc vanilla export, 64-bit Aether HD procedural voices, track metadata, IDE shortcuts, and visual widgets. Canonical URL: https://www.lila.codes/docs ## Quickstart Example: Public Mode Switcher + Private Calibration Rig One public pills control switches all bound P.slider(...) faders at 60fps with zero phase reset on /listen while the internal filter and room faders stay private inside the creator Sandbox. ```js // @title Midnight Flow Console // @by LILA Manual // @genre Ambient Focus setCpm(40); // One public mode selector — switches all bound P.slider(...) faders at 60fps with zero audio reset const P = presets("flow", { flow: { label: "Flow", cutoff: 1100, room: 0.45 }, nap: { label: "Power Nap", cutoff: 520, room: 0.72 }, deep: { label: "Deep Focus", cutoff: 1850, room: 0.30 }, }, { ui: "pills", label: "Listening Mode", sliders: "private", }); // Private console faders — live-tweakable in Sandbox, hidden on /listen const cutoff = P.slider("cutoff", 300, 3200, 10, "Filter Cutoff"); const room = P.slider("room", 0, 0.9, 0.05, "Space Room"); $: note("/2") .s("lila_pad") .lpf(cutoff) .room(room) .gain(0.42); $: note("<[c4 ~ eb4 g4] [bb3 ~ d4 f4]>") .s("lila_kalimba") .room(room) .gain(0.36); ``` --- # Live Controls, 60fps Preset Banks & Modulators > Build 60fps click-free multi-mode consoles with presets() + P.slider(), standalone helpers (select(), pills(), toggle(), stepper(), slider()), portable // @ comment directives, Public vs. Private /listen gating, Auto-Sweep @slider LFOs, and 1-click Copy for strudel.cc vanilla export. Author rich multi-slider live performance rigs inside LILA with zero audio glitching on mode switches, hide internal calibration sliders from /listen listeners with a single option, and export pure strudel.cc JavaScript anytime in one click. ## 1. Declarative 60fps Preset Banks (`presets()` + `P.slider()`) Bind dozens of calibrated `slider()` parameters to a single public mode selector (`@select` dropdown or `@pills` bar) without centered-offset math or extra override toggles. When all reads of your preset bank go through `P.slider(...)`, switching modes updates every fader simultaneously at 60fps with zero script re-evaluation or audio phase reset. - **Syntax**: `const P = presets(initialKey, bankObject, { ui: "select" | "pills", label: "Mode", sliders: "private" | "public" });`. - **Mode display labels**: Include `label: "Human Name"` inside each mode entry (e.g. `VIBE_CODING: { label: "Vibe Coding", macro: 1.05, ... }`). - **Positional or options-object `P.slider(...)`**: Write `P.slider("macro", 0, 2, 0.01, "Master Macro")` or `P.slider("t.bass", { min: 0, max: 2, step: 0.02, label: "Trim: Bass" })`. Nested dot-paths (`"t.bass"`) read nested sub-objects cleanly. - **Per-slider visibility override**: Set `{ sliders: "private" }` on `presets(...)` to hide all bound sliders on `/listen`, then append `.public()` (or `.listen()`) on any single fader you still want to expose publicly. - **60fps click-free rule**: As long as every live read uses `P.slider(...)` (plus optional `.private()` / `.public()` / `.label()`), changing modes never glitches or restarts long-running LFO/entrainment phases. Reading `P.value("path")`, `P.get("path")`, or `P.key` still works cleanly when a switch genuinely changes non-slider code (`shouldReevaluate` falls back to hot re-eval automatically). | API / Option | Example | Behavior | | --- | --- | --- | | `presets(key, bank, opts)` | `const P = presets("flow", { flow: {...}, sleep: {...} }, { ui: "select", label: "Mode", sliders: "private" })` | Renders 1 mode control (`select` or `pills`) and recalls bound sliders on switch | | `P.slider(path, min, max, step, label?)` | `const cut = P.slider("t.cut", 200, 3200, 10, "Cutoff")` | Registers a real-time 60fps `slider` initialized from active preset dot-path | | `.private()` / `.public()` | `P.slider("macro", 0, 2, 0.01, "Depth").public()` | Overrides bank `sliders: "private"` for a single exposed fader | | `P.value(path)` / `P.key` | `const bankName = P.value("kit")` | Reads non-numeric preset metadata (triggers clean Strudel re-eval on switch) | ### Example: Multi-Parameter Night Console (`presets()` + Nested `P.slider()`) One public Listening Mode dropdown drives filter, atmosphere, and nested per-layer trims (`t.bass`, `t.pad`) at 60fps while keeping calibration faders private on /listen. ```js setCpm(32); const P = presets("focus", { focus: { label: "Deep Focus", cutoff: 1550, t: { bass: 0.72, pad: 0.42 } }, sketch: { label: "Sketch Flow", cutoff: 2400, t: { bass: 0.80, pad: 0.50 } }, nap: { label: "Power Nap", cutoff: 580, t: { bass: 0.55, pad: 0.34 } }, }, { ui: "select", label: "Listening Mode", sliders: "private", }); const cutoff = P.slider("cutoff", 260, 3600, 10, "Master Filter"); const trimBass = P.slider("t.bass", 0, 1.2, 0.02, "Trim: Bass"); const trimPad = P.slider("t.pad", 0, 1.2, 0.02, "Trim: Pad").public(); $: note("").s("lila_sub").lpf(cutoff).gain(trimBass); $: chord("").voicing().s("lila_pad").lpf(cutoff).room(0.55).gain(trimPad); ``` ## 2. Explicit Helper Functions (`select()`, `pills()`, `toggle()`, `stepper()`, `slider()`) Standalone self-documenting JS helpers that evaluate transparently to their active value while rendering interactive controls in both the Live Controls rack and inline CodeMirror widgets. - `select(defaultVal, optionsArray, label?)` — accepts values or `[value, "Display Label"]` pairs. - `pills(defaultVal, optionsArray, label?)` — renders 1-click mode buttons in Sandbox and `/listen`. - `toggle(defaultVal, label?)` — accepts `true`/`false` or `1`/`0`. - `stepper(defaultVal, min, max, step, label?)` — renders bounded `-` / `+` buttons. - Chain `.label("Name")`, `.private()`, or `.public()` on `slider(...)` or control helpers — or add trailing `// @private` / `| private` comments. ### Example: Helper Function Syntax (`pills`, `select`, `toggle`, `stepper`) Function-call helpers with optional [value, label] pairs and `.private()` chaining. ```js setCpm(30); const kit = pills("tr808", [["tr808", "TR-808"], ["tr909", "TR-909"]], "Drum Machine"); const mode = select("C2:minor", [["C2:minor", "Night Minor"], ["D2:dorian", "Liquid Dorian"]], "Key"); const arpOn = toggle(true, "Arp Layer"); const arpSteps = stepper(4, 2, 8, 1, "Arp Speed").private(); $: s("bd ~ [~ bd] ~, ~ sd ~ ~, hh*8").bank(kit).gain(0.8); $: arpOn ? n(run(arpSteps)).scale(mode).s("lila_pluck").lpf(1800).gain(0.45) : silence; ``` ## 3. Portable Comment Directives (`@select`, `@pills`, `@toggle`, `@stepper`) Prefer zero-runtime metadata? Annotate any top-level `const` primitive (`number`, `"string"`, or `boolean`) with a trailing `// @...` comment directive. The script stays 100% vanilla `strudel.cc`-valid JavaScript with no helper definitions needed. - **`@pills` (Segmented Mode Buttons)**: Ideal for 2–5 modes, sections, or intensities (`1`, `2`, `3` or `"flow"`, `"deep"`). - **`@select` (Dropdown Menu)**: Best when a control has 5+ options, scales, or long preset labels. - **`@toggle` (Boolean Switch)**: Switches layers or A/B paths (`true`/`false` or `1`/`0`). Follow with your control label (e.g. `// @toggle Rhythm` or `// @toggle Rhythm | private`). - **`@stepper` (`−` / `+` Step Control)**: Bounded integer or decimal increments (`min..max step S`), ideal for octaves or Euclidean pulse counts. - **Comma-separated display labels**: Write `value=Display Name` on any `@select` or `@pills` option so listeners see `"Deep Sleep"` while code keeps `0` or `"sleep"`. | Directive | Syntax Pattern | Default Visibility | Use Case | | --- | --- | --- | --- | | `@pills` | `const MODE = "day"; // @pills day=Day Flow, nap=Power Nap, night=Deep Sleep` | Public (`/listen` + Sandbox) | 2–5 instant mode/section buttons | | `@select` | `const MODE = 0; // @select 0=Vibe Coding, 1=Deep Debug, 2=Music Sketch, 3=Power Nap, 4=Deep Sleep \| label: Focus Mode` | Public (`/listen` + Sandbox) | Compact dropdown for 5+ modes or scales | | `@toggle` | `const DRUMS_ON = true; // @toggle Rhythm` | Public (`/listen` + Sandbox) | Ternary layer mute or switch | | `@stepper` | `const PULSES = 5; // @stepper 1..16 step 1 \| label: Euclidean Hits` | Public (`/listen` + Sandbox) | Discrete numeric steps without dragging | ### Example: Four Comment-Annotated Controls Together Dropdown, segmented pills, boolean toggle, and stepped Euclidean pulses driving one synth groove. ```js setCpm(31); const SCALE = "C3:minor"; // @select C3:minor=C Minor, D3:dorian=D Dorian, F3:phrygian=F Phrygian | label: Scale const VOICING = "warm"; // @pills warm=Warm Rhodes, bright=Acid Pluck | label: Lead Tone const HATS_ON = true; // @toggle Hi-Hats const PULSES = 5; // @stepper 1..12 step 1 | label: Kick Density $: s("bd").euclid(PULSES, 16).gain(0.85); $: HATS_ON ? s("hh*8").gain(0.28) : silence; $: n("0 2 4 [6 7]") .scale(SCALE) .s(VOICING === "bright" ? "lila_acid" : "lila_rhodes") .lpf(VOICING === "bright" ? 2200 : 1400) .room(0.4) .gain(0.5); ``` ## 4. Public `/listen` Exposure vs. Private Sandbox Controls (`sliders: "private"`, `.private()`, `@private`) By default, every control and `slider()` is `public` so listeners opening your creation on `/listen` or `/embed` can play with it. When your script has 20+ engineering or psychoacoustic calibration faders, hide internal controls so `/listen` listeners see ONLY your curated top-level mode switcher. - In a preset bank, pass `sliders: "private"` in `presets(..., { sliders: "private" })` to hide all `P.slider(...)` faders automatically on `/listen`. - Chain `.private()` on individual helpers or sliders (`slider(0.5, 0, 1, 0.01).label("Bias").private()`), or append `| private` / `// @private` in comments. - Listeners on `/listen` and `/embed` only see `public` controls; Sandbox creators still see a lock-badged `Private` shelf inside the sliders rack. - **Important AST rule for comment tags**: Hoist annotated sliders into top-level `const name = slider(...)` declarations if using trailing `// @label ... | private` comments. > **Flip visibility in 1 click inside the IDE**: Put your cursor on any control or slider line and press `Alt+Enter` -> "Hide from /listen (`@private`)" or click the eye/lock icon directly on the control pill in the Live Controls rack. ### Example: Public Mode Dropdown + Private Calibration Sliders Only the Entrainment Mode selector is public; the bank’s internal cutoff and gain sliders stay hidden on /listen via `sliders: "private"`. ```js setCpm(40); // PUBLIC listener control — visible on /listen; private calibration faders stay inside Sandbox const P = presets("vibe", { vibe: { label: "Vibe Coding", cutoff: 1500, gain: 0.48 }, debug: { label: "Heavy Debug", cutoff: 1950, gain: 0.45 }, sketch: { label: "Sketching", cutoff: 1200, gain: 0.52 }, nap: { label: "Power Nap", cutoff: 620, gain: 0.40 }, sleep: { label: "Deep Sleep", cutoff: 340, gain: 0.34 }, }, { ui: "select", label: "Entrainment Mode", sliders: "private", }); const effCutoff = P.slider("cutoff", 220, 3600, 10, "Master Cutoff"); const effGain = P.slider("gain", 0.1, 0.9, 0.01, "Pad Gain"); $: chord("").voicing().s("lila_pad").lpf(effCutoff).room(0.6).gain(effGain); $: note("c2 ~ g1 ~").s("lila_sub").gain(0.65); ``` ## 5. Continuous Sliders (`slider()`) & Auto-Sweep `@slider` LFOs Every `slider(val, min, max, step)` runs at 60fps in LILA without re-evaluating or clicking the audio graph. Toggle Auto-Sweep wave mode (`∿`) on any slider pill — or write a standard `.range(min, max).slow(cycles)` signal paired with a `// @slider` parked-value comment — to modulate smoothly with full `strudel.cc` compatibility. - **LFO Shapes**: `sine`, `cosine`, `tri`, `itri`, `saw`, `isaw`, `square`, `perlin`, `rand`. - **Cycle Rates**: `.slow(4)` for a 4-bar sweep, omit for 1 cycle, or `.fast(2)` / `.segment(16)` for stepped rhythmic modulation. - **Canonical Syntax**: `const cutoff = sine.range(320, 2800).slow(4); // @slider 1100 step 10 | label: Master Filter` (optional trailing `| private`). When turned back into a manual fader, LILA restores the parked manual fallback `1100`. - **Sandbox Toolbar Mix Helpers**: Pin (`P`) a fader so randomizers skip it, click `Mutate` for constrained variation around your active values, or store/recall snapshots in slots `M1–M3`. ### Example: Calibrated Filter Slider with Auto-Sweep `@slider` LFO The low-pass filter sweeps smoothly across 4 cycles between 320 Hz and 2800 Hz while retaining the parked manual value `1100`. ```js setCpm(31); const cutoff = sine.range(320, 2800).slow(4); // @slider 1100 step 10 | label: Master Filter const reso = slider(6, 1, 14, 0.5); // @label Filter Resonance $: note("c2 eb2 g2 bb2 c3 bb2 g2 eb2") .s("lila_acid") .lpf(cutoff) .lpq(reso) .gain(0.7); ``` ## 6. 1-Click "Copy for strudel.cc" Vanilla Export Want to share or archive a script built with LILA’s `presets()`, `P.slider()`, `select()`, `pills()`, `toggle()`, `stepper()`, `.label()`, or `.private()` extensions inside external vanilla `strudel.cc`? Click **Copy for strudel.cc** in the Sandbox **More** menu (or `Cmd+K` / `Ctrl+K` Command Palette). - **Zero LILA-only helpers**: Compiles every `presets(...)` declaration, `P.slider(...)` call, `select()` / `pills()` / `toggle()` / `stepper()` call, and `.label()` / `.private()` / `.public()` modifier chain out cleanly. - **Live State Baked In**: Active mode presets and any manually adjusted Sandbox slider values are baked directly into standard `slider(val, min, max, step)` calls so the exported script sounds identical in vanilla Strudel. - **Portable Comment Layer Preserved**: Standard `slider()` calls and Strudel patterns remain untouched and human-readable (no obfuscation or runtime wrappers). --- # Aether HD 64-Bit Voices & Drum Kits > Reference for LILA’s native 64-bit WebAssembly synth engine: canonical `lila_*` voices, `aether_*` compatibility aliases, multi-slot `lila_drums:0..4`, binaural/monaural psychoacoustic synthesis, and always-on procedural waveform routing. Aether HD runs inside LILA’s AudioWorklet with zero network sample fetching — ready instantaneously in both real-time playback and offline 64-bit WAV exports. ## 1. Complete `lila_*` Canonical Voice Catalog Pass any canonical `lila_*` sound inside `s("...")`. Standard Strudel waveforms (`sine`, `triangle`, `sawtooth`, `supersaw`, `square`, `pulse`, `pink`, `white`, `brown`, `binaural`, `monaural`) also route automatically to Aether HD with SuperDough DSP parity. | Canonical Sound | Display Name | Family | Aliases | Acoustic & DSP Profile | | --- | --- | --- | --- | --- | | `lila_808` | LILA 808 Master | bass | `aether_808` | Sustained 808/sub voice with dual-stage pitch drop, acoustic punch beater, and asymmetrical wavefolding drive | | `lila_acid` | LILA Acid | bass | `aether_acid` | Dedicated anti-aliased saw/pulse acid voice with a resonant oversampled ladder, filter envelope, accent, and deterministic monophonic glide | | `lila_moog` | LILA Moog 303 | bass | `aether_moog` | 4-Pole Zero-Delay Feedback (ZDF) Moog ladder filter with analog Padé drive and bass compensation | | `lila_sub` | LILA Sub Roller (Preview) | bass | `aether_sub` | Low-register preview routed through the Master808 engine; a distinct sub voicing is not implemented yet | | `lila_clap` | LILA Hand Clap | drums | `aether_clap` | Deterministic four-burst filtered-noise hand clap with an inharmonic body, velocity-sensitive air, bounded note retuning, and a calibrated tail | | `lila_drums` | LILA Drum Transient | drums | `aether_drums` | Procedural kick-punch transient layered with a sine oscillator; a multi-piece drum kit and membrane/shell model are not implemented yet | | `lila_hat` | LILA Metallic Hat | drums | `aether_hat` | Deterministic six-partial metallic/noise one-shot with velocity-sensitive brightness, bounded note retuning, filtered air, and a calibrated T60 tail | | `lila_kick` | LILA Club Kick | drums | `aether_kick` | Dedicated deterministic club-kick oscillator with tunable click, pitch drop, body, T60 decay, and bounded drive | | `lila_snare` | LILA Procedural Snare | drums | `aether_snare` | Deterministic four-mode shell with a short pitch dive, velocity-sensitive filtered wire noise, bounded note retuning, and a calibrated one-shot tail | | `lila_fm` | LILA Crystal DX Bell | keys | `aether_fm` | 6-Operator FM matrix with harmonic golden-ratio feedback | | `lila_piano` | LILA Concert Grand Piano | keys | `aether_piano` | Procedurally modeled felt-hammer transient + Karplus-Strong string with dispersion + Spruce soundboard modal bank | | `lila_rhodes` | LILA Neo-Soul Rhodes | keys | `aether_rhodes` | Procedural felt hammer + velocity-responsive decaying FM tine + warm cabinet body with gentle 5.2Hz stereo tremolo | | `lila_stab` | LILA Rave Stab | keys | `aether_stab` | Deterministic short rave-chord voice with an anti-aliased transient stack, pitch-tracked modal body, internal ladder-filter sweep, and quality-bounded 1/2/3 layers | | `lila_bell` | LILA Tibetan Singing Bowl | lead | `aether_bell` | High-Q inharmonic Tibetan singing-bowl modal resonator with suede-mallet onset and long harmonic sustain | | `lila_hoover` | LILA Hoover | lead | `aether_hoover` | Deterministic anti-aliased PWM/unison rave lead with two moving formant bands, mono-safe stereo spread, ladder filtering, and quality-bounded 2/4/6 oscillator lanes | | `lila_saw` | LILA PolyBLEP Sawtooth | lead | `aether_saw`, `aether_sawtooth` | 64-bit PolyBLEP anti-aliased sawtooth oscillator with zero-delay state-variable filtering and phase-continuous LFO sweeps | | `lila_square` | LILA PolyBLEP Square / Pulse | lead | `aether_square`, `aether_sqr`, `aether_pulse` | 64-bit PolyBLEP variable-pulse-width square oscillator with smooth PWM and phase-continuous legato | | `lila_supersaw` | LILA Supersaw | lead | `aether_supersaw` | Deterministic stereo anti-aliased supersaw with a softened bloom, slow drift, quality-bounded 3/5/7-voice unison, and an internal ladder-filter envelope | | `lila_triangle` | LILA PolyBLAMP Triangle | lead | `aether_triangle`, `aether_tri` | 64-bit PolyBLAMP anti-aliased triangle oscillator with phase-continuous legato and optional binaural/monaural entrainment | | `lila_vibes` | LILA Modal Vibraphone | lead | `aether_vibes` | 16-mode inharmonic metal bar bank with motor AM tremolo modulation | | `lila_kalimba` | LILA Wooden Kalimba | mallet | `aether_kalimba` | Composite pluck exciter + 16-mode African Calabash gourd resonator with nonlinear contact bite | | `lila_binaural` | LILA 64-Bit Binaural Entrainment | pad | `aether_binaural` | 64-bit phase-locked dichotic binaural beat generator (Left = f0 - Δf/2, Right = f0 + Δf/2) with zero stereo cross-bleed | | `lila_brown` | LILA Brown Noise (1/f²) | pad | `aether_brown` | Decorrelated stereo leaky-integrated 1/f² Brownian noise generator with sub-20 Hz DC blocking for deep ocean and womb-like beds | | `lila_monaural` | LILA 64-Bit Monaural Entrainment | pad | `aether_monaural` | 64-bit phase-coherent acoustic interference monaural beat generator (0.5 * (sin(f0 - Δf/2) + sin(f0 + Δf/2))) effective on both speakers and headphones | | `lila_pad` | LILA Celestial Wavetable Pad | pad | `aether_pad` | Warm fundamental-led stereo wavetable pad with bandlimited mipmaps, slow spectral morphing, and a gentle envelope | | `lila_pink` | LILA Pink Noise (1/f) | pad | `aether_pink` | Decorrelated stereo 7-pole Paul Kellet 1/f pink noise generator for psychoacoustic beds, rain, and resonant water substrates | | `lila_sine` | LILA Pure Sine | pad | `aether_sine`, `aether_sin` | 64-bit phase-coherent pure sine oscillator with phase-continuous legato drones and optional binaural/monaural/isochronic entrainment | | `lila_white` | LILA White Noise | pad | `aether_white` | Decorrelated stereo flat-spectrum white noise generator with per-voice LPF/HPF/BPF sculpting | | `lila_pluck` | LILA Acoustic Pluck | pluck | `aether_pluck` | Karplus-Strong physical modeling with 1st-order Thiran fractional allpass filter and pick noise | | `lila_strings` | LILA Chamber Strings (Preview) | strings | `aether_strings` | Preview chamber-string routing through the current plucked-waveguide engine; a distinct bowed model is not implemented yet | ### Example: Multi-Voice Aether HD Arrangement (Zero Sample Downloads) Combines LILA Warm Rhodes, Wooden Kalimba, 808 Sub, and physical-modeled Aether procedural kit slots. ```js setCpm(29); $: s("lila_drums:0 ~ [~ lila_drums:0] ~, ~ lila_drums:1 ~ ~, lila_drums:2*8").gain(0.78); $: note("").s("lila_808").lpf(420).gain(0.75); $: chord("").voicing().s("lila_rhodes").room(0.45).gain(0.42); $: n("0 [2 4] 6 ~").scale("C4:minor:pentatonic").s("lila_kalimba").delay(0.25).gain(0.48); ``` ## 2. Procedural `lila_drums:0..4` Kit Map & Waveforms Index `lila_drums` with `:n` mini-notation selectors for five matched physical/analog drums, or call `lila_kick`, `lila_snare`, `lila_hat`, `lila_clap` directly by name. | Selector | Standalone Equivalent | Drum Instrument | | --- | --- | --- | | `lila_drums:0` | `lila_kick` | Physical/analog punch kick | | `lila_drums:1` | `lila_snare` | Crisp resonant snare | | `lila_drums:2` | `lila_hat` | Metallic closed hi-hat | | `lila_drums:3` | `lila_clap` | Stereo layered handclap | | `lila_drums:4` | Open Hat | Open metallic hi-hat decay | > **Always-on Procedural Waveforms**: LILA automatically routes `sine`, `sin`, `triangle`, `tri`, `sawtooth`, `saw`, `supersaw`, `square`, `sqr`, `pulse`, `pink`, `white`, `brown`, `binaural`, `monaural` to 64-bit Aether Wasm unless WebAudio-only per-hap modulations (`fm`, `vib`, `vowel`, `crush`, `lpenv`) require SuperDough fallback. ## 3. Psychoacoustic Voices (`lila_binaural`, `lila_monaural`) & Modifiers Generate phase-locked binaural and monaural carrier beats at exact carrier frequencies with `.freq(...)` and beat offsets with `.binaural(hz)`, `.monaural(hz)`, and `.isochronic(hz)`. - **Binaural (`lila_binaural`)**: Requires stereo headphones; feeds `(carrier - beat/2)` left and `(carrier + beat/2)` right. - **Monaural (`lila_monaural`)**: Sums left and right acoustic waves in air so speaker listeners still experience beat modulation. - **Isochronic (`.isochronic(hz)`)**: Rhythmic amplitude-gated pulse at `hz` on top of any sustained pad or carrier. - **Brainwave Target Ranges**: Delta `0.5–4 Hz` (deep sleep), Theta `4–8 Hz` (power nap/meditation), Alpha-SMR `8–15 Hz` (calm focus), Beta `15–30 Hz` (analytical debugging), Gamma `32–42 Hz` (lucid peak binding). ### Example: Stereo 136.1 Hz Om Carrier + Alpha-SMR Binaural Entrainment A clean 136.1 Hz carrier paired with subtle harmonic warmth and an adjustable 10 Hz Alpha beat offset. ```js setCpm(30); const beatHz = slider(10, 1.5, 40, 0.5); // @label Brainwave Beat (Hz) $: freq(136.1) .s("lila_binaural") .binaural(beatHz) .gain(0.28); $: note("/2") .s("lila_pad") .lpf(720) .room(0.7) .gain(0.22); ``` --- # Track Metadata, `@scene` Chapters & Export Safety > Strudel.cc-compatible song header tags (`@title`, `@by`, `@genre`, `@album`, `@license`), multi-scene IDE Outline markers (`// @scene`), parallel tracks (`$:` / `_$:`), and LILA inspection suppression (`@strudel-ignore`, `mini-off`). Comment metadata turns plain code files into searchable creations with automatic title hydration, timeline outline breadcrumbs, and AI-aware scene preservation. ## 1. Song Header Metadata (`// @title`, `@by`, `@genre`, `@license`, `@tag`) Place comment metadata tags at the top of your script (in line `//` or block `/* */` comments). Sandbox automatically syncs `@title` with your creation title bar. | Comment Tag | Example | Effect in LILA | | --- | --- | --- | | `// @title ...` | `// @title Night Drive` | Sets creation title on cards, embeds & exports | | `// @by ...` | `// @by Ada Lovelace` | Credits composer/artist attribution | | `// @genre ...` | `// @genre Ambient Focus` | Feeds feed search, discovery & metadata panel | | `// @album ...` | `// @album Night Sessions` | Groups related creations cleanly | | `// @license ...` | `// @license CC-BY-4.0` | Embeds open attribution SPDX tag | | `// @details ...` | `// @details Wear stereo headphones` | Displays creator listening notes | | `// @url ...` | `// @url https://example.com` | Stores reference project URL | | `// @tag ...` | `// @tag binaural, focus` | Adds comma-separated discovery tags | ### Example: Complete Metadata Header + Parallel `$:` Tracks Named parallel tracks (`$drums:`, `$bass:`) and `_$` muted tracks alongside full header metadata. ```js // @title Harbor Rain Sketch // @by LILA Creator // @genre Lo-Fi Ambient // @license CC-BY-4.0 // @tag warm, rhodes, focus setCpm(28); $drums: s("bd ~ ~ bd, ~ sd ~ ~, hh*8?").gain(0.7); $chords: chord("").voicing().s("lila_rhodes").room(0.55).gain(0.42); _$sparkle: n("0 4 6").scale("Eb5:major").s("lila_kalimba").gain(0.32); ``` ## 2. Multi-Scene Timelines (`// @scene Name (8 bars)`) & Bundling Divide long live sets or multi-part compositions with `// @scene` headers. The IDE Structure & Outline drawer (`Alt+7`) jumps between scenes, and Multi-Scene Timeline lets Ask LILA edit individual scenes while marking unchanged scenes `// UNCHANGED`. - **Authoring Marker**: `// @scene Chorus Drop (8 bars)` appears immediately inside the IDE Outline tree and breadcrumbs. - **Named & Muted Tracks**: `$drums: ...`, `$bass: ...`, `$lead: ...` create parallel stacks without nested parentheses; `_$pad: ...` or `_$: ...` mutes a track non-destructively. - **Track Metadata Modal**: Open `More -> Track Metadata` (or `Alt+Enter`) to edit header tags visually without typing comments by hand. ## 3. Suppressing Validator Inspections (`@strudel-ignore`, `mini-off`) When intentionally crafting experimental polyrhythms or dynamic JS strings, suppress LILA’s static AST validator selectively on the line above or trailing the call. - `// @strudel-ignore ` — silences a single specific inspection on the next line (or omit `` to ignore any inspection on that line). - `// @strudel-ignore-file` — suppresses LILA advisory warnings across the whole script. - `// mini-off` — disables mini-notation bracket/rest linting on that specific line. ## 4. Live-Synced Validator & Quick-Fix Reference Generated directly from `STRUDEL_DIAGNOSTIC_DOCS`. Every diagnostic listed here offers a 1-click Quick Fix inside the editor (`Alt+Enter`). | Diagnostic Code | Issue | Why It Happens | Valid Fix | | --- | --- | --- | --- | | `STRUDEL_TEMPLATE_INTERPOLATION` | Template Literal Interpolation Unsupported in Strudel | Strudel’s mini-notation compiler pre-parses pattern strings before normal JavaScript executes. Interpolation expressions like `${density}` inside backticks cannot be lowered reliably by `@strudel/transpiler`. | `const n = 4 s("bd*" + n + " sd")` | | `STRUDEL_BACKTICK_STRING` | Backtick String Instead of Double Quotes | While static backtick strings work in some environments, Strudel conventions and AST rewrite passes expect canonical double quotes `"..."` for mini-notation. | `note("c3 eb3 g3")` | | `STRUDEL_SINGLE_QUOTE_CHAIN` | Method Chained on Single-Quoted String | `@strudel/transpiler` only wraps double-quoted strings (`"..."`) into `mini(...)` Pattern objects. Single-quoted `'...'` remains a plain JS `string`, so calling `.note()` or `.s()` on it throws `TypeError: is not a function`. | `"c3 eb3 g3".note().s("piano")` | | `STRUDEL_SINGLE_QUOTE_MINI` | Single Quotes Inside Pattern Function | Canonical Strudel idiom uses double quotes `"..."` for mini-notation patterns. Consistent double quotes avoid surprises when chaining or copying fragments. | `s("bd*4 [sd cp]")` | | `STRUDEL_EMPTY_MINI_STRING` | Empty Mini-Notation Pattern String | Passing `""` or whitespace-only `" "` into `s()`, `note()`, or `chord()` causes Strudel’s mini-notation parser to throw a syntax error at runtime. | `s("~")` | | `STRUDEL_UNBALANCED_MINI_BRACKETS` | Unbalanced Mini-Notation Delimiters | Every `[...]`, `<...>`, `{...}`, or Euclidean `(...)` inside mini-notation must open and close cleanly. A missing or mismatched bracket crashes the whole song evaluation. | `s("bd [hh oh cp]")` | | `STRUDEL_HALLUCINATED_METHOD` | Non-Strudel Method Name (AI / Tone.js Hallucination) | General-purpose LLMs often invent Tone.js, Sonic Pi, or WebAudio method names (like `.reverb()`, `.volume()`, `.lowpass()`, `.adsr()`, `.play()`) that do not exist on Strudel `Pattern`. | `s("sawtooth").lpf(900).room(0.4).gain(0.8)` | | `STRUDEL_UNKNOWN_PATTERN_METHOD` | Unrecognized Strudel Pattern Method | This method name is not part of the qualified Strudel 1.3.0 runtime method list and will likely throw at runtime. | `note("c3 g3").gain(0.8)` | | `STRUDEL_HALLUCINATED_FUNCTION` | Unknown Top-Level Strudel Function | Strudel sets tempo with `setCpm(bpm / 4)` or `setCps(cps)`, selects sounds with `s("...")`, and layers with `stack(...)` rather than `setBpm()`, `sample()`, or `parallel()`. | `setCpm(128/4) stack(s("bd"), note("c2 g2"))` | | `STRUDEL_HALLUCINATED_SOUND` | Unregistered Sound / AI Synth Alias | Friendly AI descriptions like `"acid_bass"`, `"warm_pad"`, or `"epiano"` are not built into Strudel’s default sample map. LILA Aether HD provides dedicated high-definition procedural voices under `lila_*`. | `note("c2 eb2").s("lila_acid")` | | `STRUDEL_CHORD_MISSING_VOICING` | chord() Pattern Missing .voicing() | `chord("Cm7 Abmaj7")` produces abstract chord-symbol values, not playable notes. Without `.voicing()`, sending those symbols straight to `.s("lila_rhodes")` produces silence or default pitch. | `chord("").voicing().s("lila_rhodes")` | | `STRUDEL_CLIPPING_GAIN` | Excessive .gain() May Clip Master Output | Values above `2.0` multiply digital amplitude far beyond unity (`1.0`), pushing multiple stacked layers into harsh hard-clipping. | `s("lila_kick*4").gain(0.92)` | | `STRUDEL_OUT_OF_KEY_NOTES` | Notes Outside Active Document Scale | The file defines an active key (`.scale("C:minor")`), and one or more literal note pitches inside `note("...")` fall outside that scale. | `note("c3 eb3 f3 g3").scale("C:minor")` | | `STRUDEL_UNSUPPORTED_JS_CONSTRUCT` | Unavailable Browser / Module Construct | LILA executes Strudel inside an isolated browser sandbox: ES module `import`/`export`, `window`/`document` DOM access, `fetch()`, and Tone.js globals are unavailable in the audio evaluation scope. | `s("bd").ply(4)` | | `STRUDEL_SILENT_NORMALIZED_LPF` | Filter Cutoff Below 20 Hz (Likely Normalized 0..1 Mistake) | Many synths take filter cutoff as `0..1`, but Strudel `.lpf(hz)` and `.hpf(hz)` expect frequencies in **Hertz** (`20–20000`). Passing `.lpf(0.5)` sets a 0.5 Hz low-pass filter, silencing all audible audio. | `note("c2 eb2").s("lila_acid").lpf(2100)` | | `STRUDEL_ZERO_TIME_FACTOR` | Zero Speed Factor Freezes Pattern Cycle | Calling `.fast(0)` or `.slow(0)` multiplies cycle rate or duration by zero, preventing Strudel from advancing pattern queries. | `s("hh*8").fast(1)` | | `STRUDEL_DUPLICATE_CHAIN_METHOD` | Overwritten Single-Value Method in Same Chain | In Strudel control chains, chaining the same control twice at the same chain depth causes the second call to silently overwrite the first (outside `.every(4, x => ...)` callbacks). | `s("hh*8").room(0.2).gain(0.4)` | | `STRUDEL_ORPHAN_DUCKORBIT` | Sidechain .duckorbit(N) Has No Matching .orbit(N) Target | `.duckorbit(2)` ducks audio routed to Orbit Bus `2`. If no bass, chord, or pad layer has `.orbit(2)`, your kick triggers sidechain compression against an empty bus. | `stack(s("bd*4").duckorbit(2), note("c2").s("lila_808").orbit(2))` | | `STRUDEL_NEGATIVE_PAN` | Negative Stereo Pan Outside Strudel 0..1 Range | WebAudio `StereoPannerNode` uses `-1..1`, whereas Strudel `.pan(pos)` maps `0` = hard left, `0.5` = center, and `1` = hard right. | `s("hh*8").pan(0.25)` | | `STRUDEL_DUPLICATE_TEMPO` | Overwritten Top-Level Tempo Call | Calling `setCpm()` or `setCps()` multiple times at top level causes only the final tempo assignment to take effect. | `setCpm(140/4)` | | `STRUDEL_MULTI_ARG_MINI_CALL` | Extra Comma Arguments Ignored in Mini-Notation Call | `s()`, `note()`, and `n()` accept a single mini-notation string argument. Extra comma-separated strings like `note("c3", "eb3", "g3")` are ignored at runtime. | `note("c3 eb3 g3").s("piano")` | | `STRUDEL_INVALID_EUCLID_ARGS` | Out-of-Range Euclidean Pulses or Steps | Euclidean rhythms require step count `n` between `1` and `64` and pulse count `k <= n`. Out-of-bounds values can cause runaway pattern expansion or invalid rhythms at runtime. | `s("bd(8,8)")` | | `STRUDEL_UNLABELED_MULTI_STATEMENT` | Multiple Bare Patterns (Earlier Ones Silently Ignored) | JavaScript evaluates each top-level statement in order and only returns the **final** expression. Writing two bare patterns (`s("bd*4")` followed by `s("hh*8")`) without `stack(...)` or `$:` labels causes Strudel to drop all earlier layers silently. | `$: s("bd*4") $: s("hh*8")` | | `STRUDEL_UNAPPROVED_TRACK_LABEL` | Unapproved Track Label Prefix | Strudel only recognizes parallel track labels prefixed with `$` (`$:`, `$drums:`, `$bass:`), `d1:`–`d16:`, or mute prefixes `_$:` / `_:`. A bare JS label like `drums:` is treated as a JS label and does not play as a parallel track. | `$drums: s("bd*4")` | | `STRUDEL_SIGNAL_WITHOUT_RANGE` | Unscaled Continuous Signal in Filter Cutoff (0..1 Hz) | Strudel signals (`sine`, `saw`, `tri`, `perlin`, `rand`) output normalized values between `0` and `1`. Passing `.lpf(sine)` without `.range(min, max)` sweeps your low-pass filter between `0 Hz` and `1 Hz`, completely silencing all audio. | `note("c2 eb2 g2").s("sawtooth").lpf(sine.range(300, 2400).slow(4))` | | `STRUDEL_TIDAL_CHORD_QUOTE_QUIRK` | TidalCycles Single-Quote Chord Notation Inside note() | TidalCycles uses quotes inside strings like `"c3'maj7"`, whereas Strudel expresses simultaneous chords with bracket notation `"[c3,e3,g3,b3]"` inside `note()` or named chord symbols inside `chord("Cmaj7").voicing()`. | `note("[c3,e3,g3,b3] [eb3,gb3,bb3,db4]").s("piano")` | | `STRUDEL_MINI_SYNTAX_QUIRK` | Mini-Notation Syntax Error Inside Pattern String | Strudel parses double-quoted pattern strings using `@strudel/mini`, which often emits cryptic `[mini] parse error` messages at runtime without showing the exact column. Common culprits are dangling `*`/`/` operators, `*0`/`/0`, empty `[]` groups, or `//` comments typed inside quotes. | `s("bd hh ~")` | | `STRUDEL_N_SYNTH_WITHOUT_SCALE` | Scale-Degree n() With Synth Voice Missing .scale() | `n("0 2 4")` selects scale degree indices, whereas `.s("sawtooth")` or `.s("lila_rhodes")` synthesizes pitched tones. Without `.scale("C3:minor")` on the pattern or file, Strudel interprets `0 2 4` as raw unscaled indices rather than tonal scale degrees. | `n("0 2 4 7").scale("C3:minor").s("sawtooth")` | | `STRUDEL_RUNAWAY_FEEDBACK` | Runaway Delay Feedback or Extreme Reverb Tail | Setting `.delayfb(1)` or `>= 0.99` causes delay echoes to accumulate endlessly and clip audio output, while `.room()` or `.size()` values above `1.5` push the reverb feedback matrix into muddy self-saturation. | `note("c3 eb3").s("lila_rhodes").delay(0.5).delayfb(0.65)` | | `STRUDEL_EXTREME_DENSITY` | Extreme Event Subdivision / CPU Spike Risk | High cycle multipliers like `.fast(64)`, `.ply(32)`, or `"hh*64"` schedule dozens of simultaneous WebAudio/Wasm events per step, causing UI audio dropouts, voice stealing, and glitching. | `s("hh*8").ply(2)` | | `STRUDEL_UNUSED_CONST_PATTERN` | Declared Pattern Variable Never Routed to Playback | Top-level bindings like `const lead = note("c4 eb4")` define a pattern in memory, but Strudel only plays expressions included in the final `stack(...)` or labeled with `$:`. | `const bass = note("c2 g2").s("sawtooth") $: s("bd*4") $: bass` | | `STRUDEL_SUB_BASS_MUD` | Excessive Reverb or Stereo Width on Sub-Bass | Long `.room()` tails (`> 0.3`) or stereo `.jux()` splits on `lila_sub`, `lila_808`, or sub-octave bass notes cause low-end phase cancellation and muddy mixes on speakers and clubs. | `note("c1 ~ eb1 ~").s("lila_808").room(0.08)` | | `STRUDEL_UNUSED_LIVE_CONTROL` | Declared Live Control Never Referenced in Code | Interactive controls (`slider()`, `select()`, `pills()`, `toggle()`, `stepper()`) render widgets above the pattern, but they have no sonic effect until you pass their variable into a parameter like `.lpf(cutoff)`. | `const cutoff = slider(1200, 200, 4000, 20) $: note("c3 eb3").s("lila_saw").lpf(cutoff)` | | `STRUDEL_INVALID_CHORD_SYMBOL` | Unrecognized Chord Symbol in chord() | Strudel’s `.voicing()` dictionary parses standard jazz/pop chord suffixes like `Cmaj7`, `Fm9`, `G7alt`, or `Bm7b5`. Misspelled suffixes like `Cma7` or `Amn7` fail silently or drop notes. | `chord("Cmaj7 Am7").voicing().s("piano")` | --- # IDE Intellisense, `Alt+Enter` Actions & Shortcuts > Every productivity shortcut in LILA’s CodeMirror 6 Strudel IDE: context-aware `// @` snippet Intellisense, `Alt+Enter` one-key conversions and AI upgrades, Live Templates (`Tab` stops), Mini-Notation autocomplete, and the `F1` Guide. Write live controls and complex Strudel patterns at the speed of thought using JetBrains-inspired intentions, smart `// @` comment completions, and 1-click Gemini 4 Neon upgrades. ## 1. Smart `// @` & Pipe `|` Directive Intellisense Type `// @` (or `| `) on any line in the Strudel editor to trigger context-aware autocomplete with `Tab` placeholders tailored to whatever code sits left of `//`. - **Smart Context Boosting**: On `const MODE = "day"; // @`, `@pills` and `@select` float to the top with matching option placeholders. On `const ENABLED = true; // @`, `@toggle` ranks first. On `const CUTOFF = slider(...); // @`, `@slider` and `@label` rank first. - **Pipe Modifiers**: Inside an existing directive comment, type `| ` to autocomplete `| private` (hide on `/listen`), `| public`, or `| label: My Control`. - **Live Hover & Quick Docs (`Cmd/Ctrl+Shift+Space`)**: Hover or press Quick Docs over any `@select`, `@pills`, `@toggle`, `@stepper`, `@slider`, `@label`, `@private`, `@scene`, or header tag to read its syntax card and open its `/docs` chapter. ## 2. `Alt+Enter` Musical Intentions & Live Control Conversions Place the cursor on any candidate constant, `slider()`, control directive, or pattern line and press `Alt+Enter` (`Option+Enter` on macOS) for context-aware zero-boilerplate refactors. | Cursor Line Context | Available `Alt+Enter` Action | What It Writes / Opens | | --- | --- | --- | | Candidate `const X = ...` | Convert `X` to `@select` / `@pills` / `@toggle` / `@stepper` | Appends matching directive comment or opens Visual Control Builder | | Any existing control / `slider()` | Expose on `/listen` (`@public`) ↔ Hide (`@private`) | Cleanly adds or removes `\| private` on that line’s directive | | Any `slider()` line | Enable Auto-Sweep LFO (`sine, 4c`) / Disable LFO | Toggles `@lfo(...) @parked(...)` modulation automatically | | Any script | Ask LILA AI: Upgrade with Live Controls / Public Preset Switcher / Prep for `/listen` | Populates Gemini 4 Neon Assistant drawer with an architectural upgrade brief | | `note("...")` / `chord("...")` | Add `.voicing()`, Snap Notes to Scale, Rotate Steps, Mute/Solo | Instant AST musical refactoring without manual cursor juggling | ## 3. Live Templates (`Tab` Stops) & Core Keymap Type any Live Template keyword in the editor and press `Tab` or `Enter` to stamp out pre-wired controls, preset rigs, or rhythmic templates with jumpable placeholders. | Trigger / Shortcut | Action | Inserted Output / Behavior | | --- | --- | --- | | `ctrl-select` | Live Control Dropdown Template | `const MODE = "flow"; // @select ... \| label: Mode` | | `ctrl-pills` | Segmented Pills Mode Switcher | `const SECTION = "main"; // @pills ...` | | `ctrl-toggle` | Boolean Toggle Switch Template | `const LAYER_ON = true; // @toggle On, Off \| label: ...` | | `ctrl-stepper` | Numeric Stepper Template | `const DENSITY = 4; // @stepper 1..16, 1 \| label: ...` | | `ctrl-lfo` | Auto-Sweep `@slider` LFO Template | `const cutoff = slider(...); // @slider ... \| @lfo(...)` | | `ctrl-preset-rig` | Public Preset Mode + Private Rig Skeleton | Creates public `MODE` dropdown, private `MANUAL_CONSOLE` toggle, and `preset()` router | | `Ctrl+Enter` / `Cmd+Enter` | Evaluate / Update Live Code | Applies code live without glitching phase | | `Ctrl+Space` | Trigger Smart Autocomplete | Suggests Strudel methods, mini-notation, sounds, `// @` directives & templates | | `Cmd/Ctrl+Shift+Space` | Quick Docs Popup | Pinned documentation card with `/docs` manual links | | `F1` | IDE Guide & Keymap Modal | Searchable cheat sheet for shortcuts, syntax & rules | | `Alt+7` | Structure & `@scene` Outline | Shows scenes, sliders, controls & layers | --- # Pattern Visualizers, Pitch Widgets & Export > Chain inline canvas visualizers directly onto any Strudel pattern (`_pianoroll`, `_punchcard`, `_spiral`, `_pitchwheel`, `_wordfall`, `_scope`, `_fscope`, `_spectrum`) and export studio-clean master or multi-stem WAV mixes. Leading-underscore visual methods render crisp live HUD feedback synchronized to exact cycle phase while staying 100% compatible with strudel.cc. ## 1. Supported Inline & Global Visual Widgets Call `._method()` at the end of a pattern (renders inside the canvas/code HUD) or `.method()` for full-panel canvas modes. | Method | Visual Output | Best Paired With | | --- | --- | --- | | `._pianoroll({ labels: 1 })` | Scrolling DAW piano-roll grid | Melodies, chords, basslines | | `._punchcard({ cycles: 4 })` | Multi-cycle rhythmic timeline cards | Drums, polylayer stacks | | `._spiral()` | Polar radial cycle spiral | Polyrhythms & Euclidean beats | | `._pitchwheel()` | Chromatic 12-tone harmonic wheel | `.scale(...)` & chord voicings | | `._wordfall()` | Cascading text/note event waterfall | Sample chops & `word` vocals | | `._scope()` | Time-domain stereo oscilloscope | Bass, waveshaping & FM synths | | `._fscope()` | Frequency spectrum / FFT trace | Filters & harmonic resonance | | `._spectrum()` | Vertical spectral bar analyzer | Full mixes & master EQ checks | ### Example: Piano Roll + Spectrum + Scope Stack A self-visualizing groove with an inline piano roll on the harmony and oscilloscope on the sub bass. ```js setCpm(30); $: s("bd ~ [~ bd] ~, ~ sd ~ ~, hh*8").gain(0.75); $: note("") .s("lila_808") .lpf(600) .gain(0.72) ._scope(); $: chord("") .voicing() .s("lila_rhodes") .room(0.45) .gain(0.42) ._pianoroll({ labels: 1 }); ``` ## 2. Offline 64-Bit Master & Stem WAV Export Even at 0 Sparks and offline from AI endpoints, Sandbox `More -> Audio & Export` bakes up to 120 seconds of deterministic stereo 64-bit Aether + SuperDough WAV audio locally in your browser. - Honors all active public/private control values AND `@slider` Auto-Sweep LFO automations deterministically. - Exports either a unified Master Stereo WAV or split instrument Stems (Drums, Bass, Chords, Leads, Spatial) routed by each voice’s `defaultStem`.