Tuesday, December 10, 2024

Adventures in Tuning

Here's a new piece in 42edo, the tuning system that divides octaves into 42 equal intervals. This is my first attempt to make some music in this tuning system.

42edo first came to my attention a few weeks ago. I was thinking about tuning systems that provide good approximations to the just interval 7:4. Meantone temperament is a class of tuning systems that provide good approximations to the just interval 5:4. Perhaps an approach that mimics meantone could work!

Meantone evolved from Pythagorean tuning, which uses a chain of perfect fifths, of the just interval 3:2. The fundamental problem of temperament is shown in this graph. The marks with note name labels are a chain of just tuned perfect fifths. The green horizontal line is the just interval 5:4. The note E is the just interval 81:64. The gap between this and 5:4 is the syntonic comma. It is small enough that 81:64 tends to sound like a mis-tuned 5:4. Tempered scales tweak intervals to eliminate such annoying slight differences. Meantone tuning uses a slightly flattened perfect fifth, which pulls that E note closer to the 5:4 line.

The red horizontal line is the just interval 7:4. The Pythogorean Bb and A# are both somewhat close to 7:4. One could flatten the perfect fifths to pull that A# down closer to the 7:4 line. To pull the A# down so it lands exactly on the 7:4 line requires perfect fifths about 5.07 cents flat of just. Remarkably, to pull the E down so it lands exactly on the 5:4 line requires almost the same tweak, perfect fifths 5.38 cents flat of just. 31edo has perfect fifths 5.18 cents flat of just, so it accomplishes both goals splendidly. It is a popular alternative to conventional 12edo for very good reason!

So what about 42edo? Well, instead of A#, one could pull Bb down to the 7:4 line, by making perfect fifths about 13.6 cents sharp of just. This is clearly a bit of a wild idea, because it pushes E away from the 5:4 line. But still, it's fun to explore. 42edo has perfect fifths that are about 12.3 cents sharp of just. Hmmm.

Then, a total coincidence as far as I can tell, the XA - Monthly Tunings group on facebook voted to make 42edo the tuning of this month. Well, OK! I guess I do need to give it a whirl! This is the sort of thing my algorithmic approach to composition is for, to make it easy to try out novel tuning systems.

As a first step, I looked at how well 42edo approximates various just intervals. This chart gives the errors in terms of steps of 42edo, for just ratios with numerators along the top and denominators along the left side. For example, a just perfect fifth, 3:2, is 24.568 steps of 42edo, so it will be approximated by 25 steps. The error is 0.432 steps, as shown in the chart at the intersection of the column labeled 3 and the row labeled 1 (factors of 2 can be ignored, since 42edo provides exact octaves). This 0.432 corresponds to the 12.3 cent sharpness of the perfect fifth: each step of 42edo is 1200/42 = 28.57 cents.

In this chart, the boxes are grey when the numerator and denominator are not relatively prime, i.e. the entry is redundant. The boxes are green when the error is small. The green ratios would be good to use as building blocks in music in 42edo. The two simplest green boxes are 7:4 and 5:3. These could form a good foundation for musical structures.

My next step was to build a tonnetz diagram with these two building block intervals. 7:4 is represented by 34 steps of 42edo, and 5:3 by 31 steps. I like to use comma traversal as a large scale structure for composition. Commas tempered out by 42edo appear as repeated cell labels on this tonnetz diagram. If you start, say, at a cell labeled 0 and move 6 cells to the left, a chain of 5:3 intervals, you arrive at a cell labeled 18. You can also arrive at a cell labeled 18 by moving down 3 cells, a chain of 7:4 intervals. This coincidence corresponds to the fact that 42edo tempers out the comma 250047:250000.

The readers of this blog post can be divided roughly into two categories: those who know more about tuning systems than I do, and those who know less. The distribution of tuning expertise is surely a good example of fat tails, which is to say that most people who know more than I do almost all know a lot more, and those who know less know a lot less. As I explore and learn about tuning, I am constantly amazed that I never, for all practical purposes, discover anything new. Those who know a lot less than I might be skeptical. Surely I am out into uncharted territory, at best bordering on nonsense, if not deeply plunged! But notice... this comma 250047:250000 was named the Landscape Comma almost twenty years ago!

Once I spot an interesting comma to traverse, a typical next step is to define a scale that supports the traversal. One fun feature of scales is when they have a period that is a fraction of the octave. With tunings like 31edo that divide octaves into a prime number of equal steps, this kind of scale is impossible. But 42 = 2x3x7 is not prime! I noticed that the path from a 0 cell to a 0 cell has nice stepping stones of 14 and 28. So a scale with a period of 14 looks very nice. I put 5 notes of the the 14 in the scale, as highlighted in green on the tonnetz diagram. These form a nice path for traversal of the Landscape Comma. The music linked at the top of this post uses this scale.

