This chapter describes everything the synth editor does. If you're new to Sonido, work through the tutorial in chapter 2 first; this chapter is for reference, and for the details the tutorial passes over.
right button (press, move, release) open the menu and choose a node to add type a letter search for a node to add left click a node select it (Shift: add it to, or take it from, the selection) left drag on empty space select the nodes in a box (Shift: add them to the selection) left drag a node's title move it, with any other selected nodes left drag from a connector connect it to a connector of the same type left drag from a connected input move or remove its connection left drag a knob up or down turn it left click a text field type into it (Enter, Tab or Escape finishes) middle drag scroll the view scroll wheel zoom in or out, around the mouse Delete, Backspace delete the selected nodes Ctrl-X, Ctrl-C, Ctrl-V cut, copy, paste the selected nodes Ctrl-Z undo Ctrl-Shift-Z, Ctrl-Y redo close the window stop editing
(so:edit-synth "my first synth")
lisp
edit-synth opens an editor for the synth of that name, and returns at once: the editor runs in a thread of its own, so the REPL stays free. Sonido must be running (see so:start in chapter 1).
You can have as many editors open as you like, one for each synth, each playing its synth.
To stop editing a synth, close its window. so:stop closes every editor.
There's no saving to do: every change is saved as soon as it's made, when you let go of the mouse button or press a key, by rewriting the synth's file. A change that leaves the synth as it was, such as clicking on a node, doesn't rewrite it.
Synths you make are saved in ~/.local/sonido/synths/, a file for each, named after the synth with a dash for each space: "my first synth" is saved in my-first-synth.lisp.
The synths that come with Sonido are in its data/synths/ directory. When you edit one of them, your changes are saved to a file of the same name in ~/.local/sonido/synths/, in the same category folder, and that copy is used from then on in place of the original. Delete your copy to go back to the original. (With the development-mode setting on, edits change the bundled files themselves; see chapter 1.)
If saving would overwrite a file the editor didn't open the synth from, the old file is moved to the backups/ folder in ~/.local/sonido/synths/ first, so nothing is lost.
You can see the code being saved for a synth while it's edited:
(so:synth-code "my first synth")
lisp
While a synth is being edited, you hear it, through its waveform outputs (from outputs in the menu).
A synth plays while its editor is open, whatever else you're doing; one with no envelope, like the tutorial's synth in its first step, sounds continuously. A synth's knobs and inputs set what you hear while editing: for one played by trigger, press its trigger input's button to hear a note.
The editor shows the synth's nodes on a grey background that extends as far as you like in every direction.
The view can't be scrolled or zoomed so that none of the synth is on screen, so you can't lose it. If deleting nodes or shrinking the window leaves nothing on screen, the view moves to bring the nearest node back.
Press the right mouse button and hold it: the menu opens at the mouse. Move over a category to open its sub-menu, and on to the node you want, then let go of the button. Letting go anywhere else closes the menu and adds nothing.

The menu's categories are:
The node reference describes every node in the menu, arranged the same way:
Node referenceWhen you know a node's name, or part of it, just start typing (with the mouse over the window, and no text field being typed into). A search box opens at the top of the window, listing every node, synths included, whose name contains what you've typed.

A space doesn't open the search box, but once it's open you can type spaces, to search for "lfo frequency" rather than "lfo".
A node added from the menu or the search box arrives stuck to the mouse, with its top left corner at the pointer, so you can carry it where you want it. Click to put it down.


Clicking a node also brings it to the front, over any nodes it overlaps.
Drag a node by its title bar to move it. If it's selected along with other nodes, they all move together.
Only the title bar moves a node: pressing anywhere else on it works the knob, button or text field under the mouse, or does nothing. Connections follow the nodes as they move.
Delete or Backspace deletes the selected nodes, along with their connections.
Connections between the copied nodes are copied with them, but connections to nodes left behind aren't. You can paste into another synth's editor, to copy part of one synth into another.
While you're typing into a comment box, these keys cut, copy and paste its text instead.
Ctrl-Z undoes the last change, and pressing it again undoes the one before, up to 200 changes back. A change is adding, deleting, moving or connecting nodes, or changing a setting; adding a node and putting it down is one change, and so is everything typed into a text field in one go.
Ctrl-Shift-Z or Ctrl-Y redoes what was undone, until you make a new change. Undo remembers the changes made since the editor was opened; closing the window forgets them.
Press the left button on a connector, an output or an input, and drag. A curve follows the mouse. When the mouse comes near a connector the connection could go to, the curve snaps onto it; let go there to connect them.


