Effects Reference
This content is for v0.7. Switch to the latest version for up-to-date documentation.
Creates a delay effect with feedback.
Delay() // Defaults: 0.25s time, 0.5 feedbackDelay(time) // Custom time, default feedbackDelay(time, feedback) // Custom time and feedbackParameters
Section titled “Parameters”| Parameter | Range | Default | Description |
|---|---|---|---|
Time | 0.001-2.0 | 0.25 | Delay time in seconds |
Feedback | 0.0-0.99 | 0.5 | Feedback amount |
Filter Effects
Section titled “Filter Effects”Six filter types share the same interface. All accept cutoff and optional resonance:
Lowpass(cutoff, resonance) // Attenuates above cutoffHighpass(cutoff, resonance) // Attenuates below cutoffBandpass(cutoff, resonance) // Passes band around centerNotch(cutoff, resonance) // Removes band around centerAllpass(cutoff, resonance) // Phase shift at cutoff (phaser building block)Peak(cutoff, resonance) // Bell-shaped boost at center (EQ)Parameters
Section titled “Parameters”| Parameter | Range | Default | Description |
|---|---|---|---|
Cutoff | 20-20000 | 1000 | Cutoff/center frequency in Hz |
Resonance | 0.707-10.0 | 0.707 | Filter Q (0.707 = Butterworth, flat passband) |
Lowpass(800); // Warm, smooth rolloffLowpass(1000, 5.0); // Resonant peak at cutoffBandpass(800, 8.0); // Narrow resonant bandNotch(60); // Remove 60Hz humReverb
Section titled “Reverb”Stereo reverb using the Freeverb algorithm.
Reverb(room, damp, width, mix)Parameters
Section titled “Parameters”| 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, 1=full) |
Mix | 0.0-1.0 | 0.33 | Dry/wet mix |
let hall = Reverb(0.8, 0.3); // Large halllet room = Reverb(0.4, 0.6, 1.0, 0.2); // Small room, subtlePlateReverb
Section titled “PlateReverb”Stereo plate reverb using the Dattorro algorithm. Lush, diffuse character.
PlateReverb(size, damping, diffusion, predelay, mix)Parameters
Section titled “Parameters”| 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 (0-100ms) |
Mix | 0.0-1.0 | 0.33 | Dry/wet mix |
let lush = PlateReverb(0.7, 0.4, 0.8);let dark = PlateReverb(0.8, 0.9, 0.7, 0.02, 0.3);Overdrive
Section titled “Overdrive”Warm overdrive using symmetrical (tube-style) soft clipping.
Overdrive(drive, tone)Parameters
Section titled “Parameters”| Parameter | Range | Default | Description |
|---|---|---|---|
Drive | 0.0-1.0 | 0.5 | Distortion intensity |
Tone | 0.0-1.0 | 0.7 | Post-distortion brightness |
let warm = Overdrive(0.6, 0.8); // Warm tube saturationlet gentle = Overdrive(0.3); // Subtle warmthDistortion
Section titled “Distortion”Crunchier distortion using asymmetrical (transistor-style) clipping.
Distortion(drive, tone)Parameters
Section titled “Parameters”| Parameter | Range | Default | Description |
|---|---|---|---|
Drive | 0.0-1.0 | 0.5 | Distortion intensity |
Tone | 0.0-1.0 | 0.7 | Post-distortion brightness |
let crunch = Distortion(0.7, 0.5);let fuzz = Distortion(1.0, 0.3);Custom DSP Effects
Section titled “Custom DSP Effects”Syntax
Section titled “Syntax”dsp effect Name { input name: stereo|mono; // Optional: declare input ports output: stereo|mono; // Optional: declare output layout param name: default range(min, max); state name: initial; buffer name(size);
fn process(inputs...) -> (outputs...) { // DSP code }}
let fx = Name(); // Instantiate the effectdsp effect is a top-level definition statement. The identifier after dsp effect names the effect type. Instantiate it with call syntax (Name()) — this returns a value you can load onto tracks. The name also serves as the slot name for idempotent loading (replacing effects in-place).
I/O Declarations
Section titled “I/O Declarations”| Declaration | Description |
|---|---|
input name: stereo; | Named stereo input port (2 process params) |
input name: mono; | Named mono input port (1 process param) |
output: stereo; | Stereo output (return tuple of 2) |
output: mono; | Mono output (return single value) |
If no I/O declarations are present, the effect defaults to stereo in/out.
Process function parameters are mapped to declared inputs in order. The total parameter count must equal the sum of all input channel counts.
Buffer Declarations
Section titled “Buffer Declarations”| Declaration | Description |
|---|---|
buffer name(size); | Allocate a fixed-size array of size f64 values in the effect’s state |
Buffer elements are accessed with name[index] and assigned with name[index] = value. All values initialize to zero. Indices wrap with modulo. Buffers persist across calls to process.
.connect_input(port_name, source_track)
Section titled “.connect_input(port_name, source_track)”Connect another track’s audio output to a named sidechain port on an effect. Works with both custom DSP effects and external VST3/CLAP plugins that have sidechain buses.
comp.connect_input("sidechain", bass);| Argument | Type | Description |
|---|---|---|
port_name | String | Name of the input port (declared input for DSP effects, or the plugin’s sidechain bus name for VST3/CLAP) |
source_track | AudioTrack | Track whose audio feeds this port |
Returns the effect for chaining. Mono ports auto-downmix stereo sources to (L + R) / 2.
Example: Sidechain Compressor
Section titled “Example: Sidechain Compressor”dsp effect SidechainComp { input main: stereo; input sidechain: mono; output: stereo;
param threshold: 0.5 range(0, 1); param ratio: 4.0 range(1, 20); state env: 0.0;
fn process(main_l, main_r, sc) -> (out_l, out_r) { let level = abs(sc); let target = max(level - threshold, 0.0) * (1.0 - 1.0 / ratio); if target > env { env = env + (target - env) * 0.01; } else { env = env + (target - env) * 0.001; } let gain = 1.0 / (1.0 + env); return (main_l * gain, main_r * gain); }}
let comp = SidechainComp();let drums = AudioTrack("drums");let bass = AudioTrack("bass");drums.load_effect(comp);comp.connect_input("sidechain", bass);Parameter Modulation
Section titled “Parameter Modulation”Effect parameters support the << operator for both static values and signal modulation:
let d = Delay(0.25, 0.5);drums.load_effect(d);
// Static valuesd.Time << 0.1;d.Feedback << 0.8;
// Signal modulationd.Time << Sine(2).range(0.1, 0.4);filter.Cutoff << Sine(1).range_exp(200, 4000); // Exponential for frequency
// Automation breakpoints via .modulate()d.Feedback.modulate(#[0, 0.3], #[4, 0.9]);d.Time.modulate(#[0, 0.1], #[2, 0.4, "exp"], #[4, 0.1]);Curve types: "linear", "exp", "ease-in", "ease-out", "ease-in-out", "ease", "bezier(x1,y1,x2,y2)".
Effect Management
Section titled “Effect Management”Effects use named slots for idempotent loading. Each effect carries a slot name (defaults to the constructor name). load_effect replaces any existing effect with the same slot name instead of accumulating duplicates.
Track Effects
Section titled “Track Effects”let drums = AudioTrack("drums");
drums.load_effect(Delay(0.25, 0.5)); // Slot: "Delay"drums.load_effect(Delay(0.5, 0.3)); // Replaces "Delay" slotdrums.load_effects(#[Lowpass(800), Reverb(0.5, 0.3)]);
// Custom slot names for multiple effects of the same typedrums.load_effect(Delay(0.125, 0.2, "short_echo"));drums.load_effect(Delay(0.5, 0.4, "long_echo"));
drums.get_effect("short_echo"); // Get by slot namedrums.effects(); // List loaded effectsdrums.swap_effects(0, 1); // Swap effect orderdrums.remove_effect(0); // Remove and return effectdrums.clear_effects(); // Remove all effectsMaster Bus Effects
Section titled “Master Bus Effects”master.load_effect(PlateReverb(0.7, 0.4, 0.8));master.load_effects(#[Lowpass(8000), Delay(0.25, 0.3)]);master.get_effect("PlateReverb");master.effects();master.swap_effects(0, 1);master.remove_effect(0);master.clear_effects();Routing Methods
Section titled “Routing Methods”Overview
Section titled “Overview”| Method | Args | Returns | Description |
|---|---|---|---|
.send_to(dest, amount) | AudioTrack/Master, Number/Signal/Pattern | AudioTrack | Additive send (dry stays at 1.0) |
.xsend_to(dest, amount) | AudioTrack, Number/Signal/Pattern | AudioTrack | Crossfade send (dry = 1.0 - amount) |
.send(amount) | Number/Signal/Pattern | Send | Create Send value for >> chains |
.send_level(dest) | AudioTrack/Master | SendParam | Send param ref for automation |
.reset_routing() | — | AudioTrack | Clear routes, restore default master route |
.routing() | — | Nul | Print track routing info |
.send_to(dest, amount)
Section titled “.send_to(dest, amount)”Routes a copy of audio to another track. The dry signal continues to its normal destination at full level.
drums.send_to(reverb_bus, 0.3); // 30% to reverbdrums.send_to(delay_bus, Sine(4).range(0.1, 0.5)); // Signal-modulated.xsend_to(dest, amount)
Section titled “.xsend_to(dest, amount)”Exclusive send — routes audio while reducing the dry signal. Dry level becomes 1.0 - amount.
drums.xsend_to(drum_bus, 1.0); // All signal to bus, nothing to masterdrums.xsend_to(wet_bus, 0.7); // 70% wet, 30% dry.send(amount)
Section titled “.send(amount)”Creates a Send value for use in >> chains:
drums >> reverb_bus.send(0.3) >> master;.send_level(dest)
Section titled “.send_level(dest)”Returns a SendParam reference for an existing send, for use with automation:
drums.send_to(reverb_bus, 0.3);let rev_send = drums.send_level(reverb_bus);rev_send << automation(#[0, 0.3], #[8, 0.8]);.reset_routing()
Section titled “.reset_routing()”Clears all routes and send modulations, restoring the default master route at 1.0. Chainable:
drums.reset_routing();drums.reset_routing().send_to(reverb_bus, 0.5);.routing()
Section titled “.routing()”Prints routing info for the track:
drums.routing();routing() Function
Section titled “routing() Function”Prints the routing graph. Called with no arguments for the full graph, or with track arguments for specific tracks:
routing() // Full graphrouting(drums) // Per-trackrouting(drums, bass) // Multiple tracksEffect (External Plugin)
Section titled “Effect (External Plugin)”Loads a CLAP or VST3 effect plugin.
Effect(name) // Load by bundle nameEffect(name, plugin_id) // Load with explicit plugin IDInstrument (External Plugin)
Section titled “Instrument (External Plugin)”Loads a CLAP or VST3 instrument plugin.
Instrument(name) // Load by bundle nameInstrument(name, plugin_id) // Load with explicit plugin IDPlugin Parameter Methods
Section titled “Plugin Parameter Methods”Methods available on plugin effects and instruments:
| Method | Description |
|---|---|
.name() | Get plugin name |
.params() | Print all parameters as a table (with range, default, value) |
.params(filter) | Print parameters matching a filter substring |
.param(path) | Get parameter value |
.set_param(path, value) | Set parameter value (chainable) |
.set_param_norm(path, value) | Set parameter using normalized 0–1 value (chainable) |
.save_state(path) | Save plugin state to file (chainable) |
.load_state(path) | Load plugin state from file (chainable) |
.supports_gui() | Check if the plugin supports a GUI (returns Boolean) |
.show_gui() | Open the plugin GUI window |
.hide_gui() | Close the plugin GUI window |
let synth = Instrument("My Synth");synth.params(); // prints parameter tablesynth.param("clap/0"); // 0.5synth.set_param("clap/0", 0.8) .set_param("clap/1", 0.3);synth.set_param_norm("clap/0", 0.5); // set using normalized 0-1 value
// Save and restore plugin statesynth.save_state("presets/my_patch.preset");synth.load_state("presets/my_patch.preset");
// Plugin GUIif synth.supports_gui() { synth.show_gui(); // Opens the plugin's native GUI window}synth.hide_gui(); // Close the GUI windowSignal Generators
Section titled “Signal Generators”| Function | Output Range | Description |
|---|---|---|
Sine(n) / Sine2(n) | 0-1 / -1 to 1 | Sine wave |
Saw(n) / Saw2(n) | 0-1 / -1 to 1 | Sawtooth wave |
Tri(n) / Tri2(n) | 0-1 / -1 to 1 | Triangle wave |
Square(n) / Square2(n) | 0-1 / -1 to 1 | Square wave |
Rand(n) | 0-1 | Random noise |
Perlin(n) | 0-1 | Smooth Perlin noise |
All accept: no arg (1 cycle/cycle), number (N cycles/cycle), or hz(n) (absolute frequency).
Signal Methods
Section titled “Signal Methods”| Method | Description |
|---|---|
range(min, max) | Map output to [min, max] (linear) |
range_exp(min, max) | Map output to [min, max] (exponential) |
retrigger(mode) | Phase reset: "cycle", "beat", or "free" |
in_seconds() | Convert automation timebase to seconds |
at(time, value, curve) | Add breakpoint to automation |
smooth(time_ms) | One-pole lowpass smoothing (removes zipper noise) |
let lfo = Sine(4).range(0.2, 0.8);filter.Cutoff << Sine(1).range_exp(20, 20000); // Exponential for frequencySine(4).retrigger("beat"); // Reset phase every beatCc(74).smooth(50); // 50ms smoothing on CC inputmaster
Section titled “master”The master constant represents the main audio output. All audio must route to master to be heard.
drums >> master;Tracks without explicit routing go to master automatically.
See Also
Section titled “See Also”- Signal Methods - Detailed signal and automation reference
- Built-in Functions - All function signatures
- Routing - Audio routing guide