LabDAW

Engine

The engine: the audio logic behind audio/ui's interfaces, with no UI framework in it: devices as parameters, musical time and the look-ahead scheduler, levels and curves, MIDI input, scales and the clip player.

The engine holds what makes and times the sound: a device as named parameters and the tools an agent drives it with, musical time and the look-ahead scheduler a transport runs on, levels and the curves a panel draws, the page's MIDI input, named scales, and the clip player that plays an arrangement in an AudioWorklet. It runs on the main thread, in a worker or in a worklet, under any framework or none.

Each module is an item of the registry, copied into lib/engine/<module>/ and owned like any other file: npx shadcn@latest add @audio-ui/engine-time, then import { syncedSeconds } from "@/lib/engine/time". A component that needs a module installs it with itself, so a project holds only the modules it uses. It builds on audio.js where an atom does the job.

Modules

ModuleWhat it holds
deviceA device as a description: defineDevice, its state, apply with what each change did, the tools an agent drives it with, and its engine: the contracts an engine implements, the pieces engines are made of, and the checks that measure one.
dspThe audio.js processors the devices are built on: dynamics models and gain curves, filter circuits, reverbs and shelves, under one dependency.
kernelsThe audio.js code each device runs in an AudioWorklet, in a string, since a worklet cannot import.
timeMusical time: tempos and signatures, bars and beats, grid divisions, tempo-synced note values, warp markers, the metronome, and the look-ahead scheduler a transport clock runs on.
analysisReading a signal: levels in dB, a log-axis spectrum and its peaks, the curves of a filter, an equalizer and a compressor, waveform peaks, transients and auto-warp, and loudness, of a file and live.
pitchNamed scales: the pitch classes each keeps, the nearest pitch in one, and a scale as a piano roll reads it.
midiMIDI input as a source of notes, a raw message read, pitch bend in semitones.
filesFiles: audio decoded into samples, sound written to WAV, FLAC or MP3, notes from and to MIDI files, scores from and to MusicXML.
playbackWhat plays when: clips placed in frames, the transport on the audio clock, the clip player's processor, streamed recordings, and the mixer's pan law, solo and delay compensation.
workletAn AudioWorklet processor loaded into a context from its source, once per context.

Next

  • Guides: how an engine drives the components, output, the clock, synthesis, input and analysis.
  • Installation: the hooks, libraries and devices built on the engine, which you install and own.
Built by Ouest Labs, the source code is available on GitHub.
RSS