What’s new in xenharmlib 0.3.0?

The development of version 0.3.0 focused on further development of posttonal analysis tools, the introduction of interval sequences and utilities for extensions of periodic scales. For an in-detail view of all the changes, see the Changelog

Posttonal analysis

With 0.3.0 xenharmlib implements normal form and prime form calculation of scales (both Forte and Rahn algorithm) for all tunings:

from xenharmlib import EDOTuning
from xenharmlib.setc import primeform_forte

edo31 = EDOTuning(31)
scale = edo31.index_scale([2, 5, 9, 13, 16, 18, 24, 29])

print(primeform_forte(scale).pc_indices)
[0, 2, 5, 9, 13, 16, 20, 25]

See Posttonal Basics chapter for more information.

Western Notation

Contemporary Western notation is now introduced as its own notation class. (This makes it less confusing for newcomers or western-only researchers):

from xenharmlib import EDOTuning
from xenharmlib import WesternNotation

n = WesternNotation()

c_maj = n.pc_scale(['C', 'D', 'E', 'F', 'G', 'A', 'B'], 4)
print(c_maj)

interval = c_maj[1].interval(c_maj[4])
print(interval)
WesternNoteScale([C4, D4, E4, F4, G4, A4, B4])
WesternNoteInterval(P, 4)

Interval sequences

Already in 0.2.x scales could be transformed to lists of intervals:

c_maj = n_edo12.pc_scale(['C', 'D', 'E', 'F', 'G', 'A', 'B'])
intervals = c_maj.to_intervals()

With 0.3.0 intervals sequences become first class citizens of the library, right next to scales, intervals and notes:

c_maj = n_edo12.pc_scale(['C', 'D', 'E', 'F', 'G', 'A', 'B'])
maj = c_maj.to_interval_seq()
print(maj)
UpDownNoteIntervalSeq([M2, M2, m2, M2, M2, M2], 12-EDO)

Interval sequences allow to define abstractions of scales, for example defining an abstract major scale as such. These abstractions can then be used for templating or as scale classifiers or search patterns. Read more about it in the chapter about interval sequences

Periodic Scale Extension Tools

Version 0.3.0 features the periodic package, a collection of useful tools for periodic extension of scales, including structure discovery, scalar transposition, modulation suggestions and triad extraction. See the package documentation for a full feature description.