Skip to content

4 · Add a bassline

For melody and bass, use note("…") and pick a synth voice with .sound("…"). Notes are letters (c d e f g a b) with an octave number — lower number = lower pitch. setcpm sets the tempo.

  • Play it, then change the notes — try "c2 g1 eb2 f2". Try a smoother voice with .sound("square") or .sound("triangle").

Picking notes that sound good together is easier with a scale. Use n("…") for scale steps (0 is the root) and .scale("…") to stay in key — every note will fit.

  • Change the scale to "c2:major" (brighter) or "c2:dorian" (moody), and edit the numbers in n(...).