What Pole is
A DSP language with a real compiler, a wasm target, and nothing to ship at run time but libm.
Anyone who writes audio code, or wants to.
Pole is a language for writing audio DSP. You write a processor, it compiles, and you hear it — from a command line, in a browser, or inside a plugin your DAW loads.
The block below is a complete program. Press Run.
processor Sine
{
output stream float out;
param float freq = 220.0f [55.0f, 880.0f] smooth 20.0f;
float phase = 0.0f;
void main()
{
loop
{
out <- sin (phase) * 0.2f;
phase = phase + 6.2831853f * freq / processor.frequency;
if (phase >= 6.2831853f) { phase = phase - 6.2831853f; }
advance();
}
}
}The shape of every program#
Three ideas carry most of the language.
A processor declares its endpoints. input and output are the wires in
and out. param is an input that also carries a name, a default and a range,
so a host can enumerate a patch's controls rather than being told the layout
out of band.
main() runs once per sample. Not once per block — once per sample. That
is why there is no modulation system to learn: anything you compute in
main is already per-sample, so modulation is arithmetic rather than a
feature.
advance() ends the frame. A loop with no advance() is rejected
(POLE0405) rather than compiled into something that silently means "run the
body once".
What it compiles to#
polec emits an object file and a C header. Link them and Pole is not present
at run time: no JIT, no LLVM, no runtime library beyond libm. The same
compiler emits WebAssembly, which is how the block above just played in your
browser.
The editor and the exported plugin run the same optimised module, and a bit-identity check holds them to it.
Why it exists#
Pole was written for Patchwerk, which needed a DSP language it could ship inside a commercial product. The engine before it was Cmajor, which is GPLv3 — a licence that does not fit a closed-source plugin, and a commercial licence carried an obligation measured in thousands. Writing a compiler is a large thing to take on to avoid a licence; it was still the smaller option, and it ended somewhere better than where it started: Pole compiles a patch 15 to 100 times faster than the engine it replaced, and it has a wasm target, which is the reason this page can make sound.
What it is not#
It is a language for DSP, not a general-purpose one. There are no structs, no strings, no generics, no dynamic allocation and no recursion. Every loop is bounded at compile time, which is what makes a patch submitted by a stranger safe to compile and run.
If you want the short version: it is small enough to learn in an afternoon and strict enough that the things it refuses are things you would not have wanted.
Where to go next#
- Install and run — building the compiler and playing your first file.
- Your first patch — gain, an oscillator and a held note with a release tail.
- How to read this book — a chapter path, vocabulary and listening exercises.
- The language — the reference, in order.