Skip to content

VSCode Extension

The extension evaluates code on a resonon server and bundles the language server. A walk-through is Live Coding Workflow.

KeyCommandActive when
Cmd+Enter (Ctrl+Enter on Windows and Linux)Evaluate Selection or LineA resonon editor has focus
F5Play / PauseA resonon file is open
Shift+F5Stop. Three in a row cut everything still soundingA resonon file is open
Ctrl+Shift+F5ResetA resonon file is open

What each transport command does: Transport.

Every command is in the command palette, prefixed RESONON:.

CommandWhat it does
Evaluate Selection or LineRuns the selection, or the line the cursor is on. Connects first if needed.
Evaluate FileRuns the whole file in the live session, adding to what it holds. It is not a file run: nothing exits, and the session stays.
Play / PausePLAY when stopped or paused, PAUSE when playing.
StopSTOP.
ResetRESET: discards the session.

Both evaluate commands are also in the editor’s title bar.

CommandWhat it does
Connect to ServerConnects to the active server; with several known, offers a list; with none known, starts a local one.
Disconnect from ServerDisconnects from the active server.
Start ServerStarts a local server and connects to it.
Stop ServerStops the active server.
Add Server…Adds a server by host and port.
Refresh ServersRefreshes the Servers view.
Connect to Server…Connects to the server clicked in the Servers view.
DisconnectDisconnects from the server clicked in the Servers view.
Set as Active ServerMakes a connected server the one evaluations go to.
Stop Server ProcessStops a server this window started.
Remove ServerRemoves a server added by hand.
Set Display NameSets the name other clients see for you.
Toggle Output Filter (Own / All)Shows only your own output, or every client’s.
CommandWhat it does
Open ConsoleServer output, in a terminal.
Open MixerTrack levels, in a terminal.
Open RoutingAudio and MIDI routing, in a terminal.
Open ScopeAn oscilloscope on the output, in a terminal.
Open MIDI MonitorAll MIDI on this machine, in a terminal. Needs no server.
Open VisualsThe native visuals window of the active server.
Rescan PluginsScans the plugin folders for new and changed plugins.
Rescan Plugins (Full)Opens every plugin again, including those skipped after a crash.
Retry Skipped Plugins…Opens chosen skipped plugins again.
Open PreferencesOpens ~/.resonon/preferences.toml.
Restart Language ServerRestarts the language server of the current file.

The terminal views are the ones resonon view opens; see the CLI reference.

The resonon icon in the activity bar opens four views:

ViewContents
ServersEvery server found on the network, started from this window, or added by hand. Click to connect.
Server ControlsStart and stop the server, reset, preferences, plugin rescan, add a server, connect, disconnect, display name.
TransportPlay / pause, stop, evaluate selection or line, evaluate file.
ViewsConsole, mixer, routing, MIDI monitor, scope, visuals.
SettingDefaultWhat it is
resonon.server.path""The resonon binary. Empty searches PATH. A path into one version (~/.resonon/versions/<v>/bin/resonon) bypasses the launcher, so projects’ pinned versions no longer apply.
resonon.server.port5555Port of a server the extension starts.
resonon.server.password""Password of a server the extension starts.
resonon.client.name""Your display name. Empty uses your system user name.
resonon.lsp.enabledtrueThe language features.
resonon.lsp.path""The resonon-lsp binary. Empty searches PATH. A path into one version gives every project that version.
resonon.audio.multicorefalseRender audio on several CPU cores, in a server the extension starts.
resonon.audio.pluginModStride16Samples between automation points sent to CLAP and VST3 plugins, in a server the extension starts. 1 is every sample.
resonon.plugins.autoScantrueKeep the plugin database up to date automatically.

The RESONON item shows the connection:

TextStateClick
$(circle-slash) RESONONDisconnectedConnect
$(sync~spin) RESONONConnecting or reconnecting—
$(circle-filled) RESONON: studio (as Alice) $(pulse) 12%Connected, with the server’s name, your display name and the audio CPU loadServer menu

The LSP item shows the language server of the current file, its version and, while it runs, the mode, for example $(check) LSP 0.14.0 · Live:

