endolith / just_intonation

Just intonation classes for music theory experiments in Python
https://endolith.github.io/just_intonation/
1 stars 0 forks source link
just-intonation midi music-theory

Just intonation classes

Actions Status codecov

This module provides pure Python classes for experimenting with Just intonation (music made from frequency ratio relationships rather than equal divisions of the octave):

Probably all of this is redundant with Scala, but

  1. I don't know how to use it.
  2. I wanted to learn by doing:
    • Just Intonation
    • Object-oriented Python
    • Unit testing

Usage

>>> 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)

Installation

One possibility is to install with pip from GitHub:

pip install git+https://github.com/endolith/just_intonation.git

Examples