Sweet Child Scratch — JOSHC, after Skratch Bastid · Hack The Beats

bpm
—
bar
—
/*
  @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 ~ ~ ~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!2
  [~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ c#6]
  [~ ~ ~ c#6 c#6 ~ ~ ~ ~ ~ ~ c#6 c#6 ~ c#6 ~]
  ~
  [~ ~ ~ ~ ~ ~ ~ ~ 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 work

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.

    Song knobs

    Channels

    M mute · S solo · ● capture ?

    Pads

    hold ?

    Master

    A
    B

    This is music made by code.

    Every sound you hear comes from the code above, running live in your browser. Press play, then take the knobs: no account needed.

    The knobs are yours. Sign in, free, to change the code, keep your version and share it.

    We store your name, email address and the songs you save. Privacy · About

    Beats

    My songs

      Beats

      1. Sweet Child Scratch by JOSHC, after Skratch Bastid · 131 bpm
      2. Speak and Spell 2 136 bpm
      3. SYSTEM//BREAK by Hack The Beats · 142 bpm

      Click a song to load it on the deck in focus, or pick a deck with A / B.

      Account

      The knobs, channels and pads are free to use. An account adds the rest: editing the code, a second deck, recording, MIDI, and your own songs, kept in your account and shareable by link. It is free.

      We store your name, email address and the songs you save. See the privacy notice.

      Snapshot

      A pinned snapshot loops in time on that deck as a channel of its own, muted until you bring it in with its pad or its M. Learn more

      Unsaved changes

      Share

      More ways to share

      How sharing works

      Video clip

      Recorded live on this device as the music plays, starting on the next bar. Nothing is uploaded. Learn more

      Admin

      The site's beats, in the order the song list shows them. For each, choose who can play it: Anyone makes it a featured beat, which visitors can play without an account (up to six, one chip each on the stage); Members is everyone who is signed in; Only me is you alone. To add a beat, publish one of yours from My songs.

        Patterns already here are skipped. A new beat is yours alone until you say who else can play it.

        Hack The Beats

        Every sound here is made by the code on screen, running live in your browser. Each knob is a slider() from the song, each channel is one of its labelled patterns, and the code is yours to change.

        Sweet Child Scratch — JOSHC, after Skratch Bastid

        Skratch Bastid's house-party routine on "Sweet Child O' Mine" (Guns N' Roses), transcribed bar by bar

        The riff and the changes belong to Guns N' Roses. Keep this one private.

        Keys

        While you are typing in the code, the single-key shortcuts are off.

        Space
        Play or stop the deck in focus
        X
        Switch focus between deck A and deck B
        M
        Mix: start the other deck in time and fade across
        ← →
        Previous or next beat
        1–9 0 - =
        Mute channels 1 to 12
        Q W E A S D
        Hold a pad: echo, drop, wash, half, stutter, no drums. With Shift it stays on.
        T Y U I H J K L
        Snapshot pads 1 to 8: bring one in on the next bar, or stop it. With Shift it plays once. Capture one with ● on a channel in the Mixer (Esc lets a capture go).
        [ ]
        Jump back or forward four bars
        F G
        Follow the music with the code; gallery (full-screen) view
        R B ?
        Record the mix to a WAV file; open the beats list; this help
        V
        Make a video clip of the code and the music (Esc cancels one being recorded)
        Ctrl+.
        Stop the deck in focus (works while typing in the code, too)
        Ctrl+Enter Ctrl+S
        Run your changes without stopping the music; save

        Where things are

        First steps
        A short tour of the loop (play, bend, change, keep, share), one step at a time. Learn more
        Editing
        Click in the code (or press Edit) to change it, Update runs it, and Esc leaves the code. Learn more
        In the code
        Click a track label to mute it, click a highlighted number to find its knob, drag an inline slider. Learn more
        Try
        Try, top left, makes one of the song's suggested changes; tap it again to put it back. Learn more
        Song map
        The sections of the code, beside it (or behind Map when the window is narrow); click one to glide there. Learn more
        Views
        Follow glides the code to whichever track comes in, Split shows both decks' code, Gallery is full screen. Learn more
        Knobs and switches
        Arrows adjust a knob, Shift for fine, Enter or double-click resets it, and Reset puts every knob back to what the code says. Learn more
        Channels
        Each labelled pattern is a channel with a level, a meter, M to mute and S to solo. Learn more
        Pads
        Hold one, or Shift-click (or switch Latch on) to keep it on. Learn more
        Snapshots
        Press ● on a channel in the Mixer to capture it from the next bar, then tap its pad to bring it in. Learn more
        Two decks
        With Sync on, a deck started while the other plays comes in on the bar, and Mix fades across over eight bars. Learn more
        Arrangement
        Which tracks play in each of 32 bars: click a bar to jump there, or drag across bars to pick them and cut, keep, move, copy or paste them. Learn more
        Your songs
        In the beats list: New, Import and Export, and each song's ⋯ menu to rename, duplicate, share or delete it. Learn more
        Sharing
        The link icon shares a song by link, which always plays its latest saved version; Make a video clip there (or V) records the code lighting up with the music. Learn more

        MIDI controller

        Not connected.

        With Learn on, click any knob, fader, pad or button on the deck, then move a control on your hardware. Learn more

        Support the site

        Hack The Beats is free: no ads, no paywall, no subscription. If it has had your head nodding, help us keep hacking the beats. Tell a friend who makes music, share a song you made, and wear the shirt.

        Every shirt helps keep the site running, free, and full of new beats.

        Buy a shirt
        A black long-sleeve shirt with the Hack the Beats logo in white and orange pixels

        Credits and source

        Built on Strudel, © Strudel contributors, under the GNU AGPL v3. This site is free software under the same licence, with no warranty: download the source of this version, or read it on GitHub.

        Hack The Beats is owned and operated by Built By Signal LLC (builtbysignal.com).

        Songs are credited in their own code, and sounds come from public sample packs that belong to their authors. About this site, credits and contact · Privacy