Pattern Syntax¶
Learn the mini notation language for writing patterns in r0astr.
Mini Notation Basics¶
r0astr uses Strudel's mini notation - a concise language for describing musical sequences.
Sequences¶
Space-separated sounds play one after another within a cycle:
Rests (Silence)¶
Use ~ to create silence:
Multiplication¶
Repeat a sound multiple times with *:
s("bd*4") // Bass drum 4 times per cycle
s("hh*8") // Hi-hat 8 times per cycle
s("bd*2 sd") // Two kicks, then one snare
Subdivision¶
Use [] to subdivide time - items inside share the parent's time slot:
s("bd [hh hh]") // bd gets half, two hh share the other half
s("bd [sd sd sd]") // bd gets half, three snares share the other half
s("[[bd bd] hh] sd") // Nested subdivision
Stacking (Layering)¶
Use , to play sounds simultaneously:
s("bd*4, ~ sd ~ sd") // Kick pattern + snare pattern together
s("bd*4, ~ sd ~ sd, hh*8") // Full drum kit layered
Alternation¶
Use <> to alternate between options each cycle:
s("<bd sd>") // bd first cycle, sd second cycle
s("<bd sd cp>") // Cycles through three sounds
note("<c3 e3 g3>") // Cycles through three notes
Sound Sources¶
Samples with s()¶
Play built-in samples using s():
Common Sample Names:
| Name | Sound |
|---|---|
bd |
Bass drum / Kick |
sd |
Snare drum |
hh |
Hi-hat |
oh |
Open hi-hat |
cp |
Clap |
rim |
Rimshot |
tom |
Tom |
ride |
Ride cymbal |
Synths with note()¶
Generate tones using note() with note names:
note("c3 e3 g3") // Play notes
note("c3 e3 g3").s("sawtooth") // Choose synth type
note("c3 e3 g3").s("triangle") // Different synth
Synth Types:
| Type | Sound |
|---|---|
sawtooth |
Bright, buzzy (good for bass) |
triangle |
Soft, flute-like |
square |
Hollow, video-game style |
sine |
Pure tone, smooth |
Scales with n()¶
Use scale degrees instead of note names:
n("0 2 4 5").scale("C:major") // C D E F
n("0 1 2 3").scale("C:minor") // C D Eb F
n("0 2 4").scale("A3:minor") // Am chord
Common Modifiers¶
Chain modifiers after your pattern to shape the sound:
Quick Reference¶
| Modifier | Description | Range | Example |
|---|---|---|---|
.gain(n) |
Volume level | 0-1 | .gain(0.5) |
.lpf(hz) |
Low-pass filter cutoff | 20-20000 | .lpf(800) |
.hpf(hz) |
High-pass filter cutoff | 20-20000 | .hpf(200) |
.fast(n) |
Speed up pattern | 0.5-8 | .fast(2) |
.slow(n) |
Slow down pattern | 0.5-8 | .slow(2) |
.room(n) |
Reverb amount | 0-1 | .room(0.5) |
.delay(n) |
Delay amount | 0-1 | .delay(0.25) |
.pan(n) |
Stereo position | -1 to 1 | .pan(-0.5) |
Volume with .gain()¶
Control volume from 0 (silent) to 1 (full):
Filters with .lpf() and .hpf()¶
Low-pass filter removes high frequencies (makes sound duller):
High-pass filter removes low frequencies (makes sound thinner):
Speed with .fast() and .slow()¶
Change pattern speed:
s("bd sd bd sd").fast(2) // 2x speed (8 hits per cycle)
s("bd sd bd sd").slow(2) // Half speed (takes 2 cycles)
Reverb with .room()¶
Add space and ambience:
Sliders¶
Add interactive sliders to control values in real-time.
Basic Syntax¶
default: Starting valuemin: Minimum valuemax: Maximum value
Usage Example¶
This creates a slider that: - Starts at 800 Hz - Can be adjusted from 100 Hz to 5000 Hz - Updates the filter in real-time as you drag
Multiple Sliders¶
Each slider appears in the card's control area:
Example Patterns¶
Copy-paste these into r0astr to try them.
Drums¶
Four on the Floor
Rock Beat
Breakbeat
Bass¶
Sub Bass
Walking Bass
Synth Bass
Melody¶
Arpeggiated Chord
Chord Stabs
Lead Line
Ambient¶
Soft Pad
Shimmer
Combining Techniques¶
Build complex patterns by combining these techniques:
// Evolving bass with slider control
note("c2 ~ [c2 c2] eb2")
.s("sawtooth")
.lpf(slider(400, 100, 2000))
.gain(0.6)
.room(0.2)
Next Steps¶
- Practice: Copy patterns above and modify them
- Experiment: Change numbers, add modifiers, break things
- Explore: See Multi-Instrument Guide for using multiple cards
Full Reference¶
This guide covers the essentials. For the complete Strudel reference including all functions, patterns, and advanced techniques: