Tutorials

Rhythm & Patterns

Music is about time. In this tutorial, you'll learn to create rhythmic patterns, from basic beats to complex polyrhythms.

Music is about time. In this tutorial, you’ll learn to create rhythmic patterns, from basic beats to complex polyrhythms.

The Clock

Everything in Akkado syncs to a global clock. The trigger function creates pulses:

// Trigger 4 times per beat (16th notes)
trigger(4)

Use triggers to control envelopes:

// Kick on quarter notes
osc("sin", 55) * ar(trigger(1), 0.01, 0.2) |> out(%, %)

Building a Basic Beat

Combine different trigger rates for drum patterns:

// Simple kick and hi-hat
kick = osc("sin", 55) * ar(trigger(1), 0.005, 0.15)
hat = osc("noise") |> hp(%, 8000) * ar(trigger(4), 0.001, 0.03) * 0.3

kick + hat |> out(%, %)

Euclidean Rhythms

The euclid function creates mathematically interesting patterns by distributing hits evenly:

// Tresillo (3 hits over 8 steps)
osc("sin", 55) * ar(euclid(3, 8), 0.01, 0.15) |> out(%, %)

Classic Euclidean patterns:

  • euclid(3, 8) - Cuban tresillo
  • euclid(5, 8) - West African bell pattern
  • euclid(7, 16) - Brazilian samba
// Layered Euclidean rhythms
kick = osc("sin", 55) * ar(euclid(4, 16), 0.005, 0.15)
perc = osc("noise") |> bp(%, 2000, 4) * ar(euclid(5, 16), 0.001, 0.05) * 0.4

kick + perc |> out(%, %)

Rotation

Rotate patterns to shift the accent:

// Rotated pattern - different feel, same hits
osc("sin", 55) * ar(euclid(3, 8, 1), 0.01, 0.15) |> out(%, %)

Step Sequencing

Use pat() mini-notation to create melodic patterns:

// 4-note melodic pattern
pat("c3 e3 g3 c4") |> ((f) ->
    osc("saw", f) * ar(trigger(4)) |> lp(%, 800)
) |> out(%, %)

Combining Rhythm and Melody

Build a complete sequence:

// Bass line with rhythm
pat("c2 g2 d#2 a#1") |> ((f) ->
    osc("saw", f)
        |> moog(%, 400 + ar(trigger(2)) * 800, 2)
        * ar(trigger(2), 0.01, 0.2)
) |> out(%, %)

LFO for Movement

Add subtle motion with LFOs:

// Rhythmic with filter movement
osc("saw", 110)
    |> lp(%, 500 + lfo(0.25) * 1000)
    * ar(trigger(4))
    |> out(%, %)

A Complete Drum Pattern

// Kick drum
kick = osc("sin", 55 * (1 + ar(trigger(1), 0.001, 0.02) * 2))
    * ar(trigger(1), 0.005, 0.2)

// Snare
snare = osc("noise") |> bp(%, 1000, 2)
    * ar(euclid(2, 8, 4), 0.001, 0.1) * 0.5

// Hi-hat
hat = osc("noise") |> hp(%, 8000)
    * ar(trigger(4), 0.001, 0.03) * 0.2

// Ride
ride = osc("noise") |> bp(%, 6000, 8)
    * ar(euclid(3, 8), 0.001, 0.1) * 0.15

kick + snare + hat + ride |> out(%, %)

Polyrhythms

Create tension with conflicting rhythms:

// 3 against 4
bass = osc("saw", 55) * ar(euclid(3, 12), 0.01, 0.15) |> lp(%, 400)
perc = osc("noise") |> hp(%, 4000) * ar(euclid(4, 12), 0.001, 0.05) * 0.3

bass + perc |> out(%, %)

Mini-Notation Patterns

For melodic sequences, use mini-notation:

// Melodic pattern
pat("c3 e3 g3 c4") |> ((f) ->
    osc("saw", f) |> lp(%, 800) * ar(trigger(4))
) |> out(%, %)

Next Steps

You now have the tools to create complex rhythmic music! Explore further:

Congratulations on completing the tutorial series! You’re ready to make music with Akkado.