Skip to content

Instantly share code, notes, and snippets.

@marcoonroad
Created February 12, 2026 02:07
Show Gist options
  • Select an option

  • Save marcoonroad/1333bff914557090ce8bbb48602336a5 to your computer and use it in GitHub Desktop.

Select an option

Save marcoonroad/1333bff914557090ce8bbb48602336a5 to your computer and use it in GitHub Desktop.
Darkwave-like Guitar Arp on 31 EDO/TET (Strudel REPL)
let tuning = 216
let root = 216
let edo = 31
let tempo = 135
let signature = 4
let ratio = Math.pow(2, 1/edo)
let frequencies = Array.from(
{ length: edo },
(_, semitone) =>
root * Math.pow(ratio, semitone)
)
let arpSize = 6
let loops = 40
let randomBetween = (min, max) =>
Math.floor(Math.random() * (max - min) + min)
let createRandomArp = (step, size) => {
let startValue =
randomBetween(arpSize, edo - arpSize)
let result = []
let index = 0
for (index = 0; index < size; index += 1) {
result.push(startValue + (step * index))
}
return [].concat(result, result)
}
let playbook = [].concat(...Array.from(
{ length: loops },
_ => Math.random() > 0.35 ?
createRandomArp(1, arpSize) :
createRandomArp(-1, arpSize)
)).map(semitone => semitone.toString())
$: i(slowcat(...playbook))
.tune(frequencies)
.mul(tuning)
.freq()
.sound("gm_electric_guitar_muted")
.soft("1:0.5")
.legato(0.75)
.cutoff(1500)
.resonance(1)
.compressor("-20:5:5:0.001:0.5")
.cpm(tempo/signature)
.fast(signature * 2)
.chorus(0.7)
.room(0.1)
.delay(0.1)
.postgain(0.8)
.attack(0.01)
.release(0.01)
.log()
._pitchwheel({ edo: edo, root: root })
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment