Command-Line Interface¶
cyfaust provides a CLI accessible via cyfaust or python -m cyfaust.
For help on any command:
Commands¶
version¶
Show cyfaust and libfaust version information:
info¶
Display DSP metadata, inputs, outputs, and dependencies:
compile¶
Compile Faust DSP to a target backend:
cyfaust compile synth.dsp -b cpp -o synth.cpp
cyfaust compile synth.dsp -b rust -o synth.rs
cyfaust compile synth.dsp -b c -o synth.c
Supported backends: cpp, c, rust, codebox
| Option | Description |
|---|---|
-b, --backend |
Target backend (default: cpp) |
-o, --output |
Output file (default: stdout) |
expand¶
Expand Faust DSP to self-contained code with all imports resolved:
cyfaust expand filter.dsp -o filter_expanded.dsp
cyfaust expand filter.dsp --sha-only # output only SHA1 key
| Option | Description |
|---|---|
-o, --output |
Output file (default: stdout) |
--sha-only |
Only output the SHA1 key |
diagram¶
Generate SVG block diagrams:
| Option | Description |
|---|---|
-o, --output |
Output directory for SVG files |
play¶
Play a Faust DSP file through speakers using RtAudio:
cyfaust play osc.dsp # play until Ctrl+C
cyfaust play osc.dsp -d 5 # play for 5 seconds
cyfaust play osc.dsp -r 48000 # use 48kHz sample rate
cyfaust play osc.dsp -b 1024 # use 1024-sample buffer
| Option | Description |
|---|---|
-d, --duration |
Duration in seconds (default: play until Ctrl+C) |
-r, --samplerate |
Sample rate in Hz (default: 44100) |
-b, --buffersize |
Buffer size in samples (default: 512) |
params¶
List a DSP's controls, or read and drive their values, via the runtime UI
parameter API (InterpreterDsp.params/get_param/set_param). The DSP is
compiled and instantiated, so the output reflects exactly what the compiled DSP
exposes -- full UI path, widget kind, input/output flag, and current value --
rather than a static parse of the source.
Example output:
Parameters (3):
------------------------------------------------------------
[0] /synth/freq (hslider, input) = 440.0
[1] /synth/gain (vslider, input) = 0.5
[2] /synth/gate (button, input) = 0.0
Add --verbose for the range metadata of each control:
Read or set specific controls by full path or unambiguous leaf label (both
--get and --set are repeatable); a --set is applied before any --get:
Bargraphs are read-only outputs; setting one, or naming an unknown/ambiguous control, exits non-zero with an error.
| Option | Description |
|---|---|
-v, --verbose |
Show init/range/step for each control |
--get PATH |
Get a control value by path or label (repeatable) |
--set PATH VALUE |
Set a control value by path or label (repeatable) |
--sample-rate |
Sample rate used to initialize the DSP (default: 48000) |
validate¶
Check a Faust DSP file for compilation errors:
| Option | Description |
|---|---|
--strict |
Treat warnings as errors (non-zero exit code) |
bitcode¶
Save a compiled DSP factory as bitcode for faster reloading, or load an existing bitcode file and display its info:
| Option | Description |
|---|---|
mode |
save or load |
-o, --output |
Output bitcode file (save mode only, default: <name>.fbc) |
json¶
Export DSP metadata, parameters, and library dependencies as JSON. The
parameters entries are derived from the runtime UI parameter API (the same
source as cyfaust params), so each carries the full UI path, label,
widget type, is_input flag, current value, and range (min/max, plus
init/step for settable inputs):
Excerpt:
{
"name": "synth",
"inputs": 0,
"outputs": 1,
"parameters": [
{
"path": "/synth/gain",
"label": "gain",
"type": "vslider",
"is_input": true,
"value": 0.5,
"min": 0.0,
"max": 1.0,
"init": 0.5,
"step": 0.01
}
]
}
| Option | Description |
|---|---|
-o, --output |
Output JSON file (default: stdout) |
-p, --pretty |
Pretty-print JSON output |