Synthdown is:
- A notation format for describing modular synthesiser patches
- A reference implementation of a parser for this notation
- A CLI that reads valid notations and generates all kinds of diagrams and stuff
Synthdown notation is based on linking modules together with patch cables.
Which is fair, because that's what modular synthensisers are based on.
A simple patch might look like:
sequencer[bpm: 90](output)
-> (trigger)envelope[A:0, D:2, S:0, R:2](out)
-> (control)sine[Level: 10, Tone: 1.5];
This, in essence, says
- Set your sequencer to 90bpm and patch from the output jack to the trigger jack of an envelope
- Set the envelope ADSR values accordingly, then patch from the out jack to the control jack of a sine module
- Set control to 10 and the tone to 1.5 and patch from the out jack to wherever you're off next
The patching its self is pretty obvious; the symbol ->
represents a patch cable.
A module, such as (trigger)envelope[A:0, D:2, S:0, R:2](out)
is made up of:
(trigger)
- the input jack, which can be either audio or CV (we don't make any distinction)envelope[A:0, D:2, S:0, R:2]
- the module its self (envelope
) and whichever knobs and twiddler values apply(out)
- the output jack
There are two special cases; the first module in a patch, and the last module in a patch. The first must not have an input, and the last must not have an output since this would be an absurdity.
Finally, a patch ends with a semicolon; this allows us to add many patches to a single input file, should we want to.
The following EBNF describes the notation above.
SynthdownFile = (Patch ";")* .
Patch = Module ("-" ">" Module)* .
Module = Jack? <ident> "[" Arg* ("," Arg)* "]" Jack? .
Jack = "(" <ident> ")" .
Arg = <ident> ":" Value .
Value = <string> | <float> | <int> .
BSD 3-Clause License
Copyright (c) 2024, James Condron All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
-
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
-
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
-
Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.