All tutorials

3 · Outputs & actuators

Melody with rhythm

Advanced20 min

Goal

Play a tune by pairing pitches with durations.

Why it matters

Two parallel arrays = the first data structure of a sequencer.

Steps

  1. 01Create notes[] and durations[].
  2. 02Compute the real duration: 1000 / duration.
  3. 03Add a 30 % pause between two notes.

This tutorial runs inside the Circuitly simulator: your wiring and your code are checked automatically at every step.

Next tutorials