Saturday, December 7, 2024

Health Science

The exact reason for the assassination of UnitedHealthcare CEO Brian Thompson may never be known, but it has certainly brought into focus the widespread frustration with medical insurance. The reluctance of insurers to pay for medical care care often enough means that people fail to get proper medical care, leading to pain, disability, and early death. Medical expenses drive many people to bankruptcy, despite their having medical insurance that on the surface should have prevented financial disaster. The medical insurance industry is generating tidy profits. Thompson's compensation was $10 million per year, and no doubt other top executives are similarly well off. There is a clear imbalance between the benefits to executives and stockholders, versus their customers.

Of course, many corporations beyond the medical insurance industry are also biased toward shareholder profits and executive compensation, at the cost of the quality of the products delivered to their customers. What makes medical insurance special is the degree of need. Medical care is often a matter of life and death. But medical insurance is just one component of medical care. U.S. health care expenditures total $4.5 trillion. Private insurers paid about 30% of this, or about $1.4 trillion. About $0.25 trillion went to the insurance companies themselves, for expenses and profits. So medical insurance is about a 6% overhead on medical spending. The small size of this number doesn't reflect all the costs of the insurance industry: for example, they have a lot of control over who gets what treatment, and may make inefficient decisions. And of course the real bottom line is not financial, but people's health.

I have seen charts that compare U.S. healthcare costs and outcomes with those of other countries. It looks quite clear that the U.S. spends an enormous amount on health care, but does not get commensurate health care results. People often post medical bills on social media, with astounding charges, often for relatively routine procedures. Pharmaceutical prices are often prohibitively expensive. To some extent, the medical insurance companies are caught in the middle. People cannot afford to pay huge insurance premiums, but they often need very expensive medical care. The insurers have somehow to allocate available funds to the most necessary care. No doubt they do an imperfect job of it, but the task is really impossible.

Health care corporations are like any other corporation: they are controlled by shareholders whose goal is profit, return on their investment. What incentives can be put in place to motivate corporations to provide high quality products at fair, affordable prices... this is a general problem. Part of the solution is the competitive nature of markets. Part of the solution is regulation by governments or other supervisory bodies. Part of the solution is cultural, a matter of changing understandings and expectations among all the various players.

Health care is a vast network of businesses and practices. Ultimately, it incorporates everything we do. For example, workplace conditions create stresses that often result in strains and injuries requiring medical attention. If workplaces were less physically stressful, there would be less need for medical care. Health care starts at home. If people help each other catch problems when they are small, there would be less need for medical care. How much of our increased medical expense is due simply to the increase in people living in greater isolation, away from extended families, away from people who catch problems before they need professional attention?

My particular interest here is in the scientific facet of healthcare. Medicine is the supreme example of a science where pure science and applied science are inseparable. Modern science is founded on physics, the supreme example of a science where pure science and applied science are separable. This separation of science from its use bears much responsibility for our global environmental crisis. Modern science is essentially driving itself out of business. The environmental crisis and the healthcare crisis are both pointing to the need for a new kind of science, a new vision of science, where pure science and applied science are understood to be inseparable. Medicine is thus the proper foundation for this new science. The healthcare crisis represents the birth pangs of a new science.

Saturday, November 23, 2024

A Tale of Two Scales

Here are three new pieces in 43edo:
  1. quite conventional
  2. less conventional
  3. quite unconventional
These are all composed by my highly randomized and highly parameterized software. I had to tweak the program in a variety of ways to coax it to produce pieces that sound reasonably musical. So some of the difference in sound is due to the different tweaks involved. But the fundamental changes were the notions of consonance and the scales.

The first two pieces use the same scale. The tuning system 43edo provides 43 equally spaced notes in each octave. The scale in the first two pieces picks 19 of these notes for use in the composition. The third piece uses a very different subset of 21 notes out of the 43. The first piece differs from the others in the set of intervals considered consonant. The second and third pieces share an extended notion of consonance.

The consonance relationships between the notes of a scale can be visualized using a lattice diagram.

This is the scale lattice used in the first piece. The fundamental consonant intervals are very conventional: perfect fifths (green arrows) and major thirds (blue arrows). This diagram is similar to the circle of fifths, but here I have prioritized the major thirds. Moving four steps along a sequences of green arrows will bring one back around close to where one started, just a blue arrow ahead. This relationship between the green arrows and the blue arrows, between the perfect fifths and the major thirds, is due to the fact that 43edo tempers the syntonic comma. Tempered scales, such as 43edo, are at the foundation of classical European music. Musicians in Europe were experimenting with a variety of tempered scales, including 43edo, in the Baroque era, before the modern 12edo scale became dominant.

