/*
@title Sweet Child Scratch
@by JOSHC, after Skratch Bastid
Skratch Bastid's house-party routine on "Sweet Child O' Mine" (Guns N' Roses), transcribed bar by bar
@try Clean guitar: `gm_overdriven_guitar` -> `gm_electric_guitar_clean`
@try Scratch on "ooh": `vowel("a")` -> `vowel("o")` in SCRATCH
@try Hook on guitar: `s("sawtooth").vowel("o")` -> `s("gm_distortion_guitar")` in HOOK
The riff and the changes belong to Guns N' Roses. Keep this one private.
*/
setcps(130.5/60/4)
const tone = slider(5509, 400, 8000)
const drive = slider(0.718, 0, 0.8)
const cuts = slider(0, 0, 1)
const air = slider(0.25, 0, 0.8)
all(x => arrange([26, x.ribbon(0, 26)])) // bars kept, in order (trimmed on the deck)
RIFF: note("[<~!4 c#4!2 d#4!2 f#4!2 c#4!2 ~!8 c#4!2 d#4!2 f#4!2 c#4!2 ~!6 c#4!2> c#5 g#4 f#4 f#5 g#4 f5 g#4]")
.mask("<0!4 1!8 0!8 1!8 0!6 1!2>")
.s("gm_overdriven_guitar")
.clip(0.95)
.shape(drive)
.lpf(tone)
.hpf("<30!26 900 500 30!8>")
.gain("<0.7!26 0.35 0.5 0.7!8>")
.room(air)
._pianoroll()
PADS: note(`<
[c#5 c#4 c#5 c#4 ~ ~ ~ ~ c#4 c#4 c#5 ~ ~ g#4 f#4 ~]
[c#4 ~ c#4 ~ ~ c#4 ~ c#4 ~ c#5 ~ ~ ~ c#4 c#4 ~]
[~ ~ c#4 ~ ~ c#4 c#4 c#4 ~ ~ c#5 ~ c#4 c#4 ~ c#4]
[c#5 ~ ~ c#4 ~ c#4 ~ ~ c#4 ~ c#4 c#4 ~ c#4 ~ c#4]
~!8
[c#4 ~ c#4 ~ ~ c#4 c#4 ~ c#4 ~ c#4 ~ c#4 c#4 ~ ~]
[c#4 c#4 c#4 ~ ~ ~ c#4 ~ c#4 ~ ~ ~ ~ ~ ~ ~]
[c#4 c#4 c#4 ~ ~ c#4 c#4 c#4 ~ ~ c#4 ~ ~ c#4 ~ ~]
[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~ ~ ~ ~ ~ ~ ~ ~ c#5 c#5 ~ ~ ~ ~ ~ ~]
>`)
.s("sawtooth")
.vowel("a")
.penv("[14 -14]*8")
.pattack(0.03)
.pdecay(0.07)
.decay(0.1)
.sustain(0)
.lpf(3500)
.gain(cuts)
._scope()
BASS: note(`<
[c#2*8]!4
[c#2*8]!2 [b1*8]!2 [f#1*8]!2 [c#2*8]!2
[c#2*8]!8
[c#2*8]!2 [b1*8]!2 [f#1*8]!2
g#1 [g#1 g#1 g#1 g#1]
[c#2 c#2 f2 g#2] [g#2 g#2 f2 c#2] [b1 b1 f#2 b1] [b1 e2 e2 b1] [f#2 f#2 f#2 c#2] [f#2 f#2 f#2 c#2]
[c#2*8] [c#2 c#2 c#2 c#2 g#1 a#1 b1 c2]
>`)
.s("gm_electric_bass_pick")
.clip(0.9)
.lpf(1200)
.gain(0.8)
._scope()
// bar 0 is a silent note, so the distortion guitar has loaded before the drop
CHORDS: note("<c#3 ~!27 [c#3,g#3,c#4] [c#3,f3,g#3] [b2,d#3,f#3] [e3,g#3,b3,d#4] [f#2,c#3,f#3]!2 [c#3,g#3,c#4] [[c#3,g#3,c#4] ~]>")
.s("gm_distortion_guitar")
.shape(drive)
.lpf(tone)
.gain("<0.0001 0.55!35>")
.room(air)
._spectrum()
HOOK: note("<~!28 [c#4@3 f4@5] [c#4@2 ~ g#4 ~ f4 c#4 f4] [~ f#4@6 ~] [e4 d#4@2 e4@2 d#4 ~ c#4] [c#4@2 f#4 c#4@5] [c#4 f#4@6 c#4] [c#4@3 ~] ~>")
.s("gm_distortion_guitar")
.vib(5).vibmod(0.15)
.attack(0.04)
.release(0.2)
.lpf(2400)
.gain(0.3)
.room(air)
._pianoroll()
KICK: s("<[bd ~ ~ ~ ~ ~ bd ~ ~ ~ ~ ~ ~ ~ ~ ~] [bd ~ ~ ~ ~ ~ bd ~ ~ ~ bd ~ ~ bd ~ ~]>")
.mask("<1!14 0!5 1!7 0!8 1!2>")
.gain(0.9)
._punchcard()
SNARE: s("<[~ ~ ~ ~ sd ~ ~ ~ ~ ~ rim ~ sd ~ ~ rim]!26 ~ [~ ~ ~ ~ ~ ~ ~ ~ ~ sd sd ~ ~ sd sd sd] ~!6 [~ ~ ~ ~ sd ~ ~ ~ ~ ~ rim ~ sd ~ ~ rim] [~ ~ ~ ~ sd ~ ~ ~ sd ~ sd sd sd sd sd sd]>")
.gain(0.75)
._punchcard()
HATS: s("hh*8")
.mask("<1!26 0!6 1!4>")
.gain("[0.5 0.3]*4")
.postgain("<1!19 1.5 1!12 0.5 0.8 1 1>")
._punchcard()
CRASH: s("<cr ~!27 cr ~!5 cr ~>")
.gain(0.7)
.room(air)
Deck B is empty
Load a second beat here, then bring it in with the crossfader or Mix.
How two decks workFirst steps
That's the loop: play it, bend it, change it, keep it, pass it on. Press ? for every key, or read the guide.
Live-coded music · press play
Sweet Child Scratch
by JOSHC, after Skratch Bastid · 131 bpm
The code is the score. It plays itself — you mix it.
Shared song
A song is code, and running it lets that code act as you on this site. The code is on the stage behind this message: read it, and run it only if you trust who sent it.
Sign in to play
Shared song
This link no longer works