defnotmid

Projects / 08

odawg

A music engine for Odin. A song is data: sections, a style, an energy and chords. odawg composes it on synths, circuit-modelled drum machines and sampled instruments, routes it through buses and returns, plays it in real time from anywhere, and masters it.

  • Odin
  • MIT
  • Sampled CC0 sets
  • 808 · 909 · 303
  • Buses · returns · sidechains
  • 48 kHz · EBU R128
76 seconds of odawg at 60 fps, over onimite's disco song (a French touch track in B-flat minor at 126 BPM), played unchanged. Thirteen scenes walk through how it is made: the song as data in song.json, its form in bars, drum patterns as strings, the bass line, the filter's automation lane, the talk box as a graph of named nodes, layered synth and recorded instruments, sources pinned by SHA-256, every note in one table, the mix checked against each part's role band, and odawg render on the same file. odawg's demo/ at abc12b9, rendered by onimite v0.1.0. Samples, all CC0: Fashionbass and Emilyguitar by Karoryfer Samples, VS Chamber Orchestra 2: Community Edition and the Versilian Community Sample Library by Versilian Studios.

Hear it

Six songs, each from a spec, rendered and mastered by odawg alone. The first four are a few lines each and synthesized, every sound; the fifth plays sampled instruments, fetched the first time it was rendered; the sixth is a pop production written out part by part, routed through buses and a sidechain. The whole of the first one is under Use it.

  1. 01Booty house134 BPM · 808

    The 808 model plays the kit and, tuned, the sub in short stabs under the kick; an FMSynth chants through an echo.

    From examples/booty_house.json

  2. 02Chicago house124 BPM · 909

    A 909 four on the floor with swung hats and a jackin' rim, a rolling bass, organ stabs on the off-beats, piano at the peak.

    From examples/chicago_house.json

  3. 03Acid house125 BPM · 303 · 909

    Two 303-style lines squelching on accents and gliding on slides, over a 909 groove.

    From examples/acid_house.json

  4. 04One song, three styles84 → 124 → 70 BPM

    A lo-fi intro to talk over, a two-bar ramp from 84 to 124 BPM into a house drop, a lighter explanation, an ambient outro.

    From examples/explainer.json (WORKFLOWS.md W1)

  5. 05Lo-fi, played on samples78 BPM · sampled

    The lofi style on recorded instruments: a soft grand, a fingered jazz bass, a jazz kit through a stereo mic, and string sections in the second half.

    From examples/lofi_live.json

    Samples, all CC0: Osiris Piano, Virtuosity Drums and VS Chamber Orchestra 2 by Versilian Studios (the first two with Karoryfer Samples), Growlybass by Karoryfer Samples.

  6. 06Pop, produced116 BPM · A minor

    Every part written out: an 808 glued on a drum bus, a sub and a bass ducked by the kick, an upright piano through the verses, supersaw chords pumping under the drums' sound, a hook through a dotted-eighth echo, strings under the last chorus.

    From examples/pop.json

    Samples, CC0: the upright piano from the Versilian Community Sample Library, strings from VS Chamber Orchestra 2 by Versilian Studios.

48 kHz renders by odawg v0.0.42's render --master web, here as Opus at 150 kbit/s (MP3 where Opus doesn't play).

By the numbers

faster than real time
41–135×
the 58 s explainer, composed, rendered and mastered, in 0.43 s; booty house's 45 s in 0.37 s; acid house's 52 s in 1.3 s
samples differ by block size
0
a song streamed in 800-sample blocks, one 60 fps frame each, against the same song in one go
LUFS, mastered for streaming
-14
all six demos at -14.1 to -14.2 LUFS and -1.2 to -1.8 dBTP as served, Opus and MP3; podcast and broadcast (EBU R128) targets too
styles, written as data
7
ambient, house, lofi, synthwave, chicago_house, booty_house and acid_house, example files a song names by path; write your own the same way