This is the scale lattice for the second piece. It uses the same 19 notes per octave, but adds new consonant relationships, based on the 7:4 frequency ratio. The best approximation for 7:4 in conventional 12edo is 10 steps, which gives a frequency ratio of 1.7818. This is quite a bit sharp, one of the reasons that 7:4 is not considered consonant. In 43edo the best approximation for 7:4 is 35 steps, which gives a frequency ratio of 1.7580. This is much close to the pure interval of 1.75, so it is a natural interval to include as consonant.

This is the scale lattice for the third piece. The geometric layout of these diagrams is not fixed: what matters is what notes are present and how they are connected by consonant intervals. But this third scale is indeed very different in those relationships. For example, the 19 notes of the first two scales are connected by a single continuous path of green arrows, of perfect fifths, while in this third scale there are no green paths longer than two steps!

My hope here is that, with three algorithmic compositions based on three different scale lattices, that the sounds of the different scales can start to become apparent.

Thursday, November 21, 2024

Scale Balance

Ah, one more piece in 43edo. Earlier today I was working with a 43edo scale that had 11 pitch classes. I was considering removing one pitch class, to make it better balanced. It really looks like adding one pitch class works better! So this new piece has 12 pitch classes. You could map this to a piano keyboard! It would be mighty strange!

I rearranged the lattice and added the new pitch class. The balance is clear!

Scale Design

Here is a new piece in 43edo. This piece uses a scale with 11 of the 43 pitch classes of 43edo. I designed this scale to support traversal of the comma 12288:12005. A few months ago I posted a piece using a scale with 21 pitches classes out of 43. My idea with this larger scale was mostly to avoid supporting traversal of the syntonic comma. 43edo is a meantone tuning, so it will support traversal of the syntonic comma, i.e. it will support most conventional music. So my little project here is to take a tuning system that supports conventional music, but then to make a scale with it is unconventional. An example of this in conventional 12edo is a whole note scale. A whole note scale includes no perfect fifths or perfect fourths at all!

Instead of making as big a scale as possible that still blocks traversal of the syntonic comma, my idea here was to make a smaller scale that more narrowly focuses on traversing 12288:12005. Another feature of the bigger scale is that it can be constructed with a single generator: it was just a sequence of intervals of size 2. This new scale with 11 pitch classes does have a pretty regular structure: the scale intervals are mostly size 2 and 6, with a single size 3 interval. I have seen where people build scales with very exact mathematical order... the scale I am using here was just something I engineered in an ad hoc way.

Scale lattice diagrams helped me engineer this scale. I was looking at a lattice for the conventional 12edo diatonic scale:

Here the blue arrows show major third intervals and the green arrows show perfect fifths. Most chords are subgraphs connected by these consonant intervals. One could add further arrows for minor thirds, but these are implied by the arrows already in the lattice. A traversal of the syntonic comma appears as a loop on the lattice, e.g. 0, 7, 2, 9, 4, 0. Moving by four perfect fifths arrives at the same pitch class as moving by a major third.

There is an awful lot of good music that can be built from this diatonic scale. The lattice doesn't look so complicated, so my idea here was to make a scale in 43edo whose lattice doesn't look too terribly much more complicated:

This lattice includes red arrows for the interval 7:4. Traversing the comma 12288:12005 appears on the lattice as a loop, e.g. 0. 8, 16, 24, 32, 18, 0.

This scale looks related to 5edo. It has 5 clusters of pitch classes: {40, 0, 2}, {8, 10}, {16, 18}, {24, 26}, and {32, 34}. Hmmm, maybe it would be more symmetric if pitch class 40 was ommitted. But that would leave a pretty big hole in the scale, from 34 to 43, 9 steps. More to explore!

Saturday, October 26, 2024

Tempering 4096:4095

Here is a new piece in 140edo.

This piece traverses the comma 4096:4095 eighteen times. The repeating staircase pattern in the above score is indicative of this looping structure.

I wanted to construct a piece that traversed the comma 4096:4095, and went searching for a good tuning system, a good equal division of octaves, to do this.

This table guided me to 140edo. I looked through thousands of possible equal divisions of the octave. First I filtered out just those that temper out 4096:4095. 4096 is a power of 2. Most of my software treats octaves as equivalent notes, so powers of 2 tend to disappear. The graphical score above works this way: the vertical axis is pitch class, i.e. the pitch with the octaves erased. 4095 = 3*3*5*7*13, so the search for a good tuning system involves those primes. In 140edo, the prime number 3 is approximated by 222 steps, 5 by 325 steps, 7 by 393 steps, and 13 by 518 steps. So the composite number 4095 is represented by 222 + 222 + 325 + 393 + 518 = 1680 steps. But 1680 = 12 * 140, i.e. 1680 is exactly 12 octaves. 4095 and 4096 are both exactly 1680 steps in 140edo, so we say that 140edo tempers out 4096:4095.

