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
| Module | What it holds |
|---|---|
device | A 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. |
dsp | The audio.js processors the devices are built on: dynamics models and gain curves, filter circuits, reverbs and shelves, under one dependency. |
kernels | The audio.js code each device runs in an AudioWorklet, in a string, since a worklet cannot import. |
time | Musical 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. |
analysis | Reading 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. |
pitch | Named scales: the pitch classes each keeps, the nearest pitch in one, and a scale as a piano roll reads it. |
midi | MIDI input as a source of notes, a raw message read, pitch bend in semitones. |
files | Files: audio decoded into samples, sound written to WAV, FLAC or MP3, notes from and to MIDI files, scores from and to MusicXML. |
playback | What 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. |
worklet | An 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.