Skip to content

Quick Reference

SyntaxNameDescription
[a b c]SequentialElements play one after another
[[a b] c]NestedInner group subdivides time slot
[a, b]ParallelElements play simultaneously (chord)
<a b c>AlternatingOne element per cycle, rotating
[C4 D4 E4] // C4 then D4 then E4
[[C4 D4] E4] // C4-D4 in first half, E4 in second
[C4, E4, G4] // C major chord
<C4 D4 E4> // Cycle 1: C4, Cycle 2: D4, Cycle 3: E4
ModifierNameDescription
*nFastRepeat n times within slot
@nWeightExtend duration to n slots
!nReplicateCreate n separate slots
(k,n)Euclideank hits distributed over n steps
(k,n,r)Euclidean rotatedRotated by r steps
[bd*4] // Four kicks in one slot (16ths)
[C4@2 D4] // C4 gets 2/3 time, D4 gets 1/3
[C4!4] // Equivalent to [C4 C4 C4 C4]
[bd(3,8)] // 3 kicks spread over 8 steps
[sd(5,8,2)] // 5 snares over 8 steps, rotated by 2
MethodDescription
.length()Number of elements
.reverse()Reverse order
.rotate(n)Shift left (positive) or right (negative)
.transpose(n)Pitch shift by n semitones
.concat(pat)Append another pattern
.fast(n)Speed up by factor n
.slow(n)Slow down by factor n
.stack(pat)Layer with another pattern
.degrade(p)Randomly drop notes (0.0-1.0)
.nudge(offsets)Per-step timing offsets
.swing(amount)Swing timing feel
.humanize(amount)Deterministic timing variation
[C4 D4 E4].reverse() // [E4 D4 C4]
[C4 D4 E4].transpose(12) // Up one octave
[C4 D4].concat([E4 F4]) // [C4 D4 E4 F4]
CommandDescription
PLAYStart or resume playback
PAUSEPause playback (resume with PLAY)
STOPFull stop (resets position, mutes audio)
RECORDStart playback and record on armed tracks
SEEK exprJump to a cycle position
PRINT exprPrint value with newline
PUT exprPrint value without newline
let x = valueDeclare variable
x = valueReassign variable
// MIDI track (channel 1-16, optional velocity 0-127)
let track = MidiTrack(1);
let track = MidiTrack(10, 100); // Channel 10, velocity 100
// Audio track with sampler
let drums = AudioTrack("drums");
drums.load_instrument(Sampler(Kit("cr78")));
// Retrieve loaded instrument for parameter tweaking
let kit = drums.get_instrument();
// Send pattern to track
track << [C4 D4 E4];
drums << [bd sd bd sd];
Method / OperatorDescription
<<Send pattern to track
>>Route audio between tracks
.send_to(dest, amount)Additive send (dry stays at 1.0)
.xsend_to(dest, amount)Crossfade send (dry = 1.0 - amount)
.send(amount)Create Send value for >> chains
.send_level(dest)Send param ref for automation
.reset_routing()Clear routes, restore default master route
.routing()Print track routing info
routing()Print full routing graph
drums >> master;
drums.send_to(reverb_bus, 0.3);
drums >> reverb_bus.send(0.3) >> master;

Effect constructors are part of the prelude and available globally — no import needed.

