Just Intonation in Max MSP
Hello all! And thank you for taking the time to check out this post!
For my undergraduate dissertation in university, I am looking at the potential uses of Max MSP in generating music in pure intonation, which is able to modulate. For a little bit of context, modulating key with fixed pitch instruments has traditionally been a problem for composers, due to the unequal interval spacings that just intonated scales create, they cannot be transposed (apart from an interval of an octave) and harmony even within the scale becomes problematic when it is not calculated relative to the root of the scale. (i.e - a D minor chord constructed from the notes of a C major (just intonated) scale, will not be perfectly intonated, however a C major chord will. Due to the capacity of Max to render music using complex mathematics, and dynamically retune the intervals needed based on chosen context, I thought it would be good study for a dissertation.
Its only early days in the process, so I am currently in the planning/conceptualising stage - but I thought it would be wise at this point to conduct some research on these forums, because from some of the posts/patches I've seen, some of you are wicked smart. Ill quickly illustrate some key terms, an initial theory on modulation, and then throw out a couple of approaches Im currently considering, alongside more specific questions relating to each. First, for the purposes of this dissertation, I am taking modulation to mean, a change from one particular 'harmonic-cluster' to another - not from one established musical key to another. I am considering musical keys to be arbitrary, and the sonority of the harmony currently playing to be of utmost importance. I expect that through modulation, these harmonic clouds will drift into areas one might describe as 'half flat/half sharp // half-half flat sharp' etc..
Second, I am aiming to use a method of modulation based off the concept of similarity vs difference. This is based off the observation that it seems to work as a method of modulation within 'normal' music. For example, musicians will modulate keys around the circle of 5ths smoothly because each key is only one note different to the last one, also this principle is illustrated in this work;
https://www.youtube.com/watch?v=gVah1cr3pU0
I am dubbing this process of the overall harmony moving by shifting by one note at a time 'micro-modulation' and at this point it is important to state that I am not precious about utilising only this method, if it becomes clear that the internal mathematics involved in maintaining purely intonated harmony do not allow for this approach.
Thank you for reading this far! I know this is a lengthy post, so I appreciate your attention. I shall now describe a few potential approaches to this problem I have thought about so far, alongside specific questions relating to each.
1. (The fallback approach) To iterate the rules laid out by microtonal composers such as Harry Partch and Ben Johnston in Max MSP.
-This approach is my fallback as I believe it does not take full advantage of the particular opportunities of a computational approach as is possible with Max MSP. However, by using 'extended just intonation' these composers managed to create music that modulates between different key centres and tonalities whilst maintaining pure intonation, thus proving the process possible. I don't have any particular questions relating to this approach, though if this is something you have experience with, I would love to hear your thoughts and/or feedback.
2. Using Periodicity signature.
As frequencies with similar periodic cycles overlap, they produce a periodicity signature. An initial stack of frequencies with a particular periodicity signature can easily be generated by calculating frequencies above a fundamental by multiplying it against whole number ratios, however my question for this approach is, does anyone know a way that this process can be analysed to give a quantitive measure of the the periodicity of a particular stack of ratios? And if possible, are there any ways to calculate other complex stacks of ratios relative to how different/similar the periodicity signature they would produce would be to the initial one?
3. Similarity of individual frequencies within the stack of ratios.
Say I begin with a perfectly tuned C major chord. (Notes: C, E, and G in equal temperament) Would there be a way to tell Max to scan for possible alterations based on how little it would have to change/retune each note in the stack? For example, calculating that the harmony could move to A minor (Notes: A, C, and E in equal temperament) or E minor (E, G and B) and working out what the relative level of retuning for each of these options would be? This is my ideal method, but is quite difficult to explain, I hope I am making myself clear. Ideally within this method, the system could give the user a list of options based off the similarity (in terms of the numeric value of the frequencies) to the harmonic cluster currently playing, ideally only shifting one voice (within that cluster) at a time by any amount greater than 5/10 cents.
4. Analysis from a graphical display, perhaps using jitter/gen?
In relation to the 2nd method, which focussed on periodicity, if we overlay these perfectly intonated frequencies on a spectroscope, we can see the nodes at which their cycles overlap or come into alignment with each other. I was curious if any of you know of ways in which the data from this can be analysed or manipulated, to force the voices within the current harmonic stack (again, ideally by only one voice at a time, but im not precious) to move to the next harmonic possibility which would provide a regular/stable periodicity. I've attached a small max patch with this one to illustrate what I am talking about. The patch simply switches between a pure intonated A major 7th and A minor chord and displays the overlapping frequencies on the scope~ object.
Once again, a massive thank you for taking the time to read this post - and I look forward to hopefully hearing some of your thoughts on the matter!!
All the Best,
Alastair
modulation of just tuning is fun stuff, and i dont think you can solve it without allowing yourself to correct the pitch at one moment, namely when the key is changed (or mabye one note earlier or one note later?)
i´ve never found anything useful to prevent that you end up with different frequenices when you come back to the initial key.
and to be honest i think it can be quite interesting to just remain in the initial tuning when changin key for a while. if you use the C scale in C key, then switch to G but use the C tuning table, this is still a form of just tuning, int it?
(except of course when the piece does not need to go back to the initial key, then you can just tune the new scale to the note where the transition to the next note happens.)
myself i would always first transform note numbers to just tuning before i go to Hz, then you can see better what happens and how things fit together.
like so: if input is c# (e.g. 61) then do *16./15. ... so from now on, middle c# is 61.117313 instead of 61
you might want to contact werner mohrlok (hermode tuning) for your dissertation, IMHO the problem of imperfect chords is somehow similar to the problem of changin keys in a piece.
I have done some exploring of this in Max with Scheme. You might be interested in this video in which I demo had I made a microtonal tuning explorer patch. You could of course do this in pure Max too, but I find working in a Lisp ideal for this as Lisps believe in fractions! (as in, you can make a fractional variable, and it stays a fraction until you explicitly ask for it to be cast to a float)
https://www.youtube.com/watch?v=2L7edwef-5k&ab_channel=MusicwithLisp
Thanks for the replies guys!
I'll certainly have a further look into hermode tuning Roman, its similar to the direction I am aiming, in that it can maintain sonority between different tonal centres, whilst maintaining (mostly) just intonation . . however it also seems to be centred around a european classical conception of dominant-tonic key relationships, which is something Im moving away from with this dissertation, rather considering each particular 'harmonic cluster' currently playing as the new 'tonic.' Your point about retuning the scale once moving to the new note seems further up my street, and is something I have played around with before, but in my experience, the difference between the two tends to feel too pronounced, so ill still be needing to find ways to mitigate that psychoacoustic effect.
Nice video Iain! Cheers for the feedback, ill certainly look into Scheme. Do you know if there might be ways to evaluate different stacks of ratios in relation to their similarity/difference to each other? (In terms of the numerical outputs they would generate?
Hi Alastair,
What you're hinting at here reminded me of Sethares' work on Dynamic Tonality. Here: https://www.researchgate.net/publication/215646582_Dynamic_Tonality_Extending_the_framework_of_tonality_into_the_21st_Century
If you want to dive more deeply into these matters, his treatise and its companion website are also great resources: https://sethares.engr.wisc.edu/ttss.html
All the best,
António
Another really good book is Kyle Gann's "The Arithmetic of Listening". His website has a ton of information too. He *really* knows this stuff.
https://www.kylegann.com/microtonality.html
You should be able to do whatever you want in Scheme for Max if it's mathematically expressible. The language supports "the full numeric tower" as they say in lisp land, so you can use the fraction variables just as you would any other. Once you get used to being able to use lists of real fractions, the notion of doing just tuning in a language that doesn't have them seems horrifying!
The notion of a periodicity signature reminds me of James Tenney's concept of harmonic distance. Check out the book "From Scratch" for details.
Here's a patch I threw together when I first came across the concept. I never used it for anything--and never checked it for accuracy/fidelity to Tenney's intentions, for that matter. So it may be all kinds of wrong...
That sounds awesome! Have you been able to make progress on this? I'd love to see how it looks now. I had a very similar idea. I was wondering how they overlapped or if you had the same idea as I had.
My strategy for vertical tuning (tuning within a chord) would be to use dynamic just intonation. The idea is that for each new chord, you'd use a just intoned scale (such as 5 limit, 3 limit, or any other just scale) centered in the key that minimizes the difference (in number of cents) between the just intoned chord and the equal tempered chord. The program would iterate through all 12 keys and use the just intoned scale in the key center which was least different from the equal tempered version.
Horizontal tuning (between one chord and the next) would be more difficult, but you could shift the whole just chord up or down to match with carryover key centers, or if the key center doesn't carry over, any notes in the chord that stay the same.
One issue would be that it doesn't work with a single melody line, only with chords. Though maybe the horizontal tuning could be modified to accommodate moving melodies.
I think that is similar to what you were working on? I think it simplifies the ratio work, since it's built into the just scales.
and what if a piece is in D# maj but begins with a A min chord? this is the difficult part. to fully automate retuning, you´d needed to take more into account than the chords themselves.