Sunday, July 21, 2024

Freedom and Constraint

Interesting things happen in the space where freedom and constraint play with and against each other. In my musical explorations, with algorithmic composition and CSound synthesis as my vehicles, I have several mechanisms for defining this space of play.

Tuning and consonance are fundamental. I can constrain pitch selection to a scale, to a subset of the full set of pitches provided by the tuning system. Vertical relationships can be regulated, requiring chords to conform to some set of shapes. A variety of horizontal relationships, adjacency in a voice but also across longer scale repetition structures, can be guided more or less rigidly to some set of consonant intervals.

The large scale repetition structure of the piece is another aspect of constraint. Low dimensionality means few horizontal relationships, allowing greater freedom. High dimensionality introduces many horizontal relationships, clusters of clusters, which constrain the pitch selections.

The thermodynamic approach of my algorithm provides a temperature parameter. High temperature allows more freedom, low temperature imposes more constraint. There is generally a transition where long range order emerges, with fractal fluctuations at the transition.

In this new piece I don't target the phase transition. I gave the piece a high dimensionality, so it was tending to jump into a very orderly state. To forstall this, I initialized it randomly and then cooled it just enough to let a moderate amount of order emerge... that's another dimension of the freedom-order interplay: how the pitches are initialized, and how long the consonance optimizer is run.

This piece is in 171edo and uses the same chord shape constraint as the piece I posted a few days ago. But this piece has three voices instead of five. This gives the piece more freedom to move harmonically. My idea was that this would reduce the tendency to fall into a highly ordered state... but it didn't seem to work that way! I thought I could get away with increasing the dimension; I did keep the higher dimension, but just reduced the amount of pitch optimization jostling to preserve some of the initial freedom.

Tuesday, July 16, 2024

Chord Progression

Here is a new piece in 171edo. 171edo, the tuning system that divides octaves into 171 equal steps, provides very precise approximation to the just intervals 3:2 (a perfect fifth), 5:4 (a major third), and 7:4 (an unconventional interval). 3:2 is approximated by 100 steps of 171edo, 5:4 by 55 steps, and 7:4 by 138 steps. If one starts at any pitch, and moves up a perfect fifth, then up five major thirds, and then up again by a 7:4 interval, the total movement will be 100 + 5*55 + 138 = 513 steps, which is exactly three octaves, equivalent to the starting point. This piece moves around this loop 36 times, once per 63 seconds. All 36 cycles are superimposed in this score:

This piece has five voices, which form relatively complex chords. In constructing this piece, the chord shapes have been constrained:

This is a fragment of the Tonnetz diagram for 171edo. It shows the three dimensional network of relationships among the pitch classes. Horizontal neighbors are connected by perfect fifths, vertical neighbors by major thirds, and the third dimension, in and out of the page, shows pitch classes related by 7:4. The green and purple boxes here have that same shape: the purple box is simply shifted to the right. Each box encloses 8 pitch classes. These boxes represent the constraint on chord shape. At any instant in time, the pitch classes assigned to the five voices must be contained in a box of this size and shape. Picking 5 points out of a total set of 8 allows for 56 different chord shapes.

What fascinates me at the moment is the relationship between the chord constraint and the harmonic movement driven by the 63 second cycle. With the five voices often starting and stopping at different times, much of the time the pitch class of just one voice will change at a time. The cube shaped chord constraint used here will allow unbounded harmonic movement even with this kind of overlap. The green box and the purple box in the diagram include four pitch classes in their intersection: 7, 40, 123, and 156. A five note chord might add pitch class 78, which would be allowed because all five pitch classes are in the green box. But then the voice sounding the 78 could switch to pitch class 52, which would be valid because all the pitch classes are in the purple box. The other voices could all move within the purple box to set up another move to the right. The same tactic works for movment in the other directions.

Saturday, July 13, 2024

Consonance and Dissonance