TextState
$(sync~spin) LSP 0.14.0Starting
$(check) LSP 0.14.0 · FileRunning, in File Mode
$(check) LSP 0.14.0 · LiveRunning, in Live Mode
$(circle-slash) LSP 0.14.0Stopped
$(error) LSP 0.14.0Failed. Click to retry

The language server works on .non files and on resonon.toml.

FeatureHowWhat it does
HoverPoint at a nameThe type, signature and documentation of a variable, function, class, method or module member.
CompletionType, or Ctrl+SpaceKeywords and names; methods after a .; parameter names in .parameter("…") and .set_parameter("…"); effect slot names in .effect("…"); module paths in use "…" and names in its { … }.
Signature helpType ( or ,The parameters of the function being called, including module functions (gfx.Visual() and DSP builtins inside a dsp block.
Go to DefinitionCmd+Click or F12Jumps to where a name is defined, in the file, a module or the standard library. On the path string of gfx.load_shader(...) or load_file(...) it opens that file.
Find All ReferencesShift+F12Every use of the name in the current file.
Rename SymbolF2Renames the name in the current file. Refused on a keyword, and for a new name that is not an identifier or is a keyword.
Format DocumentShift+Alt+FRe-indents the whole file; see below.
Inlay hints—name: before each positional argument of a call to your own function, class or method.
OutlineOutline view, breadcrumbsFunctions, classes and their methods, dsp declarations, let bindings and uses.
Diagnostics—Underlines errors; see below.
Quick fixesCmd+. (Ctrl+.)See below.

Completion of values, effect slots and parameters reads the state of the session after your last evaluation; in File Mode, it offers only names in the file.

The editor reads code in one of two modes, and switches between them on its own. The status bar shows which.

ModeWhenWhat the editor reads
File Mode (offline)Nothing has been evaluated yet, and again after RESET, or when the server stops or crashesThe file, as one program run top to bottom
Live Mode (online)From the first evaluation, in any fileThe session: the file is a scratchpad of selections, each evaluated on its own

Each evaluation of any file switches every open file to Live Mode, because definitions belong to the whole session. A server that crashed is noticed at your next edit. Rename and Find All References work on the current file, match methods by name only, and skip strings and comments.

Parse errors, undefined names and wrong argument counts are underlined as you type; runtime errors are underlined after you evaluate, and clear at your next evaluation. Both are in the Problems panel.

A name defined twice at the top level of a file, or defined and also imported with use, is marked only in File Mode. In Live Mode, evaluating a new definition further down is how you change one. A name repeated inside one definition, such as two methods m in a class, or inside a module the file imports, is marked in both modes: either is always evaluated whole. Every kind and its severity: Errors & Warnings.

In resonon.toml, each [local] kits entry is followed by a note: in this project, on this machine, travels anyway or missing.

Rule
IndentationOne level per open bracket, in the editor’s tab size, with spaces or a tab as the editor is set
ContinuationA line starting with . is indented one more level
Blank linesAt most 2 in a row; none at the end
Trailing whitespaceRemoved
End of fileExactly one newline
Line endingsCRLF kept if most lines use it
UnchangedLine breaks, spacing inside a line, comments, and lines that start inside a string or /* */ comment

A file that does not parse is left unchanged. resonon.toml is not formatted.

WhereFix
An undefined nameDid you mean X? — the closest defined name, including DSP builtins inside a dsp block
A Kit("…") whose kit is outside the projectCopy ‘k’ into this project; List ‘k’ under [local] in resonon.toml
A [local] kits entryCopy ‘k’ into this project (for a kit on this machine, outside the project); Remove ‘k’ from resonon.toml
A misspelled key in resonon.tomlRename to key
A plugin that was skipped after a crashRetry plugin — opens the plugin again

Each project gets its own language server, running the version its resonon.toml pins. Files outside a project share one running your default version. If a project pins a version you don’t have, a notification offers to install it.

The server you evaluate on runs one version: that of the project it was started from. Code from a project that needs a newer version is refused, with an offer to restart the server for that project when that version is installed. Code from a project that targets an older version runs, with a warning the first time in a session.