Lesson 9 +10 XP

Parallel Patterns with ,

Use a comma to play multiple patterns at the same time (in parallel).

Two patterns at once


strudel
sound("hh hh hh, bd casio")

The left side plays its own rhythm while the right side plays its own.

As many commas as you want


strudel
sound("hh hh hh, bd bd, - casio")

Commas inside sub-sequences too


strudel
sound("hh hh hh, bd [bd,casio]")

Notice: sound("bd [bd,casio]") and sound("bd bd, bd casio") sound the same! There are often many ways to express the same idea.

Multiple lines with backticks

For long patterns, use backticks (template literals) to write several lines:


strudel
sound(`
bd*2, - cp,
- - - oh, hh*4,
[- casio]*2
`)

Each line is still one big pattern - line breaks just make it readable.

TL;DR

  • , plays patterns in parallel.
  • You can use many commas.
  • Commas work inside sub-sequences too.
  • Backtick strings let you write patterns across many lines.