Live Workflow
Live coding in Resonon is a conversation with a running session. You start with a blank runtime and build it up: set up a track, load an instrument, send it a pattern, hit play. Then you keep going — swap the pattern, add a layer, tweak a parameter — and hear each change without ever stopping the music. This page is about that loop: how edits land in time, how the transport behaves, and how to keep an eye on what’s playing.
If your editor isn’t connected yet, set that up first in
VSCode Extension. Everything here works the same
from the editor’s Cmd+Enter or the REPL.
Building a Session
Section titled “Building a Session”Here’s a whole starting point — a track, an instrument, a beat, and playback:
use "std/instruments" { Sampler, Kit };
let drums = AudioTrack("drums");drums.load_instrument(Sampler(Kit("CR-78")));drums << [bd sd bd sd];
PLAY;The runtime remembers all of this. The next time you evaluate code, drums
still exists — you don’t redefine it, you talk to it. That persistence is the
whole point of the live workflow: you grow a piece one evaluation at a time
instead of re-running a file from scratch.
Quantized Swaps
Section titled “Quantized Swaps”Now change the beat. With the session still playing, evaluate a new pattern for the same track:
drums << [bd _ sd _, hh hh hh hh];You won’t hear the swap happen mid-bar. A new pattern takes effect at the next cycle boundary — the current cycle finishes, then the new one starts. This is what keeps live edits musical: you can evaluate whenever you like and trust that the change lands on the downbeat, in time, never halfway through a note.
Because the swap is quantized and the session persists, the everyday rhythm of
live coding is: tweak the line, evaluate, listen, repeat. Layer more tracks the
same way — each is just another AudioTrack you send patterns to.
Transport Controls
Section titled “Transport Controls”Transport is the session-wide play head. You can drive it from code or, in the editor, from the keyboard.
| Action | Code | Keybinding |
|---|---|---|
| Play | PLAY; | F5 |
| Pause | PAUSE; | F5 (toggle) |
| Stop | STOP; | Shift+F5 |
| Reset | RESET; | Ctrl+Shift+F5 |
PLAY; // resume playback from where the play head sitsPAUSE; // pause where you are — sound stops, position is keptSTOP; // stop, return to the start, mute the masterRESET; // wipe the whole session and start from a blank runtimeThe four differ in how much they tear down:
PLAYresumes playback. The play head picks up wherever it was paused, and cycle-based code is primed so it’s ready the instant the transport rolls.PAUSEstops playback but keeps your position, so the nextPLAYcontinues from the same spot. Sounding notes are released (all-notes-off) so nothing hangs.STOPis a harder stop: playback halts, the play head returns to the start, and the master output is muted. Your session — tracks, instruments, patterns — is untouched, soPLAYbrings it all back.RESETis the big one. It throws the entire session away — every variable, track, instrument, and effect — and gives you a fresh runtime. Reach for it when you want a clean slate, not when you just want silence.
Recording and Seeking
Section titled “Recording and Seeking”Two more transport commands cover deeper ground:
RECORD;resumes playback likePLAY, but also starts capturing audio on any armed tracks. With nothing armed it just plays. Arming tracks, choosing inputs, and pulling takes off disk are covered in Recording & Input.SEEK <expr>;jumps the play head to a cycle position —SEEK 16;moves to cycle 16. It comes into its own with timed arrangements; see Arrangements.
Watching the Session
Section titled “Watching the Session”While you play, you’ll want to see what’s going on — levels, routing, MIDI, plugin editors. Resonon gives you a few windows onto a running session.
Plugin editors. A third-party instrument or effect with a graphical editor
opens its own window with .show_gui() (and .hide_gui() to close it):
let synth = Instrument("Surge XT");let lead = AudioTrack("lead");lead.load_instrument(synth);
if synth.supports_gui() { synth.show_gui();}Built-in DSP effects have no GUI — you drive those with .params() and
param_set. See Plugins.
TUI views. From a terminal, resonon view <name> opens a text-mode panel
connected to a running server:
resonon view mixer # track levels and the masterresonon view routing # how audio and MIDI are wiredresonon view scope # an oscilloscope on the outputresonon view console # server output and shortcut hintsresonon view midi_monitor # live MIDI messagesIn the editor these are the same panels under the sidebar’s Views section. The mixer, routing, and scope views are also the quickest way to see a swap or a new layer take hold. For every option, see the CLI Reference.
Visuals. If your piece drives shaders, resonon visuals opens the browser
render page for the running server. The visuals system itself is covered in
Audioreactive Shaders.
Next Steps
Section titled “Next Steps”You can build, swap, and steer a session live. Next, share that session — or learn when to drop the live loop entirely and render to a file.
- Server & Collaboration — run a server others can join
- Live Coding vs Offline Rendering — the two ways to run Resonon, and when to use each