The Pole documentation
A DSP language with its own compiler. Every code block on these pages is compiled by that compiler before the page ships, and the ones marked runnable play in the page.
Start here
What Pole is, how to run it, and a patch you can hear in the page.
How to read this book
A path from your first sample to a playable instrument, with a few useful words and listening habits along the way.
What Pole is
A DSP language with a real compiler, a wasm target, and nothing to ship at run time but libm.
Install and run
Build the compiler, render a WAV, play a patch live, or skip all of it and use the browser.
Your first patch
A gain, an oscillator, and an envelope — each one runnable, each one a few lines longer than the last.
The language
Processors, endpoints, parameters, state, and the shape of a frame.
Program structure
Processors, main, advance, and the one rule that decides what a frame is.
Types
float, int, and vectors of either — plus the conversion rule that has no exceptions.
Variables
let and var, block scope, and why a var may be assigned inside a branch.
Endpoints
Inputs, outputs, side channels, endpoint arrays, and the five dimensions of a note.
Parameters
An input that carries a name, a default, a range — and smoothing, which is not optional in practice.
Processor state and init
What persists across frames, why an initialiser must be a literal, and the block that builds a table once.
Arrays
Power-of-two sizes, an index that wraps instead of faulting, and why that is the whole safety story.
Operators
Arithmetic, comparison, logic and bitwise — with C's precedence and no float bit-twiddling.
Control flow
if, for, while, break, every — all of them bounded, on purpose.
Functions
Give an idea a name, pass its inputs explicitly, and reuse it — with signatures, arguments and worked calls.
Built-in maths
What the builtins are, how they behave on vectors and ints, and the flag that trades a few ulp for speed.
Graphs
Wiring processors together, node arrays for polyphony, and feedback.
Graphs and nodes
Wiring processors together — and the rules that decide what a half-wired graph does.
Node arrays
Polyphony in one line — eight instances, one compiled function, three connection shapes.
Feedback
Why a cycle needs a delay you write yourself, and what it costs.
Slower clocks
Running a node once every N frames — and why running one faster is refused.
Events
Notes, MIDI and handlers that run between samples.
Shipping
Object files, C headers, plugins, wasm, and where it runs.
What polec emits
IR, a WAV, an object file, a C header, a wasm module — one compiler, several useful outputs.
The C header
What `--emit=export` hands you, and what it costs to link.
Plugins
CLAP, VST3 and Audio Unit, from an object file and a header.
WebAssembly
The target that lets a patch run in a browser — and what the runtime learns from the manifest.
Platforms
Where Pole has actually been built and run — and where it has not.
Cookbook
Worked patches — an oscillator, a filter, a reverb — all playable.
A sine, and a saw
The smallest thing that makes a sound, and the smallest thing that makes an interesting one.
Resonant lowpass filter DSP tutorial with a playable example
Follow a signal through a resonant lowpass and hear how a moving cutoff changes its brightness.
ADSR envelope implementation with a playable example
Four stages, and why two of them are exponential and one is not.
Feedback delay DSP tutorial with a playable example
A delay line, a feedback path, and an index that wraps instead of faulting.
A reverb
Parallel feedback delays and short diffusion stages — building a tail one repeat at a time.
A wavetable
Build one cycle in init, read it with interpolation, and turn a stored shape into a changing tone.
A stereo chorus
A delay whose length moves, and two of them out of phase with each other.
A wavefolder
Distortion that folds instead of clipping.
An effects chain
Several processors wired into one graph — and what the wires mean.
Reference
Diagnostics, built-ins and the command line, generated from the compiler.
Keywords
Every word the language reserves, and the one page that explains each.
Runtime values and conversions
Sample rate, sample period, explicit casts, vector constructors and the properties of an external buffer.
Diagnostics
Every error the Pole compiler can report, scraped from the sources that raise it.
Built-in maths
Function signatures, argument descriptions, return values and practical DSP examples for every supported maths builtin.
The polec command line
Every flag the compiler takes, straight from its own help.