Here is a new algorithmic piece in 50edo. 50edo, the tuning system that divides octaves into 50 equal parts instead of the conventional 12 equal parts, is still a quite conservative tuning system. It is very close to 2/7-comma meantone, whose history goes back to the 16th Century. I was inspired to create this piece from some discussion about diminished chords, chords built by stacking minor thirds. In conventional 12edo, four minor thirds add up to an octave: each minor third is 3 steps of 12edo, and 4*3=12, the number of steps in an octave in 12edo. In 50edo, a minor third is 13 steps, so four minor thirds adds up to 52 steps, 2 steps sharper than an octave. In just intonation a minor third is a 6:5 frequency ratio, so four minor third combine to make 1296:625, sharper than an octave by 648:625. In this piece I wanted to explore what kind of rich chord structure is made available by the greater precision of 50edo.

This piece has five voices, enabling quite complex chords. I didn't want the chords to get too wild, so I constrained the structure of the chords. The diagram above has a green template imposed on a Tonnetz diagram for 50edo. Since 50edo is a meantone tuning, the conventional names for notes can be used; but note that with 50edo, e.g. C# and Db are distinct pitches.

The chords in this piece, the combinations of notes that are sounded at the same time, are constrained by the rule that there should be some positioning of the template that covers all the notes in the chord. In the position shown for the template, the notes of the C major chord C-E-G are all covered, so the C major chord is allowed. An Fb major chord Fb-Ab-Cb is not covered by the template in the position shown, but the template can be shifted down two rows to cover the Fb major chord, so a Fb major chord is allowed. The template defines the shapes of the allowed chords. If a shape is allowed, it is allowed however it might be transposed.

An example of a forbidden chord is a two semitone chord such as D#-E-F. There is no way to slide the template to cover these notes together. Some common tetrads are allowed, such as a major seventh and a dominant seventh. A diminished triad is allow, but a diminished tetrad is not. The question that inspired this piece was about diminished tetrads, so their exclusion here is a bit of a disappointment, but I wanted to keep the template reasonably bounded in hopes of creating some coherent music!

Saturday, July 6, 2024

Exotic Intervals

Here's an algorithmic composition in 270edo, the tuning system that divides octaves into 270 equal steps. This precision allows exotic intervals to be introduced with great clarity. This piece uses intervals such as 7:4 and 11:8, and more complex combinations such as 11:7 or 11:10 or 9:7.

Any tuning system with discrete steps will temper out commas, i.e. will map multiple just-tuned intervals to the same pitch. 270edo maps both 96:55 and 110:63 to 217 steps. This new composition is based on a pattern where pitch class 0 moves to pitch class 217 by a sequence of intervals corresponding to one of these just ratios, and then returns by a sequence corresponding to the other.

This composition is built mostly from just 15 pitch classes, out of the full set of 270. This diagram shows the pitch classes used, and the fundamental intervals that relate them to each other. More complex ratios such as 6:5 or 7:6 etc. are not shown.

This pieces progresses clockwise around this diagram 16 times, each cycle taking about 177 seconds.

This score superimposes all 16 cycles to show the general pattern.

Wednesday, July 3, 2024

Compound Traversal

Here's a new algorithmic composition, in the tuning system 34edo, which divides octaves into 34 equal steps rather than the conventional 12 equal steps.

Changing the tuning system like this does two things. A tuning system makes available some collection of intervals, the building blocks of music. Sometimes this collection of intervals is unconventional. But here I am using very much the same basic intervals in 34edo that conventional musics uses in 12edo, most fundamentally the major third and the perfect fifth, along with the octave. This new composition is not something that would work in 12edo, but the difficulty is not with the basic intervals being used.

The other characteristic of a tuning system that matters musically is how the intervals combine to form more complex intervals. With a tempered tuning system, some complex combinations end up being equivalent to a unison. Such a complex combination is known as a comma; when the tuning system makes it equivalent to unison, then the tuning system is said to temper out the comma.

The conventional 12edo system tempers out the syntonic comma: combine four perfect fifths and a minor sixth and, in 12edo, you will end up three octaves above your starting point. 34edo does not temper out the syntonic comma: the same combination of intervals ends up slightly sharper than three octaves.