This table also shows the error involved in the various tunings. E.g., the prime number 3 is actually 221.8948... steps of 140edo, which the tuning will approximate by 222 steps. The error for the prime 3 is thus 0.1052 of a step. The table shows the errors for all the primes involved, and then a combined score. I sorted the tunings by this combined score. 441edo is a bit better than 140edo, but then it is also nice to have a smaller division of the octave, so I decided to use 140edo instead.

Sunday, October 20, 2024

Harmonic Layers

Here's a new piece in 270edo. 270edo is the tuning system that divides octaves into 270 equal parts.

The main thing I am exploring here is how the meaning of unusual intervals can be clarified by a rich harmonic context. This piece pushes my usual pattern in two ways. This piece has six voices; usually I limit myself to four. Also, this piece uses intervals that approximate frequency ratios built with the prime numbers 2, 3, 5, 7, 11, and 13; I rarely go beyond 7. Intervals such as 14:13 and 15:14 have been permitted in the construction process of this piece. 14:13 is approximated by 29 steps of 270edo; 15:14 by 27 steps. So the tuning system has the precision to distinguish between these intervals. I suspect that if these intervals were heard in isolation, they would be practically impossible to distinguish. But if a richer context is provided, perhaps in the form of tetrads 9:11:13:14 and 9:11:14:15, the ear would have more information and would be able to hear the difference. Anyway, that's what I am trying to do here. With six voices, the more esoteric intervals will occur in combination with less esoteric intervals, and the ear will be able to make some sense of what is happening.

This is a graph of the piece, with time in seconds on the horizontal axis, and pitch class on the vertical axis. The pitch class is the pitch folded into a single octave. The vertical axis labels give the fraction of that single octave.

This graph shows that there is further structure to this piece, that should help clarify the meaning of the intervals. This piece traverses the comma 2080:2079 twelve times.

270edo is such a precise tuning system, one might think it to be effectively equivalent to just intonation, where the intervals are exact rational frequency ratios, rather than approximations. But 270edo does temper out many commas, as indeed any edo, any equal division of the octave, must. Another way to think about tempering out 2080:2079 is that 270edo maps 77:65 and 32:27 to the same interval.

Monday, September 30, 2024

Scales for Traversing Commas

I work with musical tuning systems that divide octaves into some number of equal steps. Conventional tuning divides octaves into 12 equal steps. A principal feature of a tuning system is how well it approximates fundamental intervals. Since the systems I work with are all built from octaves, they can represent octaves perfectly. But other intervals, such as perfect fifths (3:2) and major thirds (5:4), are only approximated. Another interval that is fun to explore is the ratio 7:4. This interval is not commonly used in conventional music, so it doesn't have a conventional name.

This is a table that shows, for three tuning systems, those that divide octaves into 12, 31, and 43 equal parts, how well they approximate these fundamental intervals. The conventional 12 equal steps per octave has the chief downside that the major third is off by 13 cents, which is definitely noticeable. The 7:4 interval is so far off, 31 cents, that it can't practically be used in conventional tuning. Of course the conventional system has its advantages: 12 is a relatively small number which makes it feasible to build and play musical instruments that use this tuning; and of course these instruments are very widespread, together with music that uses the tuning, theory in terms of the tuning, etc.

31edo, the tuning that divides octaves into 31 equal steps, is very close to quarter comma meantone. The syntonic comma, the frequency ratio of 81:80, is about 21 cents in size. The perfect fifth in 31edo is a bit more than 5 cents flat, i.e. about a quarter of a comma. A perfect fifth in conventional tuning is only about 1/11 of a comma flat, i.e. it is much more accurate. But by flattening the perfect fifth more, 31edo can represent the major third with great accuracy. By whatever fluke of mathematics, 31edo also approximates 7:4 very well.

43edo is similar to 31edo. It flattens the perfect fifth a bit less, at the cost of a greater error in the major third. The error in 7:4 is considerably greater, but still not too bad.

Another key feature of tunings is which commas are tempered out. All three of these tunings temper out the syntonic comma, and are therefore known as meantone tunings. Conventional music theory and musical notation is based on meantone tuning, whose history goes back maybe five hundred years. For each of these meantone tunings, moving four perfect fifths, e.g. from C through G, D, and A, to E, has the same endpoint as moving a major third and two octaves. The table above makes this easy to check. In conventional 12edo, 4*7 = 4 + 2*12 = 28. In 31edo, 4*18 = 10 + 2*31 = 72. In 43edo, 4*25 = 14 + 2*43 = 100. Conventional music does not distinguish between the E that is four perfect fifths from C and the E that is a major third and two octaves from C. So a tuning system that can be used with conventional music should map these two different combinations of intervals to the same final pitch.