A connection always joins an output to an input of the same type, so the curve only snaps to connectors of the right type and colour, and never to another connector of the node it started from. Letting go anywhere else makes no connection.
Pressing on an input that's connected picks up the connection's end: drag it to another input to move the connection there, or let go on empty background to remove it.

The colours of the connectors and connections show their types: waveform (blue), factor (green), trigger (grey), note (light blue), frequency (yellow), lfo frequency (red) and time (purple). Chapter 1 explains what each carries. To connect values of different types, put a converter node between them, from the converters menu.
Connections are drawn behind the nodes, as curves that leave each output to the right and enter each input from the left. A synth is easiest to read when its signals flow from left to right, with as few connections crossing each other or passing behind nodes as you can manage. Keep related nodes together, such as an envelope and what it controls, or a chain of effects in a line.
Press on a knob and drag up to turn it up, or down to turn it down. The value it's set to is shown in the label under it. A full turn takes a short drag; zoom in for finer control.
Every setting with a knob also has an input. While the input is connected, the connection sets the value, and the knob is hidden. Disconnect it and the knob comes back, set as it was.
Some nodes have buttons, such as the trigger input and the trigger button: a button's trigger is on for as long as you hold it down, and it lights up while it's on. A few nodes have switches, which you click to choose a setting.
Synth inputs and outputs, and a few other nodes, have a one-line text field, for a name. Click in it to type into it: what you type goes on the end, and Backspace deletes the last character. Enter, Tab or Escape finishes, as does clicking anywhere else. A name too long for its field shows its end.
Many nodes draw a graph of what they're doing: the waveform an oscillator makes, the shape of an envelope, a filter's response. They change as you turn the knobs, and some, such as the LFOs', move as they run. The nodes under analysis show what's passing through the synth: scopes, level meters, a spectrum analyser, a tuner, and displays of values.
A comment box holds a note about the synth: what it is, how it works, what its knobs do. Add one with "comment", at the bottom of the menu.


Click in a comment to type. Its text wraps, and the box grows to fit it. Enter starts a new line, so finish with Escape or Tab, or by clicking elsewhere. Clicking puts the cursor where you click, and dragging selects text; Shift with the arrow keys, Home and End selects too, and Ctrl-A selects everything.
Comments have no connectors, and play no part in the sound.
A synth's inputs and outputs are what let it be played, from a keyboard or from Lisp, and used inside other synths. They're nodes like any other, under inputs and outputs in the menu, one of each for each connector type:
To be played with so:perform or sonido-lang's play, a synth needs a waveform output (and if it has more than one, you say which to play). Its inputs are set by name, so give them these names:
When perform or play sets an input, the input's knob is ignored; inputs it doesn't set keep their knobs' settings.
A factor input or a trigger input can also suggest something on the MIDI keyboard to play it: a controller (a knob, slider, wheel or pedal) for a factor, or a key for a trigger, as each drum of the drum kit has its own key. Press its midi button, which lights up, then move the controller or strike the key: the input takes it, shows it under the button, and the light goes out. Pressing the button while it's lit gives up, and leaves the input with no suggestion. Whatever plays the synth uses the suggestion unless told otherwise.
Any saved synth with at least one output can be used as a single node in another synth. They're in the menu under synths, sorted into the same categories as their folders; your own synths without a folder are at the end.

A synth node has an input for each of the synth's input nodes, with its knob or button, and an output for each of its output nodes, all labelled with their names, in the order the input and output nodes are placed in the synth, from top to bottom.
