A hopefully moderately useful library for exploring music set class theory
- add the packed_left and prime_form property for Allen Forte prime forms - add type annotations - add from_string convenience class factory method - fix darkest_form to always produce the same result using left-packing - amend tests to correct values (eliminated duplicates in bright lists) - produce lists of cases where Rahn and Forte primes are not the "darkest" forms (smallest sum of pitch classes) |
||
|---|---|---|
| setclass | ||
| .editorconfig | ||
| .gitignore | ||
| .pre-commit-config.yaml | ||
| LICENCE.md | ||
| pyproject.toml | ||
| pytest.ini | ||
| README.md | ||
| requirements-dev.txt | ||
| requirements.txt | ||
| tox.ini | ||
Python library for set class music theory
A hopefully useful library for exploring set classes in music theory, of arbitrary tonalities (any number of equal divisions of the octave).
Run tests
To download the code, and run the tests:
git clone https://git.jon.geek.nz/public/setclass
cd setclass
python -m virtualenv .venv
source .venv/bin/activate
pip install -r requirements-dev.txt
tox
Usage
In Python:
from setclass import SetClass
sc = SetClass(0, 3, 5, 6, 7, 10, 11) # Forte 7-20; pitch classes as integers 0-11
sc.versions
sc.brightest_form
sc.darkest_form
sc.duodecimal_notation # SetClass[0,3,5,6,7,T,E]
Proper library documentation to come soon with Sphinx.
TODO
- Documentation (Sphinx)
- Interoperate with music21 objects
- Generate MIDI files
- Generate LilyPond files for set pitches
- Calculate microtonal pitches and frequencies for use with non-dodecal tonalities