Polyrhythmic Melodies with Strange Attraction
Year: 2025 Authors: Kiki Eco; Jordan Schettler; Kaleb So
Core claim
Non-integer augmentation ratios can generate self-similar melodies that produce polyrhythms and attract pseudo-random melodic evolution toward stable structure.
Topics
self-similar melodies, polyrhythm, strange attractor, musical symmetry
Domains
frieze groups, modular arithmetic, self-similarity, dynamical systems, music composition, sound art, visualization, mathematical music
Methods
sequence encoding, augmentation ratio, orbit analysis, Mathematica plotting
Media
audio files, melodic sequences, Mathematica, keyboard pitch labels
Paper text
The text below is the locally extracted OCR/Markdown version of the paper. Raw PDF files remain local and are not published here.
Bridges 2025 Conference Proceedings
Polyrhythmic Melodies with Strange Attraction
Kiki Eco , Jordan Schettler , and Kaleb So
Dept. of Mathematics and Statistics, San José State University, San Jose, CA, USA kiki.eco@sjsu.edu, jordan.schettler@sjsu.edu, kaleb.so@sjsu.edu
Abstract
Like fractals, melodies can be self-similar, i.e., contain a stretched out copy of themselves. The factor by which one stretches need not be an integer, and in such cases interesting polyrhythms can arise. Further, self-similar melodies can act like strange attractors, where pseudo-random melodies evolve into self-similar ones. We explore many examples of self-similar melodies and emphasize how one can use these in compositions, ultimately culminating in musical realizations of both polyrhythmic, self-similar melodies and strange attraction.
Introduction
A melody is a sequence of notes in a composition which can act as a musical fingerprint for the piece. Like the theme from Beethoven’s Ninth Symphony, melodies are often repeated within the work, sometimes played by different instruments/voices, with a new root note, or even at a different tempo. In this way, melodies can exhibit approximate translational symmetry, where the translation happens with respect to time. Other symmetries of melodies may be present as well, and here we are interested in symmetries where the melody contains a stretched out copy of itself. In order to describe such symmetries, we first label the pitches for notes in our scale using the set of integers . We assume that our scale is the familiar 12-tone equal temperament found on modern pianos, and then we consecutively number the keys where 0 corresponds to middle C. See Figure 1. In particular, if m > 0 is an integer, then represents the pitch of the note semitones higher than middle C, and represents the pitch of the note semitones below middle C. In addition to integers representing pitches of notes, we use symbols and to denote a rest or sustain, respectively. Here and can be taken as any non-integer real numbers with . Using these conventions allows us to view a melody as a sequence where each term lives in and represents one beat in the melody. Each beat lasts the same length of time, and tells us what happens after beats of time have elapsed. Thus corresponds to the first beat of the melody, corresponds to the second beat of the melody, and so on. Here if is an integer, it represents the pitch of a note played at the position indicated by the index . When this indicates that a note being played at the previous beat is to be sustained for another beat. If , no note is played or sustained at position and we rest for one beat.
To illustrate how a sequence can encode a melody, we show in Figure 2 the scores and sequences representing two well-known melodies. The top shows the opening vocal line in “Over the Rainbow”
Figure 1: Pitches of notes labeled with integers on a keyboard
Eco, Schettler, and So
Some- where O- ver the Rain- bow
Figure 2: Score and sequence for “Over the Rainbow” (top) and “The Marriage of Figaro” (bottom)
famously sung by Judy Garland in The Wizard of . The bottom shows the opening theme from “The Marriage of Figaro - Overture” by Mozart. Note that a sequence representing a melody does not specify a particular tempo or time signature and that each index in the sequence specifies one beat of the smallest note duration present. For instance, in both of our examples seen in Figures 2 the smallest note duration is an eighth note, so each term in the corresponding sequences represents one beat of an eighth note.
Periodic and Self-Similar Melodies
With the notation introduced above, a melody with translational symmetry—an indefinitely repeating melody—is represented by a sequence which is periodic modulo some positive integer , i.e., for all . Thus
In particular, , so whenever the index reaches a multiple of the melody starts over again. The modulus serves as the length of the melody as measured by the number of beats. Like a linear motif repeated along a border in an architectural design, melodies do not actually repeat indefinitely, but making this assumption allows us to classify the possible symmetries. This is explained nicely by Vi Hart in a past article of these proceedings [4] (see also Chapter 9 in Benson’s book [3]). Although Hart considers color patterns (e.g., same melody played by different instruments) and wallpaper groups, we are assuming there is only one voice/instrument and that we already have translational symmetry. Thus the only possible symmetries which are isometric (i.e., preserve distances between notes in both time and pitch) correspond to the seven classical frieze groups. These groups are generated by the translation in time plus one or more of the following: horizontal reflection, vertical reflection, rotation, and glide reflection.
Here we are interested in further symmetries where we do not require distances in time to be preserved. Namely, we can adapt the notion of self-similar geometric objects to the context of melodies as in [1], [2], [5]. In the same way that the Sierpinski triangle contains a scaled down copy of itself (in fact, infinitely many copies), melodies can contain scaled up copies of themselves, but in the case of a melody we will only hear finitely many copies in any particular composition.
Let a > 1 denote an integer. To augment a melody by ratio means we stretch the melody in time by lengthening the duration of each note/rest by a factor of . For example, the melody augmented by ratio would be . We say a melody is self-similar with augmentation ratio if
We shall always assume our self-similar melodies are periodic modulo some positive integer . For instance, we can choose to interpret the augmented melody as a bass line playing at a slower tempo where each note is
Polyrhythmic Melodies with Strange Attraction
Figure 3: Self-Similar Melody and its Octave Lowered Augmentation with ,
now one octave lower (subtract 12 from each pitch), and the original melody plays times for every one time the bass line plays. The idea of playing the same melody at different speeds dates back to at least the middle ages with prolation canons; for example, the Missa prolationum by Johannes Ockeghem has four voices sung at different speeds (see Chapter 13 in [7]). We show a self-similar melody in Figure 3 where and . Here the original melody consists of 15 quarter notes while the augmented melody (bass line) uses 15 half notes. Every time the bass line plays a new note, it matches a note being played in the original melody just one octave lower. We created a self-similar waltz (audio file “2 mod 15 (waltz).wav” in supplement) using this melody as the central theme played at three different speeds: half-time, normal, and double time.
Construction using Orbits of a Graph
The construction of periodic, self-similar melodies is actually straightforward. We just need to determine which pairs of positions must have matching terms. Combining Equations 1 and 2 gives us the condition
For example, when , as above, the positions 13 and 11 must having matching terms since . We can record and visualize which positions should match by making a graph with vertices labeled and drawing an edge from vertex to vertex when the congruence in Equation 3 holds. The connected components of such a graph are called orbits. Every position within a particular orbit must have matching terms in the melody. The graph for our , example is shown on the left in Figure 4. The idea for this definition of graph comes from a diagram by Tom Johnson for La Vie est si courte [6], which has , seen on the right in Figure 4.
Figure 4: Graph with and (Left), Tom Johnson’s diagram with , (Right)
Eco, Schettler, and So
Figure 5: Self-similar melodies with (top) and (bottom)
Fractional Ratios and Polyrhythms
What happens when the augmentation ratio is large? It is often hard to audibly detect a melody that is self-similar with a large ratio. For instance, if , an augmented melody would be five times slower or faster than the original and it would not be obvious that the augmented melody is in fact a stretched out version of the original. Here we offer an alternative approach: to stretch a self-similar melody by some fractional ratio which is smaller but congruent to . Suppose there are integers b > c > 0 with such that . Since , Equation 3 tells us that . Thus, notes in the bass line corresponds to notes in the main line, and we can regard a self-similar melody with ratio to as self-similar with ratio . We thus have a to polyrhythm which can be further emphasized by percussive elements. For example, when , , we can stretch by a ratio of since . To visualize this in terms of sequences, we can stretch one copy of the melody by 2 (main line) and another copy by 3 (bass line). For example, the melody viewed as periodic modulo is self-similar with ratio . Augmenting this sequence by both 2 and 3 produces the following two sequences which create a 3 to 2 polyrhythm where we have boxed positions where notes would match:
We show the score for this example after dropping the bass line down one octave in Figure 5 (top) where the bass line repeats twice while the main line repeats three times. Since polyrhythms are a common feature modern jazz, we chose to create jazz inspired compositions (more detail on these in the final section) featuring both 3 to 2 and 4 to 3 polyrhythmic melodies.
The idea of fractional augmentation ratios also presents another possibility; namely, we can stretch individual notes by alternating ratios. In the case of a 3 to 2 polyrhythm as above, instead of having each note stretched by a factor of to create the bass line, we could alternate between notes which are stretched by 1 and 2. We illustrate this idea with , in Figure 5 (bottom) with a self-similar piece for piano that feels like a prelude (audio file “3/2 mod 25 (prelude).wav” in supplement).
The bass line (left hand) alternates between half and quarter notes while the main line (right hand) plays only quarter notes. In general, when stretching by a ratio of , we need a sequence of durations with . The duration sequence itself could change during the piece and each need not be an integer.
Polyrhythmic Melodies with Strange Attraction
Figure 6: Detail from graph with ratio modulo
Self-Similar Melodies as Strange Attractors
In our examples thus far we have only considered self-similar melodies with . What happens when \gcd(a, n) > 1 ? In those cases, we tend to have fewer orbits, so they produce seemingly less interesting melodies since there are less choices for note values. For example, when and , there are only two orbits, so the melody would consist of at most two different note values. However, in Section 7 of [1], Amiot points out that situations where \gcd(a, n) > 1 can actually be quite interesting. In particular, Amiot showed that starting with any (possibly random) periodic mod melody the iterative process , , , … will eventually result in a melody which is self-similar with respect to some power of . In other words, there are integers p, q > 0 such that is self-similar with ratio . In this way, self-similar melodies act as strange attractors since they have a fractal-like symmetry and random sequences will eventually stabilize as self-similar through the above process.
One of our main goals from this project was to make compositions which showcased this strange attraction by having a pseudo-random jumble of notes gradually transform into a self-similar, polyrhythmic melody with respect to some . However, there were two issues that needed to be addressed. First, starting with a random sequence does not typically result in an interesting self-similar melody. Second, the iterative process above can lose information at each step, so rather than hearing a gradual transformation, one would hear more and more notes disappearing after each iteration. To overcome these two obstacles, we developed the following approach. We start with an interesting melody which is self-similar with respect to modulo and then augment by for some number of “levels of evolution” . The augmented sequence is periodic mod where for all and otherwise. Each beat in the augmented sequence we take to have a duration beats of the original so that the augmented melody sounds exactly like the original, but we have created many new places where notes can now live between previously allowable positions. Now for each , consider a position of the form
modulo where every coefficient is in and is some depth with . When we repeatedly multiply this quantity by and reduce modulo , we get a sequence of positions which
Eco, Schettler, and So
Figure 7: Pseudo-random melody attracting to self-similar melody with modulo
eventually returns to after iterations. Such positions are precisely the indices that are in the orbit of in the graph for modulus with ratio . As an explicit example, consider , with levels. The square orbit consisting of 11, 7, 14, 13 from the graph for mod 15 seen in Figure 4 becomes the branched orbit mod seen in Figure 6 with a corresponding central square of , , , .
The above algebraic description allows us to randomly choose positions in these orbits, and we fill such positions with the note value . By selecting various depths , some note values will be in the central part of the orbit earlier than others, but all notes will be in their original positions after levels and the melody will stabilize at that point since we assumed the original melody was self-similar. We created two jazz-inspired pieces (audio files “4/3 mod 25 (jazz attractor).mp3” and “3/2 mod 19 (jazz attractor).wav” in supplement) using levels of evolution, one with modulo and the other with modulo . The 5 levels of evolution across 6 stages for modulo can be visualized as in Figure 7 where we have used Mathematica to plot pitch (vertical) versus time (horizontal).
Summary and Conclusions
By allowing non-integer augmentation ratio, we can construct self-similar melodies which create polyrhythms when we layer a main line with a stretched out copy as a bass line. We constructed musical realizations of such polyrhythmic melodies where pseudo-random notes go through several levels of transformations which gradually reveal the self-similar structure. We can hear a fractal-like melody emerging from an attractor.
Acknowledgements
This work was supported by an award from the Henry Woodward Fund which supports applied math research through an endowment to the Department of Mathematics and Statistics at San José State University. We also would like to thank the reviewers for their helpful comments and suggestions.
References
[1] E. Amiot. “Autosimilar melodies.” Journal of Mathematics and Music, vol. 2, no. 3, 2008, pp. 157-180. [2] E. Amiot, C. Agon, and M. Andreatta. “Autosimilar melodies and their implementation in OpenMusic.” SMC 07 4th Sound and Music Computing Conference, 2007, pp. 345-349. [3] D. J. Benson. Music: A Mathematical Offering. Cambridge University Press, 2008. [4] V. Hart. “Symmetry and Transformations in the Musical Plane.” Proceedings of Bridges 2009: Mathematics, Music, Art, Architecture, Culture. C. S. Kaplan and R. Sarhangi, Eds. London: Tarquin Publications, 2009. pp. 169-176. http://archive.bridgesmathart.org/2009/bridges2009-169.. [5] T. Johnson. Self-Similar Melodies. Editions 75, 1996. [6] T. Johnson. “La Vie est si courte.” 1998. Instrumental ensemble music, 16 min. [7] L. Ultan. Music Theory: Problems and Practices in the Middle Ages and Renaissance, 1st ed. University of Minnesota Press, 1978.