mirror of
https://github.com/kennethreitz/pytheory.git
synced 2026-06-05 23:00:20 +00:00
cceac40a88
New systems:
- Arabic (Maqam): 10 maqamat (ajam, hijaz, nahawand, nikriz, saba, etc.)
with Arabic solfège tone names (Do, Re, Mi, Fa, Sol, La, Si)
- Japanese: 6 pentatonic scales (hirajoshi, in, yo, iwato, kumoi, insen)
and 2 heptatonic scales (ritsu, ryo)
Fretboard improvements:
- Fretboard.guitar() now accepts tuning parameter
- Built-in tunings: standard, drop d, open g, open d, open e, open a,
dadgad, half step down
- Custom tuning via tuple: Fretboard.guitar(("E4", "B3", ...))
- Fretboard.bass(five_string=True) for 5-string bass
Docs:
- Add Musical Systems guide page with all 4 systems
- Add logo to docs
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
47 lines
1.0 KiB
ReStructuredText
47 lines
1.0 KiB
ReStructuredText
PyTheory: Music Theory for Humans
|
|
=================================
|
|
|
|
**PyTheory** is a Python library that makes exploring music theory approachable.
|
|
Work with tones, scales, chords, and fretboards using a clean, Pythonic API.
|
|
|
|
.. code-block:: python
|
|
|
|
from pytheory import TonedScale, Fretboard, CHARTS
|
|
|
|
# Build a C major scale
|
|
c_major = TonedScale(tonic="C4")["major"]
|
|
print(c_major.note_names)
|
|
# ['C', 'D', 'E', 'F', 'G', 'A', 'B', 'C']
|
|
|
|
# Build a triad from the scale
|
|
chord = c_major.triad(0) # C major triad
|
|
for tone in chord:
|
|
print(f"{tone}: {tone.frequency:.1f} Hz")
|
|
|
|
# Get guitar fingerings
|
|
fb = Fretboard.guitar()
|
|
print(CHARTS["western"]["C"].fingering(fretboard=fb))
|
|
|
|
.. toctree::
|
|
:maxdepth: 2
|
|
:caption: User Guide
|
|
|
|
guide/quickstart
|
|
guide/tones
|
|
guide/scales
|
|
guide/chords
|
|
guide/fretboard
|
|
guide/systems
|
|
guide/playback
|
|
|
|
.. toctree::
|
|
:maxdepth: 2
|
|
:caption: API Reference
|
|
|
|
api/tones
|
|
api/scales
|
|
api/chords
|
|
api/charts
|
|
api/play
|
|
api/systems
|