ferraus generate tone
Generate a test tone or sweep
Synopsis
ferraus generate tone [options]
What it does
Writes a sine, square, saw, or triangle tone (band-limited with polyBLEP, so square, saw, and triangle have no aliasing to speak of), optionally sweeping between two frequencies. The phase is accumulated in double precision, so the frequency is exact. The sample rate and channel count come from the global --sample-rate (default 48000) and --channels (default 1). Without -o the file is tone.wav in the current directory.
Examples
Five seconds of A440 at -3 dBFS
ferraus generate tone -o a440.wav
A ten-second logarithmic sweep at 96 kHz
ferraus generate tone --sweep 20Hz..20kHz --dur 10s --sample-rate 96000 -o sweep.wav
A band-limited saw at C3
ferraus generate tone --shape saw --freq C3 --dur 2s -o saw.wav
Options
| Flag | Type | Default | Meaning |
|---|---|---|---|
--freq | frequency | 440Hz | Frequency (Hz, kHz, or a note such as A4) |
--dur | time | 5s | Duration |
--shape | sine | square | saw | triangle | sine | Waveform |
--sweep | text | — | Sweep from low to high over the duration, e.g. 20Hz..20kHz (overrides --freq) |
--sweep-curve | log | linear | log | Sweep spacing: logarithmic (equal time per octave) or linear |
--amplitude | gain | -3dB | Peak level in dBFS |
Global options
Every command also accepts the global options (-o, --json, --dry-run, --overwrite, --progress, ...). See Global options.
Exit codes
| Code | Meaning |
|---|---|
| 0 | Success |
| 1 | Processing failed |
| 2 | Usage or parameter error |
| 3 | Input missing or unreadable |
| 8 | Cancelled |
| 70 | Internal error (bug) |
Common mistakes
- Beat-based times (
4b,1/4) need a tempo: pass--bpmor write4b@120. - Gains need a unit when not in dB:
0.5xis a factor,-6and-6dBare decibels.
For models
- MCP tool:
ferraus_generate_tone - Schema:
ferraus schema generate tone - Pipeline:
{ op: generate tone, args: { ... } }(flag names with_instead of-) - fx stage: no
{"command": "generate tone", "defaults": {"freq": "440Hz", "dur": "5s", "shape": "sine", "sweep_curve": "log", "amplitude": "-3dB"}}