A music theory library, for humans.
Project description
PyTheory: Music Theory for Humans
This (work in progress) library attempt to make exploring music theory approachable to humans.
True Scale -> Pitch Evaluation
>>> from pytheory import TonedScale
>>> c_minor = TonedScale(tonic='C4')['minor']
>>> c_minor
<Scale I=C4 II=D4 III=Eb4 IV=F4 V=G4 VI=Ab4 VII=Bb5 VIII=C5>
>>> c_minor[0].pitch()
523.251130601197
>>> c_minor["I"].pitch(symbolic=True)
440*2**(1/4)
>>> c_minor["tonic"].pitch(temperament='pythagorean', symbolic=True)
14080/27
Audibly play a note (or chord)
>>> from pytheory import play
play(c_minor[0], t=1_000)
Chord Fingerings for Custom Tunings
>>> from pytheory import Tone, Fretboard, CHARTS
>>> tones = (
... Tone.from_string("F2"),
... Tone.from_string("C3"),
... Tone.from_string("G3"),
... Tone.from_string("D4"),
... Tone.from_string("A5"),
... Tone.from_string("E5")
... )
>>> fretboard = Fretboard(tones=tones)
>>>
>>> c_chord = CHARTS['western']["C"]
>>> print(c_chord.fingering(fretboard=fretboard))
(0, 0, 0, 3, 3, 3)
It can also generate charts for all known chords for any instrument (accuracy to be determined!).
✨🍰✨
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pytheory-0.1.0.tar.gz
(10.0 kB
view hashes)
Built Distribution
Close
Hashes for pytheory-0.1.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e5fdf948c79f5c19d0aef0294fa5318b2dff5fb0adf66f59589de36f301ee789 |
|
MD5 | 2a7fc9c2429cfbb6626a70863fc00b64 |
|
BLAKE2b-256 | 52e96cde425c6be0c30c8ae02a7381eef9e4cc5de56639c05bb57759c06029fb |