The most basic commas tempered out by 34edo are the diaschisma, four perfect fifths and two major thirds, and the W├╝rschmidt comma, eight major thirds and a perfect fourth. This new algorithmic composition is built from traversals of these two commas. A comma traversal, sometimes called a comma pump, is simply a sequence of the intervals that compose a comma. When the comma is tempered out by the tuning system, the comma traversal will return to the starting pitch. Thus one can repeat the comma traversal and the pitch of the music will not drift up or down.

Conventional 12edo does not temper out the W├╝rschmidt comma. That's why this piece would not translate to 12edo. The same sequence of intervals could be used, but in 12edo the piece would drift in pitch.

The piece here is predominantly 27 traversals of the diaschisma. But every third traversal, the sequence is shifted by a major third. With 9 such triple traversals, separated by 8 major thirds, the first and last triples are separated by a perfect fourth. The end of the piece ties back to the beginning.

The way the piece is constructed algorithmically, it starts with just this simple sequence of intervals. The piece is almost 27 minutes long, so each traversal of the diaschisma is about a minute in duration. There are six intervals in the diaschisma. So the initial structure of the piece has pitches being repeated over about ten seconds, then shifting by a perfect fifth or a major third, then another ten second repetition, etc.

The algorithm I use is based on statistical mechanics, with temperature as a key parameter. Consonance is treated as low energy, and dissonance as high energy. At low temperature, pitches will be chosen to be maximally consonant. At higher temperature, more dissonance will be allowed. In a system like this, there will typically be a phase transition, a temperature below which the system will have long range consonance, and above which the overall consonance will break down. Right around the phase transition, there are typically fractal variations. The hope is that such fractal variations in consonance and dissonance will provide musical interest.

This is a plot of the temperature and energy computed in the course of the construction of this piece. The thermodynamic simulation is initiated with the simple comma traversal structure and with low temperature. The temperature is gradually raised; this involves reassigning pitch values to moderately less consonant alternatives. A phase transition is characterized by a rapid rise in energy with a small change in temperature. The composition process ends when this rapid rise is detected.

Tuesday, June 25, 2024

Tempering Commas

My grand project is to cultivate a philosophy of science based on Buddhist principles. The foundation is seeing concepts in general as of limited value, as conventional and pragmatic. A common idea about science is that it is a convergent process, getting closer and closer to some final comprehensive theory. I propose instead that scientific theories are adaptive to particular circumstances, and will shift as circumstances shift. In part this is a reflexive process, where theories drive the changes in circumstances to which they must then respond. Our present ecological crisis is a primary instance of this reflexive instability. In general, clinging to concepts, overvaluing them, is the root of suffering. We seem to be doubling down on the modern technological project of controlling the world. I am hoping that we can somehow avoid learning the hard way what a profound global cultural bankruptcy might look like.

Musical tuning is a very small technical discipline, simple enough yet rich enough to provide a good sandbox for exploring what non-convergent theorizing can look like. The conventional tuning system, 12 equal divisions per octave, or 12edo, is so well established that it can easily seem that the process of convergence is complete and the ultimate theory has been achieved. These are the universally and absolutely true notes or intervals. Any alternative is necessarily a lesser approximation to the truth.

The limits and flaws of the conventional tuning system, 12edo, are sufficiently evident that many people have explored alternate systems. There are two ways to think about this kind of exploration. One can see it as convergent, that somehow a better tuning system than 12edo will be found, and then perhaps an even better system. The other perspective is that the exploration is more about real alternatives. Tuning systems are not particularly better or worse, but simply different. One or another tuning system might be better or worse for some particular purpose, for a particular piece of music or for a particular instrument. But there may be no absolute ranking independent of the details of some particular intended use.

