This module provides pure Python classes for experimenting with Just intonation (music made from frequency ratio relationships rather than equal divisions of the octave):
Interval(numerator, denominator)
- Represents musical interval ratios/rational intervals, a relative step between pitches
.numerator
- Numerator after reducing to simplest form.denominator
- Denominator after reducing to simplest form.complement
- The inversion or octave complement of the interval (P4 → P5, etc.).odd_limit
- The smallest odd limit of an interval.prime_limit
- Prime limit or harmonic limit of an interval.kees_height
- Kees semi-height.benedetti_height
- Benedetti height.tenney_height
- Tenney heightP1
- Unisonm2
- Minor secondM2
- Major secondm3
- Minor thirdM3
- Major thirdP4
- Perfect fourthP5
- Perfect fifthChord(4, 5, 6)
, Chord(Interval('M3'), Interval('P5'))
, etc. - Class that represents chords/triads, a combination of multiple intervals
.terms
- List of terms in the frequency ratio that makes up the chord.intervals
- List of musical intervals that make up the chord, relative to the root.steps
- List of musical intervals which, stacked together, produce the chord.all_steps
- Set of all music intervals that can be made by any tone in the chord with any other tone.odd_limit
- The intervallic odd-limit.prime_limit
- The highest prime limit of any interval found in the Chord.inversion(n)
- The nth inversion of a chordPitch(frequency)
- Class that represents absolute frequencies
.frequency
- Value of the frequency in hertzProbably all of this is redundant with Scala, but
>>> Chord(4, 5, 6).intervals
(Interval(5, 4), Interval(3, 2))
>>> M3 + m3
Interval(3, 2)
>>> Interval('P5').complement == P4
True
>>> Pitch(440) + P5
Pitch(660)
One possibility is to install with pip from GitHub:
pip install git+https://github.com/endolith/just_intonation.git