The 7:4 interval is not used in conventional music. There are other commas, such as 225:224, that are formed by combining 7:4 with other fundamental intervals. Both 31edo and 43edo temper out this comma. Another, more esoteric, comma, is 12288:12005. In 43edo, if one moves by 7:4 four times, this is 4*35 = 140 steps. From there, move further, by a major third: 140+14 = 154. This is the same pitch one arrives at by moving a perfect fifth and three octaves: 25 + 3*43 = 154. This comma is not tempered out by 31edo: 4*25+10 = 110, while 18 + 3*31 = 111. I decided to build a piece of music around this esoteric comma 12288:12005.

An effective way to structure a piece of music is by using a scale. A tuning system provides a set of pitches; a scale defines a useful subset of these. For example, conventional tuning provides 12 pitches per octave; a diatonic scale picks out 7 of these. A scale will support traversing some commas that are tempered out by the tuning system, but not all such commas. So, for example, a diatonic scale supports traversal of the syntonic comma: there are diatonic scales that include all the notes C, G, D, A, E that traverse the syntonic comma. Another comma tempered out by conventional 12edo is 128:125 - moving three perfect fifths is the same as moving an octave. But there is no diatonic scale that includes all the notes in the traversal C, E, G#.

I have seen mention of systematic ways to construct scales, but I am very much a beginner in all this. I like to learn by exploring! I just try a variety of scale structures to see what might work. What I landed on here is a very regular structure: a scale that includes 21 notes per octave out ot the full set of 43. Pick a starting note, then take the note two steps higher, and again two steps higher, until one has 21 notes in the set. So the scale will be made almost entirely from steps of size 2, except for a single interval per octave of size 3.

I use tonnetz diagrams to work out how scales function. The standard tonnetz diagram is based on the fundamental intervals of the perfect fifth and major third:

Each number represents a pitch class. Moving right one cell corresponds to a perfect fifth, e.g. from 0 to 25. Moving up one cell corresponds to moving a major third, e.g. from 0 to 14. All the notes here are folded into a single octave. The numbers in the diagram repeat a lot: this is nature of tempered tunings. One can start at a 0 cell, move four steps to the right: 25, 7, 32, 14; and then down one cell to arrive at another cell with a 0. This is how a syntonic comma is traversed. The notes in this scale are marked in green: one can see that there is no way to traverse a syntonic comma using this scale. It is an unconventional scale!

On the other hand, starting at a cell marked 0, move two cells to the left and then down two cells. One arrives at a cell marked 8. Moving the interval 7:4 from there, i.e. 35 steps, brings one back to a cell marked 0. This is a traversal of the comma 225:224 and can be done completely within this scale. The scale supports the traversal of this comma.

The intervals 7:4 are not explicitly shown on this diagram. I want to construct music from three fundamental intervals, 3:2, 5:4, and 7:4. But a computer screen or a piece of paper only has two dimensions! So there is a bit more work involved to trace the pathways in the three dimensional space.

Here is an unconventional tonnetz diagram, a different perspective on the three dimensional network of notes and intervals involved here. This tonnetz diagram shows perfect fifths (25 steps, horizontal movement) and 7:4 (35 steps, vertical movement). Again the notes of the scale are highlighted in green. Start at a cell marked 0 and move down four cells and then to the right one cell. One arrives at a cell marked 14. This is a major third from a cell marked 0. Major thirds are not explicitly represented on this unconventional tonnetz diagram, but this tonnetz diagram shows that this scale supports the traversal of the esoteric comma 12288:12005.

Here is a third perspective on the space of notes and intervals, showing major thirds horizontally and 7:4 vertically.

Enough with the diagrams! Here is a new algorithmic composition in 43edo that uses this scale to traverse the comma 12288:12005.

Tuesday, September 24, 2024

Gridlexic

Here is a new puzzle that was developed by a team I've been working with: www.gridlexic.com. I would like to outline here, by way of an example, what is required to solve this puzzle.

This puzzle is essentially a variation of sudoku. A sudoku solution is a 9x9 array of numbers; a gridlexic solution is a 5x5 array of letters. In both puzzles, one starts with some small subset of the array already filled in, e.g.

A gridlexic solution will have 5 distinct letters in the solution. The puzzle presents 9 possible letters. Part of solving the puzzle is to figure out which 5 are in the solution, and which 4 are to be left out. Of course, if a letter is in the initial set of clues, then it will certainly be in the solution!

