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 bookA path from your first sample to a playable instrument, with a few useful words and listening habits along the way.
- What Pole isA DSP language with a real compiler, a wasm target, and compiled code that needs nothing but the C math library.
- Install and runBuild the compiler, render a WAV, play a patch live, or skip all of it and use the browser.
- Your first patchA 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 structureProcessors, main, advance, and the one rule that decides what a frame is.
- Typesfloat, int, and vectors of either — plus the conversion rule that has no exceptions.
- Variableslet and var, block scope, and why a var may be assigned inside a branch.
- EndpointsInputs, outputs, side channels, endpoint arrays, and the five dimensions of a note.
- ParametersAn input that carries a name, a default, a range — and smoothing, which is not optional in practice.
- Processor state and initWhat persists across frames, why an initialiser must be a literal, and the block that builds a table once.
- ArraysPower-of-two sizes, an index that wraps instead of faulting, and why that is the whole safety story.
- OperatorsArithmetic, comparison, logic and bitwise — with C's precedence and no float bit-twiddling.
- Control flowif, for, while, break, every — all of them bounded, on purpose.
- FunctionsGive an idea a name, pass its inputs explicitly, and reuse it — with signatures, arguments and worked calls.
- Built-in mathsWhat 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 nodesWiring processors together — and the rules that decide what a half-wired graph does.
- Node arraysPolyphony in one line — eight instances, one compiled function, three connection shapes.
- FeedbackWhy a cycle needs a delay you write yourself, and what it costs.
- Slower clocksRunning 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 emitsIR, a WAV, an object file, a C header, a wasm module — one compiler, several useful outputs.
- The C headerWhat `--emit=export` hands you, and what it costs to link.
- PluginsCLAP, VST3 and Audio Unit, from an object file and a header.
- WebAssemblyThe target that lets a patch run in a browser — and what the runtime learns from the manifest.
- PlatformsWhere 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 sawThe smallest thing that makes a sound, and the smallest thing that makes an interesting one.
- Resonant lowpass filter DSP tutorial with a playable exampleFollow a signal through a resonant lowpass and hear how a moving cutoff changes its brightness.
- ADSR envelope implementation with a playable exampleFour stages, and why two of them are exponential and one is not.
- Feedback delay DSP tutorial with a playable exampleA delay line, a feedback path, and an index that wraps instead of faulting.
- A reverbParallel feedback delays and short diffusion stages — building a tail one repeat at a time.
- A wavetableBuild one cycle in init, read it with interpolation, and turn a stored shape into a changing tone.
- A stereo chorusA delay whose length moves, and two of them out of phase with each other.
- A wavefolderDistortion that folds instead of clipping.
- An effects chainSeveral processors wired into one graph — and what the wires mean.
Reference
Diagnostics, built-ins and the command line, generated from the compiler.
- KeywordsEvery word the language reserves, and the one page that explains each.
- Runtime values and conversionsSample rate, sample period, explicit casts, vector constructors and the properties of an external buffer.
- DiagnosticsEvery error the Pole compiler can report, scraped from the sources that raise it.
- Built-in mathsFunction signatures, argument descriptions, return values and practical DSP examples for every supported maths builtin.
- The polec command lineEvery flag the compiler takes, straight from its own help.