Skip to content

Groovebox ​

Press Play to hear the House pattern. Switch on a kick between two beats, then increase Swing to hear the offbeat move later.

1 · 1 · 1Bar · Beat · Step
124 BPM
8%
Preset
Kick
Snare
Hi-hat
Clap
Bass
Lead
Arp up · A3
Bass note
C2
Wave
Lead arp
RootA3
Master FX
Delay
0.36s
Time
24%
Feedback
12%
Delay send
Reverb
12%
Reverb send

How the pattern plays ​

One transport keeps the six lanes together. Each column represents a sixteenth note, so step 0 falls on beat 0 and step 6 falls halfway between beats 1 and 2. A sequence callback receives the time the note should sound on the audio clock.

Here’s a one-lane version. Call startPattern from a Play button with the URL of a kick sample. Call the function it returns when the listener presses Stop.

typescript
import { createSequence, createSound, createTransport } from 'ez-web-audio'

export async function startPattern(kickUrl: string) {
  const kick = await createSound(kickUrl)
  const transport = await createTransport({ bpm: 124 })
  const sequence = createSequence(transport, { length: '2m', loop: true })

  for (const step of [0, 4, 8, 12, 16, 20, 24, 27, 28]) {
    sequence.at(step / 4, time => kick.playAt(time))
  }
  transport.start()

  return () => {
    transport.stop()
    sequence.dispose()
    transport.dispose()
    kick.dispose()
  }
}

Explore Transport and Sequencer to change how notes fall against the beat, or try the Effects Chain to hear how delay and reverb shape a repeating phrase.