Each of the 5 solution letters must occur exactly once in each row, column, and outlined sector. In sudoku, the sectors are 3x3 rectangles. In gridlexic, they are irregularly shaped regions containing 5 cells. In addition to these sudoku-like rules, the letters must form words in the horizontal or vertical highlighted regions. In this example puzzle there is one vertical word with 4 letters, and one horizontal word with 4 letters. These words overlap at one cell.

Each of the 5 distinct letters in the solution will occur in at least one of the words in the solution.

Here is the solution to this example puzzle:

Each row has exactly one occurrence of each of the 5 letters in the solution, e.g.:

Each column has exactly one occurrence of each of the 5 letters in the solution, e.g.:

Each sector has exactly one occurrence of each of the 5 letters in the solution, e.g.:

The vertical highlighted cells form a word:

The horizontal highlighted cells form a word:

We certainly hope it is a fun puzzle to play!

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!

Tuesday, March 26, 2024

Circulation

In yesterday's post I discussed a type of musical instrument that presents a fixed number of keys the player can strike or press etc. to produce pitches. These pitches would be from a section of the chain of fifths. This is a very traditional meantone approach, but it can be generalized to a chain of whatever other interval is of interest. The instruments I described would have some kind of auxiliary control to allow the section to be shifted along the chain. The idea is that by shifting one step along the chain, the pitch of a single key is changed by some relatively small amount, so the pitch order of the keys is not altered. An example of such an instrument is a harp, which has seven strings per octave. Pedals allow the player to sharpen or flatten strings to follow key signature changes.

This only works for sections of suitable length. For example, a section of five pitches along the chain of fifths would be F C G D A. The next pitch on the chain is E. To shift the section along the chain one step, the F must be replace by E. This does not change the pitch order of the keys, so this works.

If one tries to use a section of six pitches, F C G D A E, to move the section one step along the chain of fifths, one would have to replace the F by B. This is a very large change in pitch that severely disrupts the pitch order of the keys of the instrument and so would be be quite unwieldy.

A seven pitch section is again practical. To shift F C G D A E B along the chain of fifths, the F needs to be replaced with F#, which again does not disrupt the pitch order of the keys of the instrument.

Observe that sometimes moving the section up a fifth along the chain involves sharpening the changing pitch, as with the seven pitch section, and sometimes involves flattening the changing pitch, as with the five pitch section.

Which size sections of the chain will preserve the pitch order when shifting along the chain depends on the exact size of the fifth. For the just tuned fifth of Pythagorean tuning, sections of size 7, 12, and 53 shift by sharpening a pitch; sections of size 5, 17, 29, 41, and 94 shift by flattening a pitch. To take 1/5 comma meantone as a contrasting example, sections of size 7, 19, 31, 74, and 117 shift by sharpening a pitch; 5, 12, and 43 shift by flattening a pitch.

These various lengths all correspond to useful ways to divide octaves to form practical tuning systems. The chain of fifths of length n needs to wrap around the octave circle to come back very close to where it started, if shifting the chain is to involve a small pitch change. So n fifths must be very close to m octaves. So m/n needs to be good approximation to the size of the fifth relative to the size of the octave. This means that dividing octaves into n equal parts will provide a good approximation to the fifth, which will be at m steps of this division.

In celebration of the beauty of these mathematical aspects of music, here is an algorithmic composition using a 19 pitch section of the fifths of 43edo: 43edo scale 19.

Monday, March 25, 2024

Shifting along the Chain of Fifths

Musical tuning systems continue to fascinate me. One path of exploration is innovation, to explore fresh territory. Another path is to look at history and to explore the foundations that the present conventions are built on. Meantone is a historically important tuning system that can still offer innovative possibilities.

The conventional 12 tone equal tempered system of today is built on the circle of fifths. The more fundamental meantone system is build on a chain of fifths. Meantone is actually a family of tuning systems. The conventional 12 tone system is just one of these. Some members of the family will close the chain of fifths into circles of different sizes; others will leave the chain unclosed.

More fundamental than the circle of fifths is the circle of octaves. One can start a scale at C, move up through D, E, F, G, A, and B, and then return to C again: a higher C that where the scale started, but the name repeats. It's another C.

The higher C has twice the frequency of the lower C. One C might be at 256 Hz, and the next higher C would be at 512 Hz. Generally, the theory of tuning systems is built on the principle that two pitches will sound consonant together if their frequencies have a simple ratio. 2:1 is about as simple as a ratio can get; that's why pitches an octave apart are so intimately related that we often just ignore their difference. That's what I'll be doing here, largely. I'll just look at pitches within a single octave range.

After 2:1, the next simplest ratio is 3:2. That's the frequency ratio for pitches a perfect fifth apart. That's why the chain of fifths is so important: the chain is like the main highway, the path built by moving from one pitch along to the pitch it is most consonantly related to (again, ignoring octaves).

The picture above shows the conventional names for the pitches along a central section of the chain of fifths. The chain can be extended indefinitely in either direction, just by adding more and more sharp symbols in one direction, or flat symbols in the other. A musical composition generally uses a finite number of pitches, and so will use just a finite section of this infinite chain. Pentatonic music will just use a five pitch section of the chain. A diatonic scale encompasses a seven pitch segment. The note naming convention A, B, C, D, E, F, G is based on the diatonic scale.

Musical compositions can be based on different sections of the chain of fifths, or might be broken into parts that use different sections, or might use more than seven pitches even in a single part. To slide a seven pitch subset up the chain, one adds the next pitch in the direction of motion and removes the trailing pitch. With the seven pitch subset, these two pitches will be nearby. If the chain is built of precise 3:2 perfect fifths, the difference between the new and old pitches will be a ratio of 2187:2048 (folding the octaves together as needed). This small ratio is the basis for the sharp and flat notation: sliding one step down the chain of fifths involves just a small tweak to one pitch of the seven in a diatonic scale.

The tuning system built on a chain of precise 3:2 ratios is called Pythagorean tuning. It runs into trouble. The Pythagorean major third is a ratio of 81:64. This is very close to the simple ratio of 5:4. When two pitches are quite close to a simple ratio like this, but still significantly off that simple ratio, they sound harsh or out of tune.

Meantone tuning is a solution to this problem. The perfect fifths are slightly flattened, in order to reduce the error in the major third. Exactly how much to flatten, that is not fixed. A range of possibilities has been used historically. The conventional 12 tone system is only a little flat, and the error in the major thirds remains significant. The graph above shows the practical range. One can see that, for example, 1/5 comma meantone balances the errors in the perfect fifth and the major third. 2/7 comma meantone balances the errors in the major and minor thirds. These and other choices have been advocated and used historically.

The fundamental problem with meantone tuning is that, in general, it is still working with the infinite chain of fifths. Many musical instruments can only provide a limited choice of pitches to be played. If there are enough choices, composers won't be overly constrained by the requirement that they don't run so far along the chain that they exceed the capacity of the instrument. Another practical possibility is that the size of the perfect fifth is chosen so that the chain is closed into a circle. This is the great virtue of the conventional 12 tone system. 12 pitches per octave is a very practical number. One can wander up and down the chain of fifths, and because it has been closed into a circle, one will never run into a wall. One can use 19 and 31 pitches per octave, along with other choices. The major thirds can be significantly better than those in the conventional 12 tone system, but the extra pitches per octave can be a bit unwieldy.

While conventional piano keyboards have 12 keys per octave, 7 white and 5 black, harpsichords and organs have been built with additional black keys, tucked alongside the conventional 5. Sometimes just one or two black keys are split. The graph above shows the pitches in a range of meantone choices for a fully extended keyboard, where each black key has been split for a total of ten black keys. One can see in this graph that the sharps and flats cross for the 12 tone conventional tuning system. In the exact Pythagorean system C# is higher than Db. For most of the usual meantone choices, such as 1/5 comma meantone, C# is lower than Db.

Another way to manage the chain of fifths, other than walls and circles, is to add shift controls to instruments. Harps are a good example of this approach. A harp has just seven strings per octave, but allows further movement along the chain of fifths by way of pedal controls. Modern electronic instruments could easily support unbounded movement along the chain of fifths. For example, a conventional 12 tone keyboard could work with a full range of the chain of meantone fifths. At any one time, the keyboard would present a range of 12 pitch choices per octave. There would be one "wolf" fifth in the tuning. But a pedal or other control could be provided, to shift the location of this wolf. At one time the keyboard might provide a range along the chain from Eb to G#. If the music requires moving a fifth up from G#, the required D# is not immediately available. But the auxiliary control could shift the Eb to D#. Generally a piece of music is not going to need the Eb at any time close to when it needs the D#, so handling the auxiliary control should not be too burdensome.

The next natural such circulating keyboard would have 19 keys per octave. These could be arranged by splitting the five black keys, and then adding single black keys between B and C, and between E and F. This could work as a simple system with 19 equal steps per octave, which is approximately 1/3 comma meantone. But such a keyboard could also work in arbitrary meantone tunings using an auxiliary shift control. So, for example, in one setting of the auxiliary control, the key between B and C would provide Cb, while in another setting it would provide B#.

Wednesday, March 13, 2024

Finding the Phase Transition

I've been using an algorithmic approach to music composition, based on thermodynamic simulation. One advantage of an algorithmic approach is its generality. One can use the same software to generate music in a wide variety of tuning systems. Other parameters can be adjusted easily, too. Of course, no algorithm is likely to generate music of the quality that a skilled human composer could produce. On the other hand, there can be some value to music that is outside the usual patterns.

These days a different algorithmic approach to composition has gained some traction, an approach that works with a large number of existing compositions, extracts some patterns, and then follows these patterns to generate a new composition that sounds much like the existing compositions. Just to be clear, the approach I am using does not use existing compositions in the execution of the software. I listen to a lot of music, and I listen to the output of my software; I tweak my software in an effort to coax it into producing something as music-like as I can. But this is a long way from the Deep Learning methods of the predominant Artificial Intelligence software.

Thermodynamic simulation is a randomized process that repeatedly adjusts the values of a large number of inter-related variables. The variables are connected in some kind of network, that defines the interactions between the variables. In my music composition software, the variables are the pitches of what is to be played at each particular time by each particular voice. When a voice is to sound a pitch at one time and then a second pitch at a succeeding time, these pitches should be nicely related if the music is to sound good. The pitches should not be too far apart, and should be reasonably consonant. Similarly, if one voice is sounding one pitch, and another voice is sounding another pitch at the same time, these two pitches need to be consonant if the music is to sound good.

If a piece is ten minutes long, each voice might involve a thousand pitch choices. During the simulation, all of these choices have provisional pitch values. Again and again, one or another of these choices is selected at random, and then the pitch selection for that specific time is reevaluated, in the context of the provisional choices in place for what that voice is to sound before and after, etc. The software will choose a new pitch for that voice at that time, preferring pitches that are consonant with the other pitch choices nearby in space and time. Then some other voice and time will have its pitch reevaluated. Over the course of the composition process, each pitch will change hundreds of times. Other related pitches will have changed between one evaluation and the next, so which pitch is most consonant may well change over the course of the simulation.

Thermodynamic simulation is driven by a key parameter, the temperature. At high temperature, the preference for consonant pitches is not very strong. At low temperature, only the most consonant pitches will be assigned. At very high temperature, the simulation will assign pitches essentially at random, so the music will be pure noise. At very low temperature the simulation will strive to maximize consonance. But if the pitches are initially very random and then the simulation is run at very low temperature, very often it will happen that in evaluating the best pitch for a particular voice at a particular time, the related pitches don't pull in a consistent direction. One pitch choice will be consonant with some neighbors but dissonant with others. There will often be no choice that is consonant with all the nearby pitches.

The way to generate pitch assignments that are mutually consonant throughout the network is to start the simulation at a high temperature and then to slowly lower the temperature. Each pitch selection provides some communication between more remote regions of the composition. The entire system can eventually negotiate mutually agreeable pitch choices in this way.

Thermodynamic simulation thus has the capability of generating pure noise at high temperature and pure order at low temperature. Neither of these makes interesting music: either extreme is quite dull! Interesting music happens in the region between total noise and total order.

The fascinating thing about this kind of thermodynamic system, whether simulated or in real physical systems, is that the transition between order and disorder is often not smooth and gradual, but can be quite abrupt. Right at the boundary between the ordered phase and the disordered phase, the system can exhibit fractal fluctuations as it wavers between the behaviors of the different phases. Fractal fluctuations are a characteristic of interesting music. So the approach I generally use for generating interesting music with thermodynamic simulation is to set the temperature to where the phase transition happens and make the pitch choices at that temperature, where consonant choices are preferred but not too strongly.

One challenge with this approach is that the temperature at which the phase transition happens is not something one can calculate in any simple way. One is basically stuck with simulating the system at different temperatures, observing its behaviors, and identifying an abupt shift. That's what the graph at the top of this post illustrates. At each temperature, the system will settle into an overall level of consonance, which corresponds to energy in thermodynamics. A highly consonant system has very low energy; a highly dissonant system has very high energy.

The graph above has a clear enough abrupt shift at a temperature of around 380. There is a sudden drop in the energy with a small change in the temperature. Locating this sudden drop is a bit tricky though, because of the random nature of the simulation. The energy is always bouncing around even at a fixed temperature. What I do to filter out this randomness is to fit a smooth curve through each small family of temperature and energy measurements. Then I look for which such small curve shows the most abrupt change in energy over a small change in temperature. That tells me the temperature of the phase transition.

Once the temperature of the phase transition has been determined, I can set the simulation temperature to that value and let the simulation run so all the pitch choices come to reflect that boundary behavior, to exhibit fractal fluctuations.

Here are two pieces generated using this approach: