File Runs
resonon run opens the project without a window, evaluates an optional script in it, and exits.
It runs from any directory inside the project. It opens the project as Open does in the editor:
- It restores the saved session, if the project has one.
- It binds the function definitions and
useimports of the entry file. - It calls
fn setup(), if the entry file defines it. - It runs the rest of the top level of the entry file.
Then it evaluates the script, if you name one. The script path is relative to the working
directory. The names that the top level of the entry file defines are in scope in the script.
The entry file is src/main.non, or the file entry names under [package] in
resonon.toml. The options are in
Command Line. When each part of the entry file runs
is in The entry file’s lifecycle.
resonon runresonon run scripts/bounce.nonresonon run --no-midi scripts/bounce.nonresonon run does not connect to a live server. To evaluate the entry file in a live session, use
Run File Live. resonon send with no source sends it for the project in the working directory.
Run Selection Live from a shell with the same send command:
resonon sendresonon send --code 'print(7);'printf 'print(7);' | resonon send -resonon send src/main.non --lines 4-8These commands edit the running session incrementally. Use resonon save to save it.
What it opens
Section titled “What it opens”| In a file run | |
|---|---|
| Preferences | ~/.resonon/preferences.toml, read once, when the run starts |
| Audio device | The one [audio] names, as live. With no device, a line says so and the run goes on; render() needs none. |
| MIDI ports | The declared [[midi.outputs]] and [[midi.inputs]]. None with --no-midi. |
| Plugin sweep | In the background, unless auto-scan is off |
| Server | None |
| Visuals window | None, unless the piece calls screen.show() |
| Scope window | None, unless the piece calls scope_show() |
Start and end
Section titled “Start and end”| Start | The saved session, if the project has one (as resonon open), otherwise an empty one; transport stopped |
fn setup() | Called after the definitions and imports of the entry file, before the rest of its top level, if the file defines it |
| Script | Evaluated after the top level of the entry file, if you name one |
| Transport | PLAY, STOP and the other transport statements run as they do live |
sleep(s) | The piece plays for s seconds before the next statement. on_cycle callbacks fire and print() output appears while it does, as in a live session. |
| End | After the last statement of the script, or of the entry file when there is no script. Playback, recording and MIDI clock stop with it. The session closes and calls fn teardown(), if the entry file defines it. |
RESET | Ends the run there. What follows it does not run. |
What it writes
Section titled “What it writes”Nothing but what the piece asks for: audio where it calls render(), into the project’s
renders/ (Audio Files), and MIDI where it
calls midi_export(). print() goes to standard output, errors to standard error.
Exit status
Section titled “Exit status”See the shared exit-code contract. A project-open, parse, or runtime error fails the run. A missing project or entry file, a refused version pin, or an unreadable explicitly named script prevents the requested run.
Related
Section titled “Related”- Two Ways to Run a Piece — live and file runs
- Render a Project — writing WAV files
- Errors & Warnings — what an error prints