Live Coding vs Offline Rendering
There are two ways to run Resonon, and they suit different moments. Live coding keeps a session running and lets you shape it as it plays. Offline rendering runs a file from top to bottom as fast as your machine can manage and writes the result to disk. Same language, same patterns — a different relationship with time.
Live Coding
Section titled “Live Coding”This is everything the rest of this chapter describes. A server holds a persistent runtime; you connect from the VSCode extension or the REPL and send it code one piece at a time. Playback runs in real time, you drive it with the transport, and swaps land on the next cycle boundary so edits stay in time. The session remembers what you’ve run, so you grow a piece incrementally.
Use it to perform, to compose by ear, and to explore — anywhere the point is hearing changes as you make them.
Offline Rendering
Section titled “Offline Rendering”Run a .non file instead of a session, and Resonon evaluates it once, top to
bottom, then exits:
resonon song.non # run a file once and exitresonon run # run the project's src/main.nonThere’s no transport and no live editing — the file is the program. To get audio
out of it, call render(), which bounces your tracks
to WAV offline: the audio graph runs faster than real time, so a few cycles
finish in a fraction of their playback length.
use "std/instruments" { Sampler, Kit };
project_title("Sketch");
let drums = AudioTrack("drums");drums.load_instrument(Sampler(Kit("CR-78")));drums << [bd sd bd sd];
render(#[drums, master], 4); // four cycles → stems + a master mixdownThe render is deterministic and repeatable — the same file produces the same audio every time — which is exactly what you want when you’re capturing a finished loop to hand to a DAW or a collaborator. The full story is in Rendering.
Which One When
Section titled “Which One When”| Live coding | Offline rendering | |
|---|---|---|
| How you run it | Server + editor / REPL | resonon <file> / resonon run |
| Runtime | Persists across evaluations | Runs once, then exits |
| Time | Real time | Faster than real time |
| Transport | PLAY / STOP / … | None |
| Output | Sound from your speakers | WAV files on disk |
| Best for | Performing, composing by ear, exploring | Capturing a finished bounce |
The two aren’t rivals — they’re the start and the end of the same workflow. You’ll usually find a part live, then drop the same code into a file and render it when you’re happy.
Next Steps
Section titled “Next Steps”- Rendering —
render(), stems, and where files land - CLI Reference — running files and the REPL