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!