Instruments & Effects
Effects process a track’s audio; instruments generate it. Both are loaded onto tracks with load_effect / load_instrument and share the same parameter, preset, and GUI methods. Import the built-in effect constructors from std/effects:
use "std/effects" { Delay, Lowpass, Highpass, Bandpass, Notch, Allpass, Peak, Reverb, PlateReverb, Overdrive, Distortion };| Constructor | Meaning |
|---|---|
Delay(time?, feedback?, name?) | Echo with feedback |
Lowpass(cutoff?, resonance?, name?) | Attenuate above cutoff |
Highpass(cutoff?, resonance?, name?) | Attenuate below cutoff |
Bandpass(cutoff?, resonance?, name?) | Pass a band around the center |
Notch(cutoff?, resonance?, name?) | Remove a band around the center |
Allpass(cutoff?, resonance?, name?) | Phase shift at cutoff (phaser building block) |
Peak(cutoff?, resonance?, name?) | Bell-shaped boost at the center (EQ) |
Reverb(room?, damp?, width?, mix?, name?) | Freeverb-style reverb |
PlateReverb(size?, damping?, diffusion?, predelay?, mix?, name?) | Dattorro plate reverb |
Overdrive(drive?, tone?, name?) | Symmetrical tube-style soft clipping |
Distortion(drive?, tone?, name?) | Asymmetrical transistor-style clipping |
Effect(plugin_name, plugin_id?) | External CLAP/VST3 effect |
Instrument(plugin_name, plugin_id?) | External CLAP/VST3 instrument |
All constructor arguments are optional and fall back to the defaults in the parameter tables below. The trailing name argument sets the effect slot name for idempotent loading.
Built-in Effects
Section titled “Built-in Effects”Echo with feedback.
use "std/effects" { Delay };
let slap = Delay(0.1, 0.3);let dub = Delay(0.5, 0.7);| Parameter | Range | Default | Description |
|---|---|---|---|
Time | 0.001–2.0 | 0.25 | Delay time in seconds |
Feedback | 0.0–0.99 | 0.5 | Feedback amount |
Mix | 0.0–1.0 | 1.0 | Dry/wet balance (0 = dry, 1 = wet) |
Filters
Section titled “Filters”Six state-variable filter modes share one interface: Type(cutoff?, resonance?).
use "std/effects" { Lowpass, Highpass, Bandpass, Notch, Allpass, Peak };
let warm = Lowpass(800); // smooth rolloff above 800 Hzlet resonant = Lowpass(1000, 5); // resonant peak at the cutofflet thin = Highpass(500); // remove lowslet vocal = Bandpass(800, 8); // narrow resonant bandlet dehum = Notch(60); // remove 60 Hz humlet phasey = Allpass(1000); // phase shift onlylet boost = Peak(2000, 4); // bell boost at 2 kHz| Parameter | Range | Default | Description |
|---|---|---|---|
Cutoff | 20–20000 | 1000 | Cutoff/center frequency in Hz |
Resonance | 0.1–30 | 0.707 | Filter Q (0.707 = Butterworth, flat passband) |
Reverb
Section titled “Reverb”Freeverb-algorithm stereo reverb.
use "std/effects" { Reverb };
let hall = Reverb(0.8, 0.3);let subtle = Reverb(0.4, 0.6, 1.0, 0.2);| Parameter | Range | Default | Description |
|---|---|---|---|
Room | 0.0–1.0 | 0.5 | Room size (higher = longer decay) |
Damp | 0.0–1.0 | 0.5 | High-frequency damping |
Width | 0.0–1.0 | 1.0 | Stereo width (0 = mono) |
Mix | 0.0–1.0 | 0.33 | Dry/wet balance |
PlateReverb
Section titled “PlateReverb”Dattorro-algorithm plate reverb — lusher and more diffuse than Reverb.
use "std/effects" { PlateReverb };
let lush = PlateReverb(0.7, 0.4, 0.8);let dark = PlateReverb(0.8, 0.9, 0.7, 0.02, 0.3);| Parameter | Range | Default | Description |
|---|---|---|---|
Size | 0.0–1.0 | 0.5 | Tank size (higher = longer decay) |
Damping | 0.0–1.0 | 0.5 | High-frequency damping |
Diffusion | 0.0–1.0 | 0.7 | Diffusion density |
PreDelay | 0.0–1.0 | 0.0 | Pre-delay before the reverb tail |
Mix | 0.0–1.0 | 0.33 | Dry/wet balance |
Overdrive
Section titled “Overdrive”Symmetrical tanh soft clipping (tube-style warmth, mostly even harmonics) with a tone control and DC blocker.
use "std/effects" { Overdrive };
let gentle = Overdrive(0.3);let warm = Overdrive(0.6, 0.8);| Parameter | Range | Default | Description |
|---|---|---|---|
Drive | 0.0–1.0 | 0.5 | Distortion intensity |
Tone | 0.0–1.0 | 0.7 | Post-distortion brightness |
Level | 0.0–1.0 | 0.5 | Output level |
Mix | 0.0–1.0 | 1.0 | Dry/wet balance |
Distortion
Section titled “Distortion”Asymmetrical clipping (transistor-style crunch, even and odd harmonics) with the same controls as Overdrive.
use "std/effects" { Distortion };
let crunch = Distortion(0.7, 0.5);let fuzz = Distortion(1.0, 0.3);| Parameter | Range | Default | Description |
|---|---|---|---|
Drive | 0.0–1.0 | 0.5 | Distortion intensity |
Tone | 0.0–1.0 | 0.7 | Post-distortion brightness |
Level | 0.0–1.0 | 0.5 | Output level |
Mix | 0.0–1.0 | 1.0 | Dry/wet balance |
External Plugins
Section titled “External Plugins”Effect(plugin_name, plugin_id?)
Section titled “Effect(plugin_name, plugin_id?)”Load an external CLAP or VST3 effect plugin by bundle name. Resolution searches CLAP bundles first, then VST3 (or per your configured format preference), matching the filename and then the registry display name; .clap/.vst3 extensions are added automatically. Pass plugin_id to disambiguate multi-plugin bundles.
let verb = Effect("resonon-reverb"); // bundled CLAP pluginlet verb_explicit = Effect("resonon-reverb", "com.resonon.reverb");let room = Effect("ValhallaRoom");let eq = Effect("ReaEQ", "com.cockos.reaeq");Instrument(plugin_name, plugin_id?)
Section titled “Instrument(plugin_name, plugin_id?)”Load an external CLAP or VST3 instrument plugin; same name resolution as Effect(). Attach it to a track with load_instrument.
let synth = Instrument("Vital");let track = AudioTrack("lead");track.load_instrument(synth);Parameter Modulation
Section titled “Parameter Modulation”Effect parameters accept << with a number (static set), a signal (continuous modulation), or breakpoint arrays (automation):
use "std/effects" { Delay };use "std/signals" { Sine };use "std/instruments" { Sampler, Kit };
let drums = AudioTrack("drums");drums.load_instrument(Sampler(Kit("CR-78")));drums << [bd sd bd sd];
let d = Delay(0.25, 0.5);drums.load_effect(d);
d.param("Time") << 0.1; // static valued.param("Time") << Sine(2).range(0.1, 0.4); // signal modulationd.param("Feedback").set(#[0, 0.3], #[4, 0.9]); // automation breakpointsUse .range_exp() when modulating frequency parameters. Breakpoints take an optional curve: #[time, value, "exp"] — see the curve table in the Signals reference.
Effect & Instrument Methods
Section titled “Effect & Instrument Methods”These methods apply to built-in effects, external plugin effects, and external instruments alike (exceptions noted). Parameter names match case-insensitively.
| Method | Returns | Meaning |
|---|---|---|
name() | String | Slot name |
set_name(name) | same receiver | Rename the slot (for idempotent loading) |
param(name) | EffectParam | Parameter reference for << / get / set |
param_get(name) | Number | Read a parameter value |
param_set(name, value) | same receiver | Set a parameter in its native range |
param_set_norm(name, value) | same receiver | Set a parameter from a normalized 0–1 value |
params(filter?) | Nul | Print the parameter table, optionally filtered |
backend() | String | "dsp", "clap", or "vst3" |
connect_input(port, track) | same receiver | Feed a track into a sidechain port (effects only) |
supports_gui() | Boolean | Whether the plugin has a native GUI |
show_gui() / hide_gui() | Nul | Open / close the plugin GUI |
save_state(path) / load_state(path) | same receiver | Save / restore plugin state |
programs() | Array | List factory program names (VST3) |
set_program(index) | same receiver | Select a factory program (VST3) |
param(name) / param_get(name) / param_set(name, value)
Section titled “param(name) / param_get(name) / param_set(name, value)”param() returns a parameter reference with get(), set(...), and set_norm(value) methods — set accepts a number, a signal, or breakpoint arrays, exactly like <<. param_get/param_set are direct shortcuts; param_set chains.
use "std/effects" { Delay };
let d = Delay() .param_set("Time", 0.4) .param_set("Feedback", 0.3);
let t = d.param("Time").get();d.param("Time").set_norm(0.5); // halfway through the 0.001–2.0 rangeparams(filter?)
Section titled “params(filter?)”Print all parameters with their range, default, and current value; pass a substring to filter.
use "std/effects" { Delay };
Delay().params();Delay().params("time");set_name(name)
Section titled “set_name(name)”Rename the effect’s slot before loading. Slots make load_effect idempotent: re-loading the same slot replaces instead of stacking.
use "std/effects" { Reverb };use "std/instruments" { Sampler, Kit };
let drums = AudioTrack("drums");drums.load_instrument(Sampler(Kit("CR-78")));drums.load_effect(Reverb(0.5).set_name("my_verb"));let verb = drums.get_effect("my_verb");connect_input(port, track)
Section titled “connect_input(port, track)”Feed another track’s audio into a named sidechain port — the declared input of a custom DSP effect, or a plugin’s sidechain bus. Mono ports auto-downmix stereo sources. Effects only.
comp.connect_input("sidechain", bass);save_state(path) / load_state(path)
Section titled “save_state(path) / load_state(path)”Persist and restore the full plugin state as a preset file (chainable).
let verb = Effect("resonon-reverb");verb.param_set("Room", 0.4).save_state("/tmp/my_verb.preset");
let verb2 = Effect("resonon-reverb");verb2.load_state("/tmp/my_verb.preset");supports_gui() / show_gui() / hide_gui()
Section titled “supports_gui() / show_gui() / hide_gui()”Open a plugin’s native editor window. Built-in DSP effects have no GUI.
let synth = Instrument("Vital");if synth.supports_gui() { synth.show_gui();}synth.hide_gui();programs() / set_program(index)
Section titled “programs() / set_program(index)”List and select factory programs on VST3 plugins.
let synth = Instrument("MySynth");PRINT synth.programs();synth.set_program(3);Custom DSP Effects
Section titled “Custom DSP Effects”Define your own compiled effects with the dsp effect block — params, state, buffers, multi-port I/O, and per-sample code running in the audio engine. Instances behave like built-in effects: every method on this page applies. See DSP Effects for the block syntax and DSP Reference for the built-in functions available inside.
See Also
Section titled “See Also”- Track Methods — loading effects, effect-chain management, sends and routing
- Signals — modulation sources for effect parameters
- Effects chapter and Plugins chapter — guided introductions
- DSP Reference — custom DSP building blocks