from klotho import Tree, RhythmTree as RT, plot, play
from fractions import Fraction
import numpy as npTaxonomy of Proportions¶
As you saw in the last chapter, we can divide a given temporal space into any number of slices with any aribtrary proportions. Because the choices are seemingly endless (and, in a mathematical sense, they literally are), it’s worth making some general observations about types of rhythms so we can have a working vocabulary when thinking about rhythm.
We can generalize pretty much any fundamental rhythmic idea into one of a few basic types:
Pulse | Periodic | Irregular | Accelerating | Decelerating
Anything else is usually some combination of these basic types. Let’s explore...
Basic Types¶
Pulse¶
All subdivisions are equal — a steady, even division of time.
for n in [3,5,11,17]:
S = (1,)*n
rt = RT(subdivisions=S)
plot(rt, layout='ratios').play(bpm=126, beat='1/4')
print("...and so on...")...and so on...
Periodic (Cycling)¶
A short motif of unequal durations repeated end-to-end. Not a pulse (the durations differ), but not random either — it has a recurring pattern.
for motif in [(1, 3), (2, 5, 1), (1, 2, 3)]:
S = motif * 4
rt = RT(subdivisions=S)
plot(rt, layout='ratios').play(bpm=92, beat='1/4')
print("...and so on...")...and so on...
Irregular¶
Subdivisions with no consistent pattern — each duration is independently chosen.
Note: You could call this “random” (and the below examples do use random values), but notice that as soon as you loop any of these, they lose this “random” quality and become more like the above Periodic / Cyclic types. A passage would need to continue with random (i.e., unpredictable) proportions to retain this Irregular quality.
for i in range(4):
l = [n for n in range(1,9)]
np.random.shuffle(l)
S = tuple(l)[:i + 4]
rt = RT(subdivisions=S)
plot(rt, layout='ratios').play(bpm=126, beat='1/4')
print("...and so on...")...and so on...
Accelerating / Decelerating¶
Durations that monotonically shrink (accelerating — events get closer together) or grow (decelerating — events spread apart).
S = tuple(n for n in range(1, 17)[::-1])
rt = RT(subdivisions=S)
plot(rt, layout='ratios').play(bpm=92, beat='1/4')S = tuple(n for n in range(1, 17))
rt = RT(subdivisions=S)
plot(rt, layout='ratios').play(bpm=92, beat='1/4')...and that’s kinda all we need. These five basic types — Pulse, Periodic, Irregular, Accelerating, and Decelerating — cover the fundamental rhythmic characters.
Later, after we learn about Rhythm Trees and hierarchical nesting, we’ll see how these basic types can be combined — not only in sequence, but together in layers, with different types operating at different levels of the tree. But first, we need to understand how that nesting works.