Just intonation is a tuning system that can easily tempt a person to believe in, as an ultimate theory. But looking at the practical use of tuning systems, there is a lot of music that just cannot work with just intonation. With just intonation, intervals will conform to rational frequency ratios involving small primes, e.g. a perfect fifth of 3:2 and a major third of 5:4. But these intervals can easily be combined to form intervals such as 81:80 which are very close to 1:1. These small intervals are known as commas. Tempered tuning systems will provide some more limited collection of pitches, treating as equivalant some pairs of intervals that would differ in just intonation by such commas.

This is a chart of just intonation intervals involving the prime factors of 3 and 5. All intervals have been folded into a single octave range. The numbers are in terms of cents: 1200 times the base 2 logarithm of the ratio. Moving from one cell to the cell on its right is multiplying by 3, which, when folded into a single octave, becomes 3/2 or 3/4. The base 2 logarithm of 3/2 is 0.585. Multiplying this by 1200 gives 701.955 cents. Moving up or down a cell in the chart is moving up or down by major thirds, by 5/4 or 8/5.

I have highlighted in the chart the small intervals, the commas, that are less than 50 cents. This chart could of course be expanded indefinitely. It should be clear that there are very many such small intervals. This is an echo of the one of the earliest crises in the project to build an ultimate theory of reality. The Pythagoreans discovered irrational numbers, which ruined their project to understand the world in terms of rational numbers.

Here I have zoomed in to the central part of the chart, and labeled most of the commas by their conventional names. (I used tonalsoft as a source for these names.) I would like to focus here on three commas, all of which are tempered out by 12edo.

  • the syntonic comma is a combination of four perfect fifths and a major sixth. This is the ratio 81:80.
  • the diesis is a combination of three major thirds, the ratio 125:128.
  • the diaschisma is four perfect fifths and two major thirds, the ratio 2025:2048.

The simplest class of tuning systems is those that divide octaves into some number of equal parts. This table shows many of the most useful such systems. It gives the accuracy of the tuning, as the difference from just intonation. It also highlights which of these three commas are tempered out by the tuning system.

Conventional music in the tradition of e.g. Mozart is based on tempering the syntonic comma. This means that dividing octaves into 19 or 31 steps instead of the conventional 12 will still allow one to play most such music just as it is written. Dividing octaves into 53 equal steps provides intervals very close to those of just intonation, but since none of these simple commas are tempered out... one is forced into rather unconventional music.

This leaves 34edo. It has an attractive degree of tuning accuracy, but also tempers out the diaschisma. It is not as accurate as 53edo, but a bit more conventional.

A few years ago I presented a 12 note per octave subset of 34edo. Here is a new algorithmic composition using this 12 note subset.

With 12 notes per octave, this composition can be mapped straightforwardly into a 12edo version. This provides a good demonstration of what tuning accuracy is about, what difference it makes.

Monday, April 29, 2024

Traversing 65625:65536

Here is a piece of music generated by my software: 171edo inner. My code uses a lot of randomization, but within a definite structure. I'd like to show some of that structure here.

This is a score for the piece, or a graph. The x-axis is time, in seconds. The y-axis is the pitch. This piece uses a tuning system that divides octaves into 171 equal parts. The y-axis labels are in terms of this tuning. In the synthesis process I assigned pitch 0 to 110 Hertz. The total range is from about -200 to +500, or 700 steps from bottom to top. Each octave is 171 steps, so the full range of the piece is about four octaves.

It's easy to see from this graph that the pitches are not totally random. The graph has a texture, maybe a bit like knurling. This texture can be made more clear by folding all the pitches into a single octave.

Now the y-axis runs just from 0 through 170. Pitches in the piece that have values -171, 0, 171, and 342 will all be mapped to pitch class 0 on this graph. The knurled texture is very clear here. Part of the structure I imposed on this piece is a scale: out of the full 171 pitch classes per octave, I only allow 22 to occur. These 22 pitch classes are somewhat evenly spaced, with narrower and wider spaces interleaved in a pattern somewhat reminiscent of the whole and half steps of a conventional diatonic scale.

