# Notes on Perfectly Balanced Rhythms

A perfectly balanced rhythm is a looping rhythm such that, if the onsets are represented as weights on a wheel, the wheel's center of gravity is on its hub and it can spin without a preference to any direction [Milne2015] [Milne2016] [Milne2017]. Formally, the times of the onsets of the rhythm are represented as integers $0 \leq i < N$ and aggregated as a vector $\mathbf{x}$, and perfect balance means that $\sum_k e^{2 \pi j x_k / N} = 0$. That is, if the onsets are viewed as roots of unity, they sum to zero. Perfectly balanced rhythms can be used as an approach to algorithmic composition of rhythms.

The simplest examples of perfectly balanced rhythms are isochronous rhythms, i.e. rhythms where all onsets are equally spaced and form the $k$-th roots of unity (or rotations thereof), where $k \geq 2$ and $k$ divides $N$. When graphed on a circle, these appear as regular $k$-gons. Furthermore, the superposition of two perfectly balanced rhythms is also perfectly balanced provided that no collision happens between onsets. These two facts are enough to generate interesting rhythms. Here are some perfectly balanced rhythms using summed polygons:

[perfectly balanced rhythms with summed polygons]

Perfectly balanced rhythms can also be interpreted in pitch space as scales. For example, in 12EDO, the digon C-F# and the square C#-E-G-Bb can be combined to produce the perfectly balanced scale C-C#-E-F#-G-Bb. This makes perfect balance a potentially useful tool for exploring scales in highly divisible EDOs.

One might wonder if all perfectly balanced rhythms are formed by summed regular polygons. The answer is no -- for $N = 30$, there are six irregular polygons that do not decompose into summed regular polygons:

[image]

The vectors for these are:

[0, 1, 7, 13, 19, 20]
[0, 1, 2, 12, 13, 19, 20]
[0, 1, 7, 11, 17, 18, 24]
[0, 1, 7, 8, 14, 18, 20, 24]
[0, 1, 2, 8, 12, 18, 19, 20]
[0, 1, 2, 8, 12, 14, 18, 20, 24]

How I conducted the search will be discussed in a moment.

Why $N = 30$? These indecomposable polygons can only occur when $N$ has three or more distinct prime factors. With $N = 42$ they report 18 polygons, and $N = 60$ hundreds more.

An interesting property of these irregular polygons is that they are decomposable into regular polygons, if we allow a special construct where polygons can be subtracted as well as added. Visually, we can represent this as an "anti-polygon" with vertices that cancel out existing polygons' vertices. Mathematically, this is subtracting roots of unity so they cancel each other out. Letting $z = e^{2 \pi j / N}$, here's an example of the first irregular polygon:

\begin{align*} z^0 + z^1 + z^7 + z^{13} + z^{19} + z^{20} = 0 \\ (z^1 + z^7 + z^{13} + z^{19} + z^{25}) + (z^0 + z^{10} + z^{20}) - (z^{10} + z^{25}) = 0 \\ \end{align*}

which decomposes into a pentagon, a triangle, and an anti-digon. More generally, every polygon can be multiplied by an integer "weight," as long as canceling terms results in a valid rhythm consisting of a sum of distinct $z^i$.

## Searching for irregular polygons

Finding perfectly balanced polygons that do not additively decompose into regular polygons is a nontrivial problem. An approach taken in [Amiot2018] is to brute force all size-$k$ subsets of $N$, with some tricks to avoid counting rotations and reflections, and numerically evaluate the sum of roots of unity using floating-point math.

## References

Milne2015

Milne, Andrew J. et al. 2015. "Perfect Balance: A Novel Principle for the Construction of Musical Scales and Meters." Proc. of the 5th International Conference on Mathematics and Computation in Music.

Milne2016

Milne, Andrew J. et al. 2016. "XronoMorph: Algorithmic Generation of Perfectly Balanced and Well-Formed Rhythms." New Interfaces for Musical Expression.

Milne2017

Milne, Andrew J. et al. 2017. "Exploring the space of perfectly balanced rhythms and scales." Journal of Mathematics and Music.

Amiot2018

Amiot, Emmanuel. 2018. "Decompositions of nil sums of roots of unity. An adaptation of 'Sommes nulles de racines de l'unité.'" Journal of Mathematics and Music.