# Learn the music code

> Free guides to the code behind every Shawarma song: a beginner tutorial, drum patterns, a one-page cheat sheet and complete example songs.

Every song in Shawarma is code: short patterns of sounds and notes that play in a loop while you change them. These guides teach you to read and write it.

[New for Halloween Halloween party music A spooky dance track for your party, ready to play, then changed by asking. Open the Halloween page](https://shawarma.studio/learn/halloween-party-music)

1. [Tutorial From an empty page to a short song: sounds, rests, layers, notes, scales, tempo and effects.](https://shawarma.studio/learn/tutorial)
2. [Drum patterns Kicks, snares and hats in mini-notation: house, rock, boom bap, breakbeats, Euclidean rhythms and fills.](https://shawarma.studio/learn/drum-patterns)
3. [Cheat sheet Every symbol of mini-notation and the functions you use most, on one page.](https://shawarma.studio/learn/cheat-sheet)
4. [Example songs Five complete songs with their code and notes on how each one works.](https://shawarma.studio/learn/examples)
5. [Chat commands The / shortcuts in the chat: listen and fix the mix, vary, arrange, export and more.](https://shawarma.studio/learn/commands)

## What the code looks like

A kick on every beat, a clap on two and four, hats between the beats, and a bass line, in three lines. Quotes hold the pattern; each step in it shares the bar with the others.

```
const drums = s("bd*4, [~ cp]*2, [~ hh]*4").gain(.85)
const bass = note("<c2 a1 f1 g1>*4").s("sawtooth").lpf(700)

stack(drums, bass)
```

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

The code is JavaScript with a small pattern language inside the quotes. These guides are short and stick to what you need to start making songs. You do not need to know JavaScript: apart from `const` and a few brackets, it is all in the patterns.

## 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
