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

FlagTypeDefaultMeaning
--freqfrequency440HzFrequency (Hz, kHz, or a note such as A4)
--durtime5sDuration
--shapesine | square | saw | trianglesineWaveform
--sweeptext—Sweep from low to high over the duration, e.g. 20Hz..20kHz (overrides --freq)
--sweep-curvelog | linearlogSweep spacing: logarithmic (equal time per octave) or linear
--amplitudegain-3dBPeak level in dBFS

Global options

Every command also accepts the global options (-o, --json, --dry-run, --overwrite, --progress, ...). See Global options.

Exit codes

CodeMeaning
0Success
1Processing failed
2Usage or parameter error
3Input missing or unreadable
8Cancelled
70Internal error (bug)

Common mistakes

  • Beat-based times (4b, 1/4) need a tempo: pass --bpm or write 4b@120.
  • Gains need a unit when not in dB: 0.5x is a factor, -6 and -6dB are 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"}}