Make a beat

Build a drum groove from kick, snare and hi-hat. Give each part its own rhythm, then play them together.

  • Lesson 2
  • 100 BPM

You will learn

  • Use rests to place drum hits
  • Layer rhythms with fn('stack', …)
  • Accent eight hi-hats without changing their timing

Count four beats

Count “1, 2, 3, 4”. The kick plays on 1 and 3; the snare answers on 2 and 4. Each sequence has four slots, so each slot is one beat. A rest keeps its slot silent.

The sound functions come from the Cookbook. KICK is a low note for the synthesized kick; NOISE is white noise for the snare. Neither needs a sample download.

// Kick on beats 1 and 3, snare on 2 and 4: the backbeat under most pop and rock.
export const kickOneThree = chain(
  fn('note', sequence(KICK, rest(), KICK, rest())),
  ...kickSound(KICK_DEFAULTS),
)
export const snareTwoFour = chain(
  fn('sample', sequence(rest(), NOISE, rest(), NOISE)),
  ...snareSound(SNARE_DEFAULTS),
)

Kick and snare

Ready

Fill the spaces with hi-hats

For the hi-hats, repeat(NOISE, 8) fits eight strikes into one bar: two per beat. Count “1 and 2 and 3 and 4 and”. The kick and snare keep their four-slot grids.

fn('stack', …) plays the three patterns at once. This registry function layers complete patterns; it is different from the Mini-Notation stack helper used for notes in a chord.

export const eighthHats = chain(
  fn('sample', repeat(NOISE, 8)), // Eight hi-hats: two per beat.
  ...hiHatSound(HI_HAT_DEFAULTS),
)

export const rockBeat = chain(
  fn('stack', kickOneThree, snareTwoFour, eighthHats),
  fn('cpm', 25),
)

Eight hi-hats over the beat

Ready

Move one kick

Give the kick eight slots too. Its hits now land on beat 1, beat 3 and the “and” after 3. The other parts stay in place; a denser grid gives you more positions, not a longer bar.

// Eight slots for the kick, while the snare keeps four: each part picks its own grid.
// Kick on beat 1, beat 3 and the half beat after it.
export const busierKick = chain(
  fn('note', sequence(KICK, rest(), rest(), rest(), KICK, KICK, rest(), rest())),
  ...kickSound(KICK_DEFAULTS),
)

export const rockBeatBusier = chain(
  fn('stack', busierKick, snareTwoFour, eighthHats),
  fn('cpm', 25),
)

A busier beat

Ready

Make it yours

Change the controls, then press Play. While playing, changes apply live; while stopped, they wait for your next Play. The Strudel output tab shows your current values.

Your beat

Ready
// Keep each sound and rhythm; change only the accents and the tempo.
export const makeBeat = (bpm: number, offBeat: number) => chain(
  fn('stack',
    kickOneThree,
    snareTwoFour,
    chain(eighthHats, fn('velocity', repeat(sequence(number(1), number(offBeat)), 4))),
  ),
  fn('cpm', bpm / 4),
)

Recap

The practice player returns to the kick on 1 and 3. Its alternating velocity pattern keeps the beat-aligned hi-hats at 1 and scales the off-beats. At 0 the off-beats are silent; at 1 all eight have the same level.

  • Write rhythm with notes, sound tokens and rests.
  • Keep sound modifiers separate so one sound can play many rhythms.
  • Layer complete patterns with fn('stack', …); set the shared tempo on the result.

Explore the Kick, Snare and Hi-hat sounds, or compare Hi-hat accents.