ConstructorDescription
Delay(time, feedback)Delay (0.25s, 0.5)
Lowpass(cutoff, resonance)Low-pass filter
Highpass(cutoff, resonance)High-pass filter
Bandpass(cutoff, resonance)Band-pass filter
Notch(cutoff, resonance)Band-reject filter
Allpass(cutoff, resonance)Phase-shift filter
Peak(cutoff, resonance)Bell/EQ filter
Reverb(room, damp, width, mix)Freeverb reverb
PlateReverb(size, damp, diff, pre, mix)Dattorro plate reverb
Overdrive(drive, tone)Tube-style soft clipping
Distortion(drive, tone)Transistor-style hard clipping
drums.load_effect(Delay(0.25, 0.7));
drums.load_effect(Lowpass(800));
MethodDescription
.load_effect(fx)Add effect to track chain
.load_effects(#[...])Add multiple effects
.effects()List loaded effects
.swap_effects(i, j)Swap effect order
.remove_effect(i)Remove and return effect
.clear_effects()Remove all effects
drums.load_effect(Reverb(0.5, 0.3));
drums.load_effects(#[Lowpass(800), Delay(0.25, 0.5)]);
drums.swap_effects(0, 1);
ShortSampleShortSample
bdBass drumcbCowbell
sdSnaremaMaracas
hhHi-hattbTambourine
cyCymbalguGuiro
cpClaphbHigh bongo
rsRimshotlbLow bongo
meMetal beatlcLow conga
clClave

Velocity:

MethodVelocityDescription
.vel(v)CustomSet velocity (0 to infinity)
.ghost()0.3Ghost note (quiet)
.soft()0.5Soft hit
.accent()1.0Accented hit
.loud()1.2Loud hit

Transformations:

MethodDescription
.slice(start, end)Play portion of sample (0-1 range)
.reverse()Play sample backwards
.pitch(semitones)Pitch shift sample
.pan(position)Stereo position (-1.0 to 1.0)
drums << [bd.loud sd.soft];
drums << [bd.pan(-1) sd.pan(1)];
drums << [bd.pitch(12) sd.reverse()];

Notes use scientific pitch notation: C4 is middle C.

  • Range: C-1 to G9
  • Sharps: C#4, D#4, F#4, etc.
  • Flats: Db4, Eb4, Bb4, etc.
  • Rest: _ (underscore)
if condition { }
if condition { } else { }
loop { break; }
do 5 { }
for x in Array(1, 2, 3) { }
for i in range(5) { }
fn name(param1, param2) {
return value;
}
// Anonymous function
let double = fn(x) { return x * 2; };
// Higher-order
arr.map(fn(x) { return x * 2; });
arr.filter(fn(x) { return x > 0; });
arr.reduce(fn(acc, x) { return acc + x; }, 0);
let d = #{"key": value, 200: "OK"};
d["key"] // Access
d.get("key") // Access (NUL if missing)
d.set("new", val) // Mutate
d.keys() // Array of keys
d.merge(other) // New merged dict
match value {
1 => "one",
n if n > 10 => "big",
_ => "other",
}
stream(initial, fn(prev, cycle) { ... })
markov(states, transitions, initial)
class MyPattern {
fn new() { ... }
fn query(cycle) { ... } // Script pattern
}

Lazy (return iterator):

MethodDescription
.take(n)First n elements
.skip(n)Skip first n elements
.step_by(n)Every nth element
.enumerate()Yield [index, value] pairs
.zip(iter)Pair elements from two iterators
.chain(iter)Concatenate two iterators

Eager (consume iterator):

MethodDescription
.next()Next element or NUL
.collect()Gather into array
.find(fn)First match or NUL
.any(fn)True if any match
.all(fn)True if all match
let nums = Array(1, 2, 3, 4, 5);
nums.iter().skip(1).take(3).collect(); // [2, 3, 4]
nums.iter().any(fn(x) { return x > 4; }); // true
rand(seed) // Deterministic [0, 1)
choose(seed, array) // Deterministic pick
choose_weighted(seed, arr, weights) // Weighted pick
rand_true() // Non-seekable
choose_true(array) // Non-seekable
Scale("major") // Built-in scale value
Scale(#[0, 2, 4, 5, 7, 9, 11]) // Custom scale from semitones
s.mode(2) // Rotate to nth mode
s.intervals() // Interval array
s.contains(7) // Check interval membership
scale(C4, "major") // Array of scale notes
scale(C4, my_scale) // Also accepts Scale values
scale_degree(C4, "major", 5) // G4
Key(C4, "major") // Key from string
Key(C4, Scale("major")) // Key from Scale value
chord(C4, "min7") // Array of chord notes
chord(C4, "major", 1) // First inversion
interval(C4, "P5") // G4
ConstructorRangeDescription
Sine(n) / Sine2(n)0-1 / -1 to 1Sine wave
Saw(n) / Saw2(n)0-1 / -1 to 1Sawtooth wave
Tri(n) / Tri2(n)0-1 / -1 to 1Triangle wave
Square(n) / Square2(n)0-1 / -1 to 1Square wave
Rand(n)0-1Random noise
Perlin(n)0-1Smooth Perlin noise

All accept: no arg (1 cycle/cycle), number (N cycles/cycle), or hz(n) (absolute frequency).

MethodDescription
.range(min, max)Linear mapping to [min, max]
.range_exp(min, max)Exponential mapping (for frequencies)
.retrigger(mode)Phase reset: "cycle", "beat", "free"
.smooth(time_ms)One-pole lowpass smoothing
OperatorExampleDescription
+Sine(1) + Saw(3)Sum signals
-Sine(1) - Tri(2)Subtract signals
*Sine(1) * 0.5Scale / ring mod
/Sine(1) / Saw(2)Divide signals
- (unary)-Sine(1)Negate
Sine(4).range(0.2, 0.8) // LFO with range
Sine(1).range_exp(20, 20000) // Exponential for freq
(Sine(1) + Saw(3)) * 0.5 // Mix two LFOs
Sine(2) * 0.3 + 0.5 // Scale + offset
Cc(74).smooth(50) // MIDI CC signal
CurveDescription
"linear"Straight line (default)
"step"Instant jump
"exp"Exponential curve
"smooth"Smooth interpolation
"ease-in"Slow start, fast end
"ease-out"Fast start, slow end
"ease-in-out"Slow start and end
"ease"CSS-style ease
"bezier(x1,y1,x2,y2)"Custom cubic bezier
automation(#[0, 0], #[2, 1.0, "exp"], #[4, 0])
d.Feedback.modulate(#[0, 0.3], #[4, 0.9]);
pattern.nudge([0, 0.25, 0, -0.1]) // Per-step offsets (step-relative)
pattern.swing(0.25) // Swing feel
pattern.humanize(0.1) // Human touch
CallDescription
timeline(length)Create a fixed-length timeline
.at(start, duration)Create a slot at cycle offset
.length()Get timeline length in cycles
.entries()Get number of entries
let t = timeline(16);
t.at(0, 8) << [bd _ sd _]; // Verse
t.at(8, 8) << [bd*4]; // Chorus
drums << t; // Assign to track
CallOutput
render(cycles)Master mix
render(track, cycles)Single track
render(#[tracks], cycles)Multiple tracks
render(#[drums, bass, master], 4);
Method / CommandDescription
.input(device)Route audio input device to track
.arm() / .disarm()Arm/disarm track for recording
.monitor("in"/"off")Enable/disable input monitoring
RECORDStart playback and record armed tracks
.take()Retrieve last recording
.duration() / .samples()Recording info
.save("path")Save recording to WAV
let mic = AudioTrack("mic");
mic = mic.input("MacBook Pro Microphone");
mic = mic.arm().monitor("in");
RECORD;
// ... perform ...
PAUSE;
mic.take().save("recording.wav");
FunctionDescription
setbpm(bpm)Set tempo (4 beats per cycle)
setbpm(bpm, beats)Set tempo with custom beats per cycle
project_title(title)Set project title
project_artist(artist)Set artist name
project_bpm(bpm)Set project BPM
midi_input_connect("port", "alias")
track.input("alias").monitor("in")
midi_export(pattern, 4) // Export to MIDI file
FunctionDescription
midi_clock_send(bool)Enable/disable master clock output (24 PPQ)
midi_clock_follow(alias)Sync to external clock on input port
midi_clock_offset(ms)Clock-only timing offset
midi_delay(ms)Global MIDI output delay
midi_clock_send(true);
midi_delay(15);
plugin_scan()
plugin_list()
let fx = Effect("name")
fx.params() // prints parameter table
fx.set_param("Cutoff", 2000) // set by actual value
fx.set_param_norm("Cutoff", 0.5) // set by normalized 0-1 value
fx.save_state("preset.preset")
SubcommandDescription
(none)Start REPL or run a .non file
serverStart WebSocket server for remote execution
view <name>Launch TUI view (console, mixer, routing, midi_monitor)
versionList, show, or switch installed versions
pluginScan or list CLAP plugins
pkgInstall, list, or inspect packages
Terminal window
resonon server --server-port 6000
resonon view mixer
resonon plugin scan

Config file: ~/.config/resonon/config.toml

SectionKey options
Top-levellib_paths, kit_paths, cycle_time, viz_resolution
[audio]output_device, input_device, sample_rate, master_channels
[midi]output_port, input_port
[[midi.outputs]]alias, port (named output ports)
[[midi.inputs]]alias, port (named input ports)

See Configuration Reference for full details.

Terminal window
resonon pkg install gh:user/repo
resonon pkg list
resonon pkg inspect name
ShortcutAction
Cmd+EnterExecute selection or line
Cmd+Shift+EnterExecute entire file