I am especially interested to hear your plans / thoughts about the following:
- Supporting non-ET tunings
- Supporting tetrachords and other scale building blocks (like Arabic ajnas)
- Importing/exporting MusicXML
- Exporting to MIDI
Thanks!
I am especially interested to hear your plans / thoughts about the following:
- Supporting non-ET tunings
- Supporting tetrachords and other scale building blocks (like Arabic ajnas)
- Importing/exporting MusicXML
- Exporting to MIDI
Thanks!
1. Just Intonation and non-linear temperaments are on the roadmap, but there are a couple of design problems I still have to figure out, mainly how to have a consistent definition of interval objects in regards to transposition if the distances between notes are uneven. It works nicely, if one uses multi-dimensional tunings, e.g. in a 5-Limit tuning with 3 dimensions every interval obtained from two notes can be applied to any other note as a measure of transposition distance, but once you reduce it to one dimension you can have two notes which form an interval that can not be applied to every note without reaching a note that is outside the temperament.
2. Tetrachords are already supported and can be easily defined using the scale object. There is no quartertone notation yet, but if you are happy with Up/Down Notation you can analyze arabic ajnas by using EDOTuning(24) as the base. Currently there is no pitch/note sequence object, so downward scale movement in maqams can not be properly defined, but if you are interested only in the harmonic qualities, scales should do.
3. MusicXML sadly does not have good support for non-12-EDO tunings. You can define quartertone accidentals by providing floats (like 0.5) as accidental values, but this gets increasingly difficult if you want to do anything other than 24-EDO. I looked into the MEI format as it supports at least turkish makam accidentals, but a more generalized semantic definition for arbitrary EDOs seems to be out of reach for the foreseeable future. One could however think of supporting MEI for a couple of tunings (like 24- or 53-EDO)
4. MIDI is also somewhat difficult. There is the MPE specification which allows individual note bending, however it is not supported by any python library as far as I can tell. One could try to hack something with channel pitch bends, but it would be limited to playing 16 notes at the same time.
I am still looking for contributors, so if you are interested in these things, feel free to contact me ;)
1. In my own similar library (https://github.com/infojunkie/scalextric) I decided to pragmatically throw an exception if the transpose method is called on an untransposable scale... At the moment I'm not trying very hard to handle all the cases of transposability - I'm sure there's a mathematical object like a group or ring to describe such cases.
2. I'll read your code to understand better how you handle sub-scale sequences. I would like to revisit my own approach to start at the dyads (sequence of 2 tones plucked from a given tuning) and build up longer sequences from those. I think this would allow to distinguish between ascending and descending sequences in a natural way.
3. I've spent quite a bit of time with MusicXML, and some time with MEI as well.. Yes, neither format has a model for arbitrary tunings which is a glaring gap. MusicXML does represent the full set of visual accidentals (including custom SMuFL glyphs) as well as per-note decimal pitch alterations that can accommodate any cent value. MEI also represents a reasonably complete set of accidentals although it's a closed set, as opposed to MusicXML's open set of accidentals. MEI supports a few pre-defined tunings which also falls short of generality. In addition, MEI does not support per-note pitch alterations, which makes it even harder to represent anything outside the tunings that it pre-defines.
There's unfortunately little activity to update these formats to include general tunings. I'm having discussions in both communities, maybe you'd like to add your voice: https://github.com/music-encoding/music-encoding/issues/1167, https://github.com/w3c/musicxml/discussions/586.
4. I've also spent quite a bit of time on MIDI microtonality... There are 3 main approaches that I'm aware of:
a. MIDI Tuning System which maps the 128 MIDI notes to arbitrary frequencies.
b. Pitch bending which has the limitation that you mentioned above. MPE is essentially an organized methodology for reusing empty MIDI channels in a round-robin fashion for pitch bends and other controller effects.
c. MIDI 2 supports per-note controller settings out of the box, thereby superseding MPE.
My current focus is to create a MusicXML => MIDI conversion pipeline that supports arbitrary tunings, using Verovio as the MIDI conversion engine. I am of course "inventing" new MusicXML elements to represent these tunings and their mappings (and MEI elements too, because Verovio represents its own internal state based on MEI). My aim is to produce a MIDI version of the canonical Sagittal Example (https://www.sagittal.org/exmp/index.htm) from a MusicXML file.