It's also clear here that there is some pattern that is repeating across time. I set the program up to start with a fixed sequence that was repeated 64 times, and then let the program randomly adjust that pattern to create some interesting variation. The time axis can be folded in the same way that the pitch axis was folded, so all 64 cycles are super-imposed:

This is the basic elementary structure that gets repeated. It looks a little bit like a staircase. The 22 note per octave scale was designed to accommodate this staircase structure. To understand how this structure works, we need to dive into some tuning theory. A Tonnetz diagram is an effective tool to guide this exploration.

The numbers in this matrix are pitch classes in the tuning with 171 steps per octave. In this tuning, the best approximation to the just tuned perfect fifth, a frequency ratio of 3:2, is 100 steps. So, for every cell in the matrix, the next cell to the right is 100 steps higher - possibly folded back into a single octave by subtracting 171.

The best approximation to the just tuned major third, a frequency ratio of 5:4, is 55 steps. So, for each cell, the next cell above it has a value 55 steps higher, again perhaps folded back into the single octave.

So this diagram is a map of how one moves across the available pitch classes using steps of perfect fifths and major thirds. Since there are only 171 possible pitch classes in this tuning, wandering around by these intervals will not continue to result in new pitch classes forever: at some point there will have to be some repetition. It's easy to see in this diagram that moving by 8 perfect fifths and 1 major third, one ends up back at the same pitch class where one started. This would correspond to a just tuned interval of 32805:32768, a very small interval. These small intervals are called commas; this particular comma is known as a schisma. For 171edo, moving by this comma returns one back to the starting pitch class. Because of this, 171edo is said to temper out the schisma.

Conventional music, as, for example, Mozart composed, is based on these fundamental intervals, the perfect fifth and the major third. Another fundamental interval that the science of acoustics presents but that is not so evident in most music, is 7:4. It doesn't match very well any interval on a piano or in a conventional scale, so it doesn't even have a widely used name. There's a significant community among musicians that have been exploring how to use this and related intervals in music. I would not be surprised to learn that their use has a long history in various traditions different from that represented by Mozart. Anyway, my algorithmic composition methods are my way of exploring a broader palette of musical intervals.

One challenge with this broader palette: the Tonnetz diagram needs another dimension! This is not so easy to show on a flat screen or piece of paper! A bit of imagination will be required.

The just tuned interval of 7:4 is best approximated in the 171edo tuning by 138 steps. So one can imagine layers of cells above and below the Tonnetz matrix, where the next cell above a cell has a pitch class 138 steps higher, again potentially folded back into the single octave.

At this point we have the materials in hand to explain the 22 note scale I have engineered. I should say up front: I expect that other folks have used this same scale, and probably across many decades, if not centuries. All this is simple mathematics. People have been exploring music and mathematics for a very long time. But I like to work these things out for myself, and that's what I am doing here!

The 22 colored cells in the Tonnetz matrix represent the 22 pitch classes in the scale. Again these cells repeat in the matrix just because there are only 171 pitch classes so they just have to repeat. If we zoomed out, there would be further repetitions in other directions. But we need to imagine also the vertical dimension. Above the 0 cell is the 138 cell, and below the 138 cell is the 0 cell. One can thus see from the diagram: if one starts at the 138 cell, moves 5 major thirds, through the 22 cell, the 77 cell, the 132 cell, the 16 cell, to the 71 cell, and then from there one can move a perfect fifth to the 0 cell. From the 0 cell one can move by the 7:4 interval to get back to the 138 cell. Altogether this combination of intervals corresponds to the just interval 65625:65536, known as the Horwell comma. 171edo tempers out the Horwell comma.

So this describes the pattern that I set up in my software and repeated 64 times: 5 moves of a major third, one move of a perfect fifth, and one move of 7:4. This set of moves brings us back to where we started, ready to repeat the cycle. The software can work with this pattern without being constrained by a scale, but my hope is that the scale gives a little extra regularity to make it easier to listen to. The scale does help the program too, by preventing the randomization from going too far off track!