Transport
Transport statements control the global clock that drives both the MIDI scheduler and the audio engine. They are bare keywords (uppercase, terminated with ;), not function calls.
| Statement | Meaning |
|---|---|
PLAY; | Start or resume playback |
PAUSE; | Pause, keeping the playback position |
STOP; | Full stop: return to cycle 0, mute output |
RESET; | Full session reset: clear all state for a clean runtime |
RECORD; | Start playback and record on armed tracks |
SEEK <cycle>; | Jump to an absolute cycle |
use "std/instruments" { Sampler, Kit };
let drums = AudioTrack("drums");drums.load_instrument(Sampler(Kit("CR-78")));drums << [bd sd bd sd];
PLAY;SEEK 4;PAUSE;PLAY;STOP;Start or resume playback from the current position. Unmutes the master output after a prior STOP.
PLAY;Pause MIDI and audio playback without resetting anything — a following PLAY; resumes from the same position.
PAUSE;Full stop: pauses playback, returns the cycle counter to 0, stops any active recording, and mutes the master output. Recording tracks stay armed for another take. This is also the panic button — in VSCode it’s bound to Shift+F5. STOP; only affects the transport — your variables, tracks, and instruments are untouched (use RESET; for that).
STOP;Full session reset: clears all state — variables, patterns, audio tracks, instruments, effects, and modulations — leaving a clean runtime, as if you had just started. Execution halts immediately, so any code after RESET; does not run. In VSCode it’s bound to Ctrl+Shift+F5.
RESET;RECORD
Section titled “RECORD”Start playback (like PLAY;) and begin recording on all armed tracks. If no track is armed, it just starts playback. Tracks are prepared for recording with input() and arm() — see Track Methods: Recording.
vocals.input("mic").arm();RECORD;// ... perform ...STOP;vocals.save("take_01.wav");Jump to an absolute cycle. Takes any Number expression; think of cycles as bars.
SEEK 8; // jump to cycle 8SEEK 0; // back to the startSEEK 4 * 2; // any number expression worksTempo is a project setting, not a transport statement. project_bpm(bpm) sets the tempo in beats per minute; the optional second argument sets beats per cycle (default 4). At the default 120 BPM and 4 beats per cycle, one cycle lasts 2 seconds.
project_bpm(140);project_bpm(120, 3); // 3/4 feel: 3 beats per cycleSee Also
Section titled “See Also”- Track Methods — arming tracks, punch recording, saving takes
- Configuration — project settings including tempo
- CLI — offline rendering without the live transport