# Audio Lab — Dub Tape Deck Prompt

## Route: `/audio-lab`

### One-shot brief

Create a single-file browser-native audio workstation in the style of a vintage dub tape deck. The artifact must be a complete, playable 16-step sequencer with synthesized drum sounds and a dub chord stab, wrapped in a tactile, nocturnal visual design.

### Spec

- **Theme**: Dub tape deck — dark, amber-lit, reel-to-reel aesthetic with VU meters and tape flutter.
- **Voices (4 tracks minimum)**:
  1. Kick drum — 808-style synthesized kick with pitch sweep.
  2. Snare drum — noise body plus triangle oscillator for weight.
  3. Closed hi-hat — bandpass-filtered white noise with tight decay.
  4. Dub chord stab — three-oscillator minor chord (root, flat third, fifth) through a resonant low-pass filter with envelope shaping. Supports per-step octave selection (bass, mid, high).
- **Sequencer**: 16-step grid, 4 tracks visible as rows. Current step visibly advances. Steps toggle on click. Synth-track steps cycle through pitch levels on repeated clicks.
- **Transport**: Play/Stop with tape-stop effect (delay-time ramp down on stop). BPM knob (60–200, default 120). Swing/shuffle control.
- **Effects**: Tape-style delay with time (0–750ms) and feedback (0–85%) knobs. Filter cutoff and resonance knobs for the chord voice. Send level per track to the delay bus.
- **Mixer**: Per-track volume sliders, mute toggle, solo toggle (latched). Master volume knob.
- **Pattern memory**: Four save slots (A–D), persisted to localStorage, with load/clear controls.
- **Visuals**:
  - Canvas-animated tape reel that spins during playback.
  - Bouncing VU meter bars driven by step activity.
  - Knob controls with click-and-drag rotation (desktop + touch).
  - Dark brown/amber colour palette throughout (`#1a1614` base, `#e8943a` accent, `#c8a882` text).
  - Glowing active-step indicators and pulsing current-step highlight.
- **Audio engine**: Pure Web Audio API synthesis — no sample files, no external libraries. Noise buffers pre-generated and reused. Lookahead scheduler for tight step timing at any BPM.
- **Interaction**: AudioContext created/resumed on first user Play click. No autoplay. Touch-friendly with large tap targets for the step grid. Mobile layout stacks controls vertically and allows horizontal step-grid scroll.
- **Output**: Single `index.html` with all CSS, HTML, and JS inlined. No external dependencies.

### Quality bar

- Sound must respond within ~5ms of a step firing.
- The UI must feel immediately tactile — knobs drag, buttons depress, meters bounce.
- The tape reel must spin smoothly and stop with a visible deceleration.
- The tape-stop effect must be audible and satisfying.
- Mobile must remain playable with one hand — critical controls (play/stop, grid) reachable without scrolling.
- Pattern save and recall must survive page reloads.
