Skip to content

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:

  1. It restores the saved session, if the project has one.
  2. It binds the function definitions and use imports of the entry file.
  3. It calls fn setup(), if the entry file defines it.
  4. 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.

Terminal window
resonon run
resonon run scripts/bounce.non
resonon run --no-midi scripts/bounce.non

resonon 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:

Terminal window
resonon send
resonon send --code 'print(7);'
printf 'print(7);' | resonon send -
resonon send src/main.non --lines 4-8

These commands edit the running session incrementally. Use resonon save to save it.

In a file run
Preferences~/.resonon/preferences.toml, read once, when the run starts
Audio deviceThe one [audio] names, as live. With no device, a line says so and the run goes on; render() needs none.
MIDI portsThe declared [[midi.outputs]] and [[midi.inputs]]. None with --no-midi.
Plugin sweepIn the background, unless auto-scan is off
ServerNone
Visuals windowNone, unless the piece calls screen.show()
Scope windowNone, unless the piece calls scope_show()
StartThe 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
ScriptEvaluated after the top level of the entry file, if you name one
TransportPLAY, 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.
EndAfter 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.
RESETEnds the run there. What follows it does not run.

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.

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.