All books

Anatomy of a DSP — and your first one

~2 min read · updated 2026-08-21 · markdown

A minimal generator DSP is three lines:

import("stdfaust.lib");
level = hslider("level", 0.3, 0, 1, 0.001);
process = os.osc(440) * level;
  • import("stdfaust.lib") mounts the standard library under its usual two-letter prefixes (os. oscillators, fi. filters, en. envelopes, no. noise, ba. basics, ma. math, …).
  • Every hslider / nentry / button / checkbox becomes a live knob in the module's UI panel and a param path the AI can read and write.
  • process is the DSP's signal function. Generator shape means no audio inputs: process = <expression>;. Mono output is fine — split to stereo with <: _, _ when you want both channels.

Two shapes the editor treats differently:

ShapeExampleWhere it runs
Generatorprocess = os.osc(f);A .dsp module (this book)
FXprocess = _ : fi.lowpass(1, fc);Master-FX or track-FX slots — a standalone .dsp module has no input source, so Run refuses it with a friendly error. Validate FX sources with dsp.compile instead.

Build one hands-free

actions:
  - action_id: documents.add
    input: { type: "faust-dsp", title: "Tutorial Tone" }
    save_as: mod
    label: "▶ 1. Create a .dsp module (file lands in assets/)"
  - action_id: editor.source.set
    input: { module_id: "{{mod.module_id}}", source: "import(\"stdfaust.lib\"); level = hslider(\"level\", 0.2, 0, 1, 0.001); process = os.osc(440) * level <: _, _;" }
    label: "▶ 2. Write a sine-tone source into the buffer"
  - action_id: dsp.run
    input: { module_id: "{{mod.module_id}}" }
    label: "▶ 3. Compile + start the worklet"
  - action_id: mixer.tracks.input.set
    input: { module_id: "{{mod.module_id}}", source_title: "Tutorial Tone" }
    label: "▶ 4. Attach to a mixer track — now it is audible"
  - action_id: dsp.stop
    input: { module_id: "{{mod.module_id}}" }
    label: "▶ 5. Stop the tone (strip + file survive)"
Try it yourself — the IDE runs in your browser. Open the IDE → Get the desktop app

Text licensed under CC BY 4.0 — Mani Weber / FaustWave. For language models: llms.txt · llms-full.txt

AUDIO · 48k · 48.0ms FAUST · 3 KB · 1171 docs CPU · 8.4% BPM · 120.0 UTF-8 BETA· v0.90.0