# Strudel drum patterns

> Strudel drum patterns in mini-notation: four on the floor, backbeats, hi-hat grooves, breakbeats, Euclidean rhythms and fills, with code to copy.

Drums are the quickest way into Strudel: one line of mini-notation is a whole beat. This page starts with the grid, then builds common grooves step by step, then adds variation so the loop keeps changing. New to the code? Read the [tutorial](https://shawarma.studio/learn/tutorial) first; it takes ten minutes.

## The drum names

Drum sounds have short names. These are the ones used below:

**`bd`**

bass drum (kick)

**`sd`**

snare drum

**`hh`**

closed hi-hat

**`oh`**

open hi-hat

**`cp`**

clap

**`rim`**

rimshot

**`lt, mt, ht`**

low, mid and high tom

**`cr`**

crash cymbal

**`rd`**

ride cymbal

**`cb`**

cowbell

**`sh`**

shaker

Each has a few recordings; add `:1`, `:2` and so on to pick another (`bd:3`).

## The grid

A pattern fills one cycle, and in most music a cycle is one bar of four beats. Write sixteen steps and each step is a sixteenth note, like the sixteen buttons on a drum machine. `~` is an empty step.

```
s("bd ~ ~ ~ sd ~ ~ ~ bd ~ bd ~ sd ~ ~ ~")
```

[Open in Shawarma](https://shawarma.studio/open?snippet=grid16)

Kick on beat 1, snare on 2, kick on 3 and just after it, snare on 4.

Sixteen steps get long to read. Most patterns below use shorter forms: `bd*4` for four kicks, `[~ hh]` for "nothing, then a hat", and a comma between layers.

## Four on the floor

A kick on every beat. This is the base of house, techno and disco.

```
s("bd*4")
```

[Open in Shawarma](https://shawarma.studio/open?snippet=fourFloor)

Add a clap on beats two and four, the backbeat:

```
s("bd*4, ~ cp ~ cp")
```

[Open in Shawarma](https://shawarma.studio/open?snippet=backbeat)

## Hi-hats

Hats set the feel. Eighth notes keep time evenly:

```
s("bd*4, hh*8")
```

[Open in Shawarma](https://shawarma.studio/open?snippet=hats8)

Hats only between the beats give the off-beat bounce of house music:

```
s("bd*4, [~ hh]*4")
```

[Open in Shawarma](https://shawarma.studio/open?snippet=hatsOff)

Sixteenth notes with a volume pattern sound played rather than programmed. The four values repeat four times per cycle, one per hat:

```
s("bd*4, hh*16").gain("[.9 .5 .7 .5]*4")
```

[Open in Shawarma](https://shawarma.studio/open?snippet=hats16)

## House

Four kicks, claps on two and four, off-beat hats and an open hat on the last beat. This is the drum part of the House groove template in Shawarma.

```
setcpm(31) // 124 BPM

s("bd*4, [~ cp]*2, [~ hh]*4, ~ ~ ~ oh")
```

[Open in Shawarma](https://shawarma.studio/open?snippet=house)

## Rock and pop

A kick on one and three, a snare on two and four, an extra kick just after beat three, and straight eighth-note hats:

```
setcpm(28) // 112 BPM

s("bd ~ ~ ~ sd ~ ~ ~ bd ~ bd ~ sd ~ ~ ~, hh*8")
```

[Open in Shawarma](https://shawarma.studio/open?snippet=rock)

## Boom bap

A slower hip-hop beat, at 90 BPM. `swing(4)` delays every second hat in each beat, which gives the lazy, shuffled feel. Each layer is on its own line, so the swing applies to the hats only.

```
setcpm(90/4) // 90 BPM

stack(
  s("bd ~ ~ bd ~ ~ bd ~ ~ ~ bd ~ ~ ~ ~ ~"),
  s("~ ~ ~ ~ sd ~ ~ ~ ~ ~ ~ ~ sd ~ ~ ~"),
  s("hh*8").gain("[.8 .5]*4").swing(4),
)
```

[Open in Shawarma](https://shawarma.studio/open?snippet=boomBap)

## Breakbeat

Syncopated kicks and snares that land off the beat. Here the kick and snare parts use eight steps per cycle, and `[~ sd]` at the end adds a ghost snare just before the loop comes round.

```
setcpm(34) // 136 BPM

s("bd ~ ~ bd ~ ~ bd ~, ~ ~ sd ~ ~ sd ~ [~ sd], hh*8")
```

[Open in Shawarma](https://shawarma.studio/open?snippet=breakbeat)

## Euclidean rhythms

`(3,8)` after a sound spreads 3 hits as evenly as possible over 8 steps. Many traditional rhythms are made this way: 3 over 8 is the Cuban tresillo, 5 over 8 the cinquillo. A third number rotates the pattern.

```
s("bd(3,8), hh(5,8), rim(2,8,3)")
```

[Open in Shawarma](https://shawarma.studio/open?snippet=euclid)

The same as a function, here 5 cowbell hits over 16 steps:

```
s("cb").euclid(5, 16)
```

[Open in Shawarma](https://shawarma.studio/open?snippet=euclidFn)

## Variation

A loop that never changes gets tiring. A `?` after a step drops it at random half the time, so the hats change every bar:

```
s("bd*4, hh*16?")
```

[Open in Shawarma](https://shawarma.studio/open?snippet=degrade)

`degradeBy` sets how often: `.3` drops about 30% of the hits.

```
s("bd*4, hh*16").degradeBy(.3)
```

[Open in Shawarma](https://shawarma.studio/open?snippet=degradeBy)

## Fills

A fill marks the end of a phrase. With `!3` inside angle brackets, a bar plays three times and then the fill bar plays once:

```
s("<[bd ~ sd ~]!3 [bd sd [sd sd] [sd sd sd sd]]>, hh*8")
```

[Open in Shawarma](https://shawarma.studio/open?snippet=fill)

Or change the last bar with a function. `ply(2)` plays every hit twice:

```
s("bd ~ sd ~, hh*8").lastOf(4, x => x.ply(2))
```

[Open in Shawarma](https://shawarma.studio/open?snippet=fillFn)

A tom run in every fourth bar, over a steady kick:

```
s("<~ ~ ~ [lt mt ht ht]>, bd*4")
```

[Open in Shawarma](https://shawarma.studio/open?snippet=toms)

And a crash at the start of every four bars, which tells the listener a new phrase has begun:

```
s("bd*4, [~ cp]*2, [~ hh]*4, <cr ~ ~ ~>")
```

[Open in Shawarma](https://shawarma.studio/open?snippet=crash)

## Beyond the drum kit

Any sound works the same way. This is maqsum, one of the most common rhythms in Arabic music, on a darbuka: dum, tek, rest, tek, dum, rest, tek, rest. Two recordings of the drum stand in for the low stroke (dum) and the high one (tek).

```
setcpm(27.5) // 110 BPM, maqsum: dum tek - tek dum - tek -

stack(
  s("darbuka:0").struct("x ~ ~ ~ ~ ~ ~ ~ x ~ ~ ~ ~ ~ ~ ~"),
  s("darbuka:4").struct("~ ~ x ~ ~ ~ x ~ ~ ~ ~ ~ x ~ ~ ~").gain(.6),
)
```

[Open in Shawarma](https://shawarma.studio/open?snippet=maqsum)

The [Maqam groove](https://shawarma.studio/learn/examples#maqam) example builds a full piece on a darbuka pattern, and the [cheat sheet](https://shawarma.studio/learn/cheat-sheet) lists every mini-notation symbol used here.

## Try it in Shawarma

Shawarma is a music editor where every song is code. Your song plays on a loop; ask the assistant for a change in plain words, listen to it, and keep it only if you like it. Or edit the code yourself, as in this guide. The editor is free, with 5 assistant replies to try it; Pro starts with 7 days free.

[Start free with Google](https://shawarma.studio/auth/google) [See pricing](https://shawarma.studio/pricing)

---

The page: https://shawarma.studio/learn/drum-patterns