Speed from odawg v0.0.42's render --master web (built -o:speed) on the four synthesized demos (2026-10-26, Ryzen 9 9900X3D, 24 threads, timed end to end, median of 3 after a discarded first run, mastering's measuring passes included); loudness and true peak (EBU R128) on all six files served here. The block test is test_blocks in render/render_test.odin, passing on v0.0.42; the styles are examples/styles/*.json.

What's in it

  1. 01Songs and styles as data

    Sections with a tempo or a ramp, a meter, a style, an energy and chords; parts that play step strings, sequences, chord degrees, arpeggios and chords. A style is a file: its parts and what each plays at each energy. Seven come as examples (examples/styles/*.json) to name by path or copy; a song can bring its own.

  2. 02Real instruments, sampled

    A Sampler plays CC0 sample sets (pianos, string sections, a bass, a jazz kit) from VCSL, VSCO 2, Karoryfer and others, each in a licence register with every file pinned by SHA-256. A set downloads the first time a song plays it, only the notes the song reaches load (every core decoding), and each plays at a synth preset's level.

  3. 03An 808, a 909 and a 303, from their circuits

    DrumMachine models the TR-808's and TR-909's circuits: bridged-T resonators, six square oscillators for the metal, the clap's bursts, and no two hits quite alike. AcidSynth is a TB-303-style voice: a diode-ladder squelch, accents that build on each other, slides that glide.

  4. 04Routing like a mixing desk

    A song is a graph: tracks into parts, parts into buses with their own effects, sends into shared returns (one reverb, however many send to it), a compressor keyed by another part's sound for the pump under the kick. Paths with lookahead line up where they meet, a return sleeps when nothing feeds it, and a loop is a finding, not a crash.

  5. 05Real time, exact, on every core

    The engine plays any block from anywhere, and the samples never depend on the block size; an exact seek chases the notes still sounding and runs each effect's tail in. An export is that stream in time segments across every core: the same spec and seed give the same samples.

  6. 06Mastered and measured

    A mastering target (streaming at -14 LUFS, podcast, broadcast) sets the loudness and a lookahead limiter holds true peaks at -1 dBTP; web is streaming's loudness under -2 dBTP, room for an Opus or MP3 encode's overshoot. Loudness, true peak and loudness range are measured as EBU R128 says. odawg inspect renders a song and reports peaks, clipping, silent parts and loudness.

  7. 07In Tone.js's vocabulary

    What someone who knows Tone.js reaches for is there: Synth, MonoSynth, FMSynth, AMSynth, MembraneSynth, MetalSynth, NoiseSynth and PluckSynth with Tone's options; reverb, delays, chorus, filters, distortion; notes as "C4", time as "8n.", "2m" or "2:1:0", tempo ramps as rampTo makes them. The names are Tone's; the engine is odawg's.

  8. 08Questions a picture can follow

    Where a section starts and how far through it a moment is, a pulse from the real kicks rather than from onsets, the time of every clap. onimite's song{} and sound{} are odawg: its videos' music and sound effects, cut to the picture.

  9. 09Data-oriented

    Layers as packages, each importing only those above it. Every instrument, effect, play pattern, check, mastering target and command is a table row naming its procs, the routing is two tables, and every note of a song is one flat table. An edit is a command row ("make the kick louder" is one), and what is measured of a song has rows only where it sounds.

Not yet

  • No GUI: songs are specs, in JSON or a host's tables, and the command line shows and checks them.
  • No plugin hosting.

Use it

{
  "name": "booty", "key": "G minor", "seed": 5,
  "sections": [
    { "name": "intro", "duration": "4m", "bpm": 134, "style": "styles/booty_house.json", "energy": 0.5, "chords": "Gm Gm Eb F" },
    { "name": "jack", "duration": "8m", "energy": 0.9 },
    { "name": "break", "duration": "2m", "energy": 0.3 },
    { "name": "peak", "duration": "8m", "energy": 1 }
  ]
}

The family