Xenharmlib: A music theory library that supports non-western harmonic systems

58 retooth 5 7/8/2025, 10:37:21 PM xenharmlib.readthedocs.io ↗

Comments (5)

ksr · 3h ago
Fascinating. I'm working on many adjacent pieces myself - my name for this whole initiative is music-i18n because I see it as the equivalent of adding software layers to support world languages and locales - in this case musical ones.

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!

bntr · 2h ago
A bit tangential, but I recently made a xenharmonic-related library too - focused more on the visual/harmonic space side:

https://github.com/bntre/cs-rationals/blob/master/RationalsE...

Demo piece: https://www.youtube.com/watch?v=y_x4vtS_I7w

retooth · 20m ago
Oh, neat :) This looks really cool. In one of the upcoming versions of xenharmlib I am planning to add hooks for visualization plugins, so structures can be rendered in JupyterLab. Maybe you would be interested in contributing, however it will take some time before JI is supported.
bntr · 2h ago
My actual question: do you use xenharmlib for composing?

I assume this is your album: https://fabianvallon.bandcamp.com/album/a-different-path-for...

Was xenharmlib used in it, or some other software?

retooth · 36m ago
Yes, I do. For the actual score composition I used Ableton, but xenharmlib can export SCL files to define microtonal scales, which then can be imported in Ableton (a lot of other DAWs and VSTs support this format too).

For the most part however I use xenharmlib for theoretical aspects of music. I got interested in the "31 Equal Divisions per Octave" tuning a couple years ago, because of its psychoaccustic potentials, but thinking about chords, modes, notation in 31-EDO made my head hurt, so I built the library to help me think and answer my questions.