~/content/01-architecture.mdโผ
No pages yet. In Files, use "Set as Page" on a markdown or HTML file.
Frontmatter
{
"title": "Architecture & Audio Pipeline",
"created": "2026-11-05T23:00:00Z",
"updated": "2026-11-05T23:00:00Z",
"slug": "architecture"
}Architecture & Audio Pipeline
Daw is built upon a 4-tier modular architecture designed for maximum performance, offline resilience, and seamless control by AI agents.
Architectural Layers
Pure Logic, Composition, Schemas & Codecs (
scdaw.js,scdaw-compose.js,scdaw-soundfont.js,scdaw-schema.js,scdaw-presets.js,scdaw-dsp.js,scdaw-midi.js,scdaw-dawproject.js,scdaw-zip.js,scdaw-signals.js):- Zero DOM or browser dependencies.
- High-level multi-bar arrangement compiler (
scdaw-compose.js) with multi-chord bar parsing (parseProgression), rest parsing (parseMotif), custom signature motifs (motifs: { bass, rhythm, lead }), and genre feel templates (e.g.,blues-rockeighth-note shuffle). - SoundFont 2 (SF2) RIFF parser, sample decoding, generator resolution, zone simplification, voice DSP (pitch-rate interpolation, linear ADSR, 3ms filter smoothing, pan), 128-instrument GM program map, and sample caching (
scdaw-soundfont.js). - Exact Pulses Per Quarter Note (
PPQN = 960) musical timebase math and 16th-note swing displacement. - Deterministic transaction reducers (
applyCommandsupporting note mutations, automation, audio clips, andmove_track/reorder_tracks) and undo snapshot history. - 16-bit, 24-bit PCM, and 32-bit Float RIFF WAVE binary encoders, pure-JS ZIP archive codec with CRC-32 integrity, SMF Format 0/1 MIDI codec, and DAWproject v1.0 XML/ZIP interchange.
- Microtask-batched reactive Signals for UI and engine state.
Web Audio Synthesis, Scheduling & Storage (
scdaw-engine.js,scdaw-instruments.js,scdaw-fs.js):- Non-blocking Web Worker clock tick (25ms) impervious to background tab throttling.
- Lookahead event scheduler buffering audio nodes 100ms in advance with gapless loop wrap-around.
- Polyphonic
Vaporisateurdual-oscillator synthesizers, procedural 12-drumPlayfieldsynthesizers, SoundFont 2 GM instrument engine (A320U.sf2,gm-lofi.sf2), and extended MIDI/Audio FX chains (equalizer, delay, reverb, bitcrusher, wavefolder, stereo tool, autotune, vocoder, maximizer limiter, transient shaper, guitar overdrive). - Dynamic audio node graph with track gain, stereo panning, real-time peak/RMS and mix analysis DSP (
analyzeAudioBuffer), master bus safety limiter, offline WAV/stem rendering, and direct OPFS conversation file persistence.
IPC Bridge & WebMCP Adapter (
scdaw-adapter.js):- Web Locks leader election ensuring exactly one document holds the AudioContext and replies to agent tool dispatches.
- Dual BroadcastChannel protocol (
scdaw-commands,scdaw-results) providing sub-millisecond local RPC between the ShadowClaw agent worker and workbench. scdaw-stateevent broadcasting keeping detached UI surfaces synchronized at 10 Hz.- Native ModelContext API registration for all 40
scdaw_*tools.
Mobile-First Web Component Workbench (
scdaw-element.js,components/scdaw-*.js):- 11 encapsulated Custom Elements (
<scdaw-workbench>,<scdaw-transport>,<scdaw-browser>,<scdaw-timeline>,<scdaw-editor>,<scdaw-sequencer>,<scdaw-devices>,<scdaw-mixer>,<scdaw-knob>,<scdaw-resize-handle>,<scdaw-statusbar>). - Mobile-first responsive CSS Container Queries (
@container),@mediagraceful degradation fallbacks, strict BEM naming, WCAG 2.1 AA ARIA landmarks, and Shadow DOM styling using--shadow-claw-*design tokens.
- 11 encapsulated Custom Elements (