Lesson 10 +10 XP

Tempo & Sample Numbers

Tempo & Sample Numbers

Two handy controls: the tempo and choosing sample numbers with n.

Changing tempo with setcpm

setcpm sets the tempo in cycles per minute:

By default the tempo is 30 cycles per minute = 120/4 = 1 cycle every 2 seconds.

In western music terms, the example above is like 8th notes at 90 bpm in 4/4 - but you don't need to know these terms to make music!

Try different tempos

Lower numbers = slower, higher numbers = faster.

Selecting sample numbers with n

Instead of writing jazz:0 jazz:1 [jazz:4 jazz:2] jazz:3*2, use n for the numbers and sound for the sound:

This is shorter and more readable!

n separates numbers from the sound

  • n("0 1 4 2") gives the sample numbers.
  • .sound("jazz") says which sound to play.
  • Change the sound without rewriting every sample number.

TL;DR

  • setcpm(x) sets tempo in cycles per minute.
  • Default is 30 cpm (120/4).
  • n("0 1 4 2").sound("jazz") picks sample numbers cleanly.
  • n separates the numbers from the sound name.