Speak and Spell 2 — Hack The Beats · Hack The Beats

bpm
—
bar
—
/*
  @title Speak and Spell 2
  @by Hack The Beats
  @license CC BY 4.0
  Change the word in say, then press update.
  grit is the crush. chip is the speaker. bend is the pitch wobble.
  @try Say hello: `'robot'` -> `'hello'`
  @try 808 drums: `RolandTR909` -> `RolandTR808`
  @try Bass up an octave: `f#2@2 d2 a1 c#2` -> `f#3@2 d3 a2 c#3`
  @try Busier hats: `hh*8` -> `hh*16`
*/

setcps(136/60/4)

samples('github:tidalcycles/dirt-samples')

const say = 'robot'
const letters = String(say)
  .toLowerCase()
  .replace(/[^a-z]/g, '')
  .split('')
  .map(c => c.charCodeAt(0) - 97)

const duck = "{1 0.5 0.78 0.58 1 0.5 0.82 0.6}*2"
const cut = slider(1800, 600, 4000)
const bassCut = slider(440, 160, 6000)
const space = slider(0.15, 0, 1)
const arpCut = slider(1600, 400, 8000)
const grit = slider(5, 1, 8, 1)
const chip = slider(6, 1, 12, 1)
const bend = slider(1, 0.9, 1.12)

const lift = "<0@12 1@4 0@12 1@4>"
const wash = "<0@16 1@8 0@8>"

const toy = x => x
  .speed(bend)
  .coarse(chip)
  .crush(grit)
  .hpf(280)
  .lpf(cut)
  .lpq(2)
  .clip(1)

DRUMS: stack(
  s("bd*4").bank("RolandTR909").gain(0.95),
  s("~ cp ~ cp").bank("RolandTR909").gain(0.6),
  s("hh*8").bank("RolandTR909").gain("{0.32 0.14}*4"),
  s("~ ~ oh ~").bank("RolandTR909").gain(0.26),
  s("rim ~ ~ rim").bank("RolandTR909").gain(0.12).mask(lift),
)
.postgain(0.9)
._punchcard({ height: 90, width: 640 })

CLICK: s("hh").bank("RolandTR909")
  .struct("x ~")
  .speed(1.8)
  .hpf(2500)
  .gain(0.18)
  ._punchcard({ height: 40, width: 640 })

BASSLINE: note("f#2@2 d2 a1 c#2".slow(4))
  .struct("x - x - - x - - x - - x - - - -")
  .sound("[sine, square]")
  .attack(0.01).decay(0.26).sustain(0.3)
  .release("<0.35 0.2>".fast(2))
  .lpf(bassCut).lpq(5)
  .gain(0.6)
  .postgain(duck)
  .o(2)
  ._punchcard({ height: 70, width: 640 })

CHORDS: note("<[f#3,a3,c#4] [d3,f#3,a3] [a3,c#4,e4] [c#3,e3,g#3]>".slow(2))
  .sound("gm_pad_halo")
  .attack(0.12).decay(1.4).sustain(0.4).release(1.2)
  .lpf(sine.range(600, 1800).slow(8))
  .room(space)
  .gain(0.16)
  .postgain(duck)
  .o(2)
  ._punchcard({ height: 70, width: 640 })

MAIN_CHOP: toy(
  s("alphabet").n(cat(...letters)).fast(2)
    .speed("<1 1.06 0.94 1.03 0.97>")
)
  .room(space)
  .delay(0.18).delayfeedback(0.2)
  .gain(0.95)
  .o(2)
  ._punchcard({ height: 80, width: 640 })
  ._scope({ width: 640, height: 80 })

ANSWER: toy(s("speakspell").n("<0 4 5 6>").struct("~ ~ x ~"))
  .room(space)
  .gain(0.7)
  .mask(lift)
  .o(2)
  ._punchcard({ height: 70, width: 640 })
  ._scope({ width: 640, height: 60 })

BEEP: note("c6").sound("square")
  .struct("~ ~ ~ x")
  .decay(0.08).sustain(0)
  .lpf(cut)
  .gain(0.2)
  .mask("<0@4 1>")
  ._punchcard({ height: 40, width: 640 })

ARP: note("<f#4 a4 c#5 e5 d5 c#5 a4 f#4>".fast(4))
  .sound("square")
  .decay(0.12).sustain(0)
  .lpf(arpCut)
  .room(space)
  .gain(0.22)
  .mask("<0@8 1@24>")
  .o(2)
  ._punchcard({ height: 70, width: 640 })

WASH: toy(s("alphabet").n(cat(...letters)))
  .room(0.4)
  .gain(0.2)
  .mask(wash)
  .o(2)
  ._punchcard({ height: 60, width: 640 })

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

Speak and Spell 2

by Hack The Beats · 136 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 Hack The Beats, after Skratch Bastid · 131 bpm
      2. Speak and Spell 2 by Hack The Beats · 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.

      Go live on YouTube

      What you play here goes out on @hackthebeats as you play it: both decks, the code, every knob and pad. The stream runs a few seconds behind you, and takes a minute or two to start.

        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.

        Open in your browser

        Google does not allow sign-in inside this app. Open this page in your browser, then sign in there.

        The link carries your knob positions, so the beat comes back as you left it.

        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 and ending on a card with the song's address. Turn a knob while it records and the clip calls it out. Nothing is uploaded. Learn more

        Connected AI

        Let your Claude or ChatGPT read your songs and propose changes. Everything it proposes arrives here as a draft: it plays only when you tap it, and is kept only when you say so. How it works

        The address

        What it may do

        Connected apps

          Drafts

          What your AI has proposed and you have not answered yet. A draft plays only when you tap it, over the music, and is kept only when you say so.

            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.

            Speak and Spell 2 — Hack The Beats

            Change the word in say, then press update.

            grit is the crush. chip is the speaker. bend is the pitch wobble.

            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 player is free software under the same licence, with no warranty: download its source for this version.

            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