> ## Documentation Index
> Fetch the complete documentation index at: https://pkhambat.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Steps

> The steps type: what a kit piece plays, as steps or as beats.

A [kit piece](https://pkhambat.mintlify.site/drums/kit.md)'s line holds a `steps` value: one character per step, and a step is a sixteenth note. A bar of `4 over 4` is 16 steps.

![One bar of a rock beat on a drum staff: hi-hat eighth notes, snare on 2 and 4 with accents, kick on 1, 3 and the and of 3. Below it, the hat, snare and kick lines in code, with each character under the note it plays.](https://mintcdn.com/pkhambat/mmj0V2fSfXdHqvK4/images/sheet-to-code.svg?fit=max\&auto=format\&n=mmj0V2fSfXdHqvK4\&q=85\&s=6c60e204800bcdcd4119fa6c58f75dd3)

```composer-nb theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/composer-nb.json"]}}
play {
  hat: ^-x- x-x- x-x- x-x-
  snare: ---- ^--- ---- ^-x-
  kick: x--- ---- x-x- ----
}
```

## Characters

| Character | Plays |
| - | - |
| `x` | A hit. |
| `^` | An accent. |
| `~` | A ghost note. The snare's ghost notes go on `snare.ghost`, as `x`. |
| `d` | Two thirty-second notes. |
| `-` | Nothing. |
| `\|` | Optional bar line, checked against the `time`. |

Spaces are ignored, so steps can be grouped by beat. A `steps` value is as long as its characters: `x--x---` is seven steps.

A value written as the same figure more than once is an error, because a pattern repeats it: in a pattern, `hat: x-x- x-x-` is `hat: x-`. To play a figure once for a length, put the [length](#rests-and-lengths) in front: `hat: 1 bars x-`.

## Beats

A line can list beats instead, counted `1 e & a`. A character in front gives the hit: `^4`, `~3a`, `d3`. A list of beats is one bar long, and it can't share a line with steps.

```composer-nb theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/composer-nb.json"]}}
play {
  hat: 1 bars x-
  snare: ^2 ^4
  kick: 1 3 3&
}
```

## Rests and lengths

Commas split a line into parts. A [length](https://pkhambat.mintlify.site/language/overview.md#lengths) in front of a part fills that much time: `2 beats rest` is silence, and `2 beats x-` repeats `x-` for two beats.

```composer-nb theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/composer-nb.json"]}}
play {
  snare: 2 beats rest, dd, 1.5 beats rest
  hat: 2 beats x-, 2 beats rest
}
```

The length `...` is what is left of the block the line is in, so a last part `...rest` is silence to the end, and `...x-` repeats `x-` to the end. The line then has no length of its own: the other lines decide how long the block is, and what comes before the `...` plays once each time through.

```composer-nb theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/composer-nb.json"]}}
set time 9 over 8
set tempo 100

pattern manias = {
  hat.open: x---
  hat: --x-
  kick: x--x-x---x--x-xx--
  snare: -------x-
  snare.ghost: -xx, ...rest
}

play manias for 4 bars
```

This is *Circle of Manias* by Porcupine Tree. The hats are 4 steps long, the kick 18 and the snare 9, so the pattern is 36 steps, and the ghost notes come back at the top of each pass.

## Hits spread over steps

`3 in 8` is three hits spread as evenly as eight steps allow: `x--x--x-`, the tresillo. It is a part of its own, with a comma between it and anything else on the line, and a `steps` name can hold it.

```composer-nb theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/composer-nb.json"]}}
steps tresillo = 3 in 8

play {
  kick: tresillo
  hat: 2 in 8
  snare: 2 beats rest, 5 in 8
}
```

## Layers

A block after a kit piece's colon holds layers, one per line, and evaluates to one `steps` value. Each layer repeats until they all end together. Where two layers hit the same step the lower one wins, and a `-` never overrides a hit. The block is the whole value, so nothing goes beside it: `hat: x--- { ... }` is an error. To put steps in a row with a block, name it: `steps fig = { ... }` and `hat: x--- fig`.

```composer-nb theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/composer-nb.json"]}}
play snare.ghost: {
  --x-
  ------------ddd-
}
```

This evaluates to `--x---x---x-ddd-`.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.