FreeDSP

Live microphone processing in the browser. Effects are formulas you can rewrite while the audio runs.

engine
rate
latency
dc
in
out
Press Start listening to open the input stream.
Use headphones — speakers plus an open microphone will feed back.
0.0 dB

Signal chain

0 effects
Nothing in the chain yet. Add an effect below, then open it to edit the formula.
Drag to reorder.
Formula reference

How a plugin works

One statement per line. The value of the last line becomes the output sample. The code runs once per sample, per channel.

Any name you haven't declared as a parameter is state: it keeps its value into the next sample and starts at 0. That is how you write filters and envelopes.

Lines starting with # are directives, // is a comment.

Directives

  • #name My effect
  • #param drive 4 1 40 — name, start, min, max. Becomes a slider.

Built-in values

  • x input sample, −1…1
  • t seconds, n sample count
  • sr sample rate, ch channel (0 = left)
  • pi, e

Functions

sin cos tan tanh atan exp log sqrt abs sign floor ceil round min max pow mod clamp noise

Delay lines

Four per effect, up to 2 seconds, fractionally interpolated. dw(v) writes, delay(n) reads n samples back. Lines 2–4 use dw2 delay2dw4 delay4.

Echo with feedback: d = delay(time*sr) then dw(x + d*fb) then x + d*mix.

Operators

+ - * / % ^   < > <= >= == !=   && || !   cond ? a : b

Feedback and DC

Any recirculating loop has a DC gain of 1/(1−g), so a small standing offset grows until it eats the headroom. DC block handles the input; inside your own loop, subtract it first: s = x - px + 0.997*s then px = x.

Limits

Each channel is processed on its own, so an effect can't mix left into right. Use ch to make the two sides behave differently.

Parameters glide over about 10 ms when you move a slider, so sweeps don't click.