Wednesday, June 3, 2026

Roll Your Own!

I was visiting the Bright Dawn Buddhist center in California recently and got to talking with Kanon Kubose about software technology. I mentioned my desire to have a web app that would allow people to experiment with alternative tuning systems. Kanon wanted to try using Claude Code. So... in just maybe a week of back and forth, we produced:

microtonal2.vercel.app

It's hardly a polished product... we need a name, for example! But it's already loads of fun to play with!

You can divide octaves into however many equal steps that you'd like, and also pick which primes should be used to define consonant intervals.

You can then build tonnetz-type diagrams whose x and y axes can be chosen from a range of consonant intervals.

The app will then show you a list of commas that the tuning tempers out. That's one of the main advantages of tempered tunings, that one can exploit in various ways commas that have been tempered out. The app will show the path on the tonnetz of a traversal of the comma one selects from the list.

You can then define a scale. A selection of Moment of Symmetry scales is provide, or one can construct an arbitrary scale manually. The scale I constructed manually is actually a Moment of Symmetry scale, generated by the 29\53 step interval corresponding to 35:24. That generating interval is just a bit too esoteric to appear in the app's list that one can pick from!

The composition algorithm, that I use and the app uses, is based on a score for intervals: low cost intervals are more likely to appear in the generated music. The scores are based on the complexity of the just intervals that each tempered interval approximates, and also on how well the tempered interval approximates those just intervals. Anyway you can play with those three sliders to get the interval cost matrix to look like it has promise.

I confess that I have not really played yet with controlling the voices in the composition. Feel free to give it a try!

Next one can specify the general structure of the composition to be produced - the number and topology of the measures. One can also control some of the basic scoring parameters: how wide or narrow should be the pitch ranges of the voices, how large should the pitch jumps of a voice be, etc. Adjusting these to see what the results sound like, that's a lot of the fun here.

The actual composition process is a thermodynamic simulation controlled by a temperature parameter. At a high temperature, pitches are chosen at random with little bias toward consonant intervals etc. At a low temperature, the lowest cost pitch will be picked. At intermediate temperatures, lower cost pitches will be preferred but there will still be a significant chance of a higher cost pitch being picked.

The pitch distribution bar chart on the right side of the screen is a good indicator of the regime that the temperature has driven the system into. With the cost structure that has been chosen, the temperature of 200 created a rather flat distribution of pitches, i.e. the system is in a high temperature regime.

4.8 is evidently a cold temperature, where the composition is dominated by just a few pitch classes.

A temperature of 8.3 has a promising pitch class histogram - not too flat, not too steep!

One can snapshot the system at whatever interesting points along the way, and then see and play a score.

The score at temperature 200 doesn't look utterly random, but nearly so. A snippet of sound: hot sound.

The cold system certainly looks ordered! And sounds it: cold sound.

The intermediate temperature indeed has intermediate structure. The sound, hmmm. It's quite a strange scale, so, hard to say! intermediate sound.

No comments:

Post a Comment