Overview
strudel.cc is a live-coding environment that can be accessed via the browser. It is written in a javascript-like language.
Usage
This section describes how to interact with strudel.
Setting the BPM
Instead of the more common BPM, strudel actually uses something called cycles, which are basically 60/CPS=BPM, where CPS is 0.5 by default. This means that by default strudel is at 120 bpm. To rather use bpm instead of cycles, you can use something like this:
const BPM= 132
const CPM= BPM/4
setcpm(CPM)
Playing a Melody
We can use the n() operator to create a sound that follows the g minor scale at the 1th octave. The selected sound is a saw:
$: n()
$: n("< [4 11]*4 [1 8]*4 [2 9]*4 [0 7]*4 >")
.scale("G1:Minor")
.sound("Saw")
We tell strudel using <> that everything inside of the brackets should be one per cycle. By default strudel would just try to fit everything into one cycle, so if we add more items betweeen the "", strudel would just play back this section faster. Using the <> tells strudel that we want each item to be played exactly one cycle, aka one bar in our case. This means that item [4 11]*4 will be played one bar long, item [1 8]*4 too etc. Using the [] we tell strudel that we want this section to be repeated 4 times in the time of that one cycle. This results in a crystal-castle like bass.
Aranging a Song
It is possible to store melodies in variables, stack those melodies/patterns together and save this stack in a variable and lastly arange it:
const cpm = 132/4
setcpm(cpm)
let bass = n("<[4 11]*4 [1 8]*4 [2 9]*4 [0 7]*4>")
.scale("G1:Minor")
.sound("Saw")
let arp = n(irand(12).struct("[x - - x - x - x]*2"))
.scale("G4:Minor")
.sound("Saw")
.gain(0.5)
.adsr("0:0:1:0.1")
.room(0.5)
let intro = stack(
arp
)
let full = stack(
bass,
arp
)
arrange(
[8, intro],
[16, full]
)
Here, first the bpm is set, then the melodies defined and then the different stacks. First an intro, where only the arp plays and then the full, where all the instruments play.
Sidechain
It is possible to sidechain sounds using the orbit() and duckorbit() functions:
const BPM= 132
const CPM= BPM/4
setcpm(CPM)
let bass= n("<[4 11]*4 [1 8]*4 [2 9]*4 [0 7]*4>")
.scale("G1:Minor")
.sound("Saw")
.orbit(2)
let arp = n(irand(12).struct("[x - - x - x - x]*2"))
.scale("G4:Minor")
.sound("Saw")
.gain(0.5)
.adsr("0:0:1:0.1")
.room(0.5)
.orbit(3)
let kick = n("< 3 >*4")
.scale("G1:Minor")
.sound("bd")
.duckorbit("2")
.duckattack("0.2:1")
.duckdepth(0.75)
let live = stack(
bass,
arp,
kick
)
arrange(
[8, live]
)