kennethreitz/pytheory được TopGit xếp vào nhóm dự án backend, với 1.7k sao trên GitHub, viết chủ yếu bằng Python. Music Theory for Humans.
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
Explore music theory, compose multi-part arrangements, and hear them instantly — all in Python.
▶ Try it in your browser — a live demo of what PyTheory can do, nothing to install.
Documentation · PyPI · Changelog · Claude Skill
$ pip install pytheory
$ pytheory demo # hear a generated track right now
Sketch Ideas Fast
from pytheory import Score, Chord, Duration
from pytheory.play import play_score
score = Score("4/4", bpm=140)
score.drums("bossa nova", repeats=4)
chords = score.part("chords", synth="fm", envelope="pad", reverb=0.4)
lead = score.part("lead", synth="saw", envelope="pluck", delay=0.3, lowpass=3000)
bass = score.part("bass", synth="sine", lowpass=500)
for sym in ["Am", "Dm", "E7", "Am"]:
chords.add(Chord.from_symbol(sym), Duration.WHOLE)
chords.add(Chord.from_symbol(sym), Duration.WHOLE)
lead.arpeggio("Am", bars=2, pattern="updown", octaves=2)
lead.arpeggio("Dm", bars=2, pattern="updown", octaves=2)
lead.set(lowpass=5000, reverb=0.4)
lead.arpeggio("E7", bars=2, pattern="up", octaves=2)
lead.arpeggio("Am", bars=2, pattern="updown", octaves=2)
for n in ["A2", "E2", "A2", "C3"] * 4:
bass.add(n, Duration.QUARTER)
play_score(score) # hear it now
score.save_midi("sketch.mid") # open in your DAW
Music Theory
>>> from pytheory import Key, Chord, Tone
>>> Key("C", "major").chords
['C major', 'D minor', 'E minor', 'F major', 'G major', 'A minor', 'B diminished']
>>> [c.symbol for c in Key("G", "major").progression("I", "V", "vi", "IV")]
['G', 'D', 'Em', 'C']
>>> Chord.from_symbol("F#m7b5").identify()
'F# half-diminished 7th'
>>> Tone.from_string("C4").interval_to(Tone.from_string("G4"))
'perfect 5th'
>>> Key("C", "major").pivot_chords(Key("G", "major"))
['A minor', 'B minor', 'C major', 'D major', 'E minor', 'G major']
>>> from pytheory.scales import Scale
>>> Scale.recommend("C", "Eb", "F", "Gb", "G", "Bb", top=3)
[('C', 'blues', 1.0), ...]
Spelling and intervals
Chord.from_name() and Chord.from_symbol() share a general chord parser:
roots keep their written accidentals, and chord members are spelled by letter.
For example, Ebm is Eb Gb Bb, F#7 is F# A# C# E, and Cdim7 is
C Eb Gb Bbb. Common triads, sevenths, ninths, sixths, suspended chords,
add9, m7b5/ø, and dim7/°7 are supported for sharp and flat roots.
from_name() retains its historical same-written-octave voicing;
from_symbol() builds an ascending root-position voicing instead.
Spelled transposition accepts P, M, m, A, d, compound numbers and
an optional minus sign, such as -m3. interval_name_to() uses both letter
distance and pitch; descending intervals have no direction prefix.
These letter-based APIs require Western tones.
For backward compatibility, integer arithmetic is still chromatic:
Tone("C4") + 3 remains D#4, Tone - Tone returns a signed integer, and
interval_to() keeps its existing chromatic string names ("major 3rd",
"tritone", "major 3rd + 1 octave"). Semitones alone cannot tell m3 from
A2, and a tone does not carry an implicit key. Use a spelled interval for
exact musical intent, add(..., prefer_flats=None) to follow the source
accidental, or prefer_flats=True/False to explicitly choose flats/sharps.
Scientific octave labels follow the written letter: Cb4 stays octave 4
(MIDI 59, about 246.94 Hz), and B#3 stays octave 3 (MIDI 60, about 261.63 Hz).
Adding a whole number of octaves keeps that spelling: Eb4 + 12 is Eb5,
and Db4 + 0 stays Db4. Other integer intervals stay chromatic.
Roman-numeral chords use the same letter spelling: Key("C#").progression("I")
is C# E# G#, and Key("F").progression("ii") is G Bb D.
Guitar
Chord fingerings, tabs, and scale diagrams for guitar and 24 other
stringed instruments:
chord(name) is still one shape. chord(name, multiple=True) returns
several distinct playable grips — open position and movable shapes up
the neck — for any tuning or capo, best first. limit caps the list.
The ranking (stretch, fret height, fingers with barres counted once,
open strings, root in the bass, edge mutes, completeness) is documented
in the fretboard guide.
Melodies and basslines render to ASCII tablature with part.to_tab(),
and chord charts work in Nashville numbers too.
Composition
Song structure with sections, repeats, and parameter automation:
56 synth waveforms — the 10 classics (sine, saw, triangle, square, pulse, FM, noise, supersaw, PWM) plus 46 modeled instruments: Rhodes, Wurlitzer, pipe organ, vibraphone, choir, sitar, theremin, and more.
100 drum patterns — rock, jazz, bebop, bossa nova, salsa, samba, afrobeat, funk, reggae, house, trap, metal, drum and bass, and 87 more. 37 fill presets, 74 synthesized percussion sounds, stereo panned like a real kit.
6 effects with automation — distortion, chorus, lowpass, delay, reverb, and LFO modulation on any parameter. Sidechain compression, master bus compressor/limiter, stereo output.
$ pytheory repl # interactive scratchpad
$ pytheory demo # hear a generated track
$ pytheory key G major # explore a key
$ pytheory identify Cmaj7 # analyze a chord symbol
$ pytheory progression C major I V vi IV # build a progression
$ pytheory midi C major I V vi IV -o out.mid
$ pytheory play Am7 --synth saw --envelope pluck
$ pytheory modes C # show all modes
$ pytheory circle C # circle of fifths
$ pytheory tune --instrument guitar # strobe tuner, string-locked
$ pytheory studio # browser: recording → sheet music
$ pytheory live --link # MIDI synth rig, Ableton Link sync
Live MIDI input and Ableton Link sync are optional extras:
A DAW is great for tweaking sounds. But when you're thinking about music — code is faster than clicking. Sketch ideas, hear them instantly, export MIDI, finish in your DAW.
Tools like Claude Code can use PyTheory to prototype musical ideas from natural language — "write a bossa nova in A minor with a saw lead and reverb" becomes real, playable music.
Talk to it with Claude
PyTheory ships an official Claude Code plugin — six skills that let Claude compose, analyze, and notate music for you. In Claude Code:
Then just ask — "write me a bossa nova in G minor", "what's the fingering for F#m7b5?", "turn this hum into a lead sheet". See the guide. For a real album made entirely in PyTheory, hear Interpretations.
PyTheory VST
Want PyTheory inside your DAW? PyTheory VST is a set of AU/VST3 plugins for macOS 13+ on Apple silicon: a scale and chord MIDI effect, an instrument with PyTheory's 84 presets, a drum kit with its 74 sounds, and an effects chain. Each plugin ships with Python bundled inside, so you drop it in and play. Grab the latest release.
Ableton Live Extension
Prefer working inside Ableton? ableton-pytheory is an Ableton Live Extension that runs the real PyTheory package inside Live via WebAssembly. Right-click a MIDI clip to detect keys and chords, generate progressions and melodies, harmonize, arpeggiate, print sheet music, and more. No plugins, no system Python, fully offline. Needs a Live build with Extensions support (currently the Live beta).
Learn More
playground.pytheory.org — try PyTheory in your browser, nothing to install.
pytheory.org — guides, API reference, and audio examples.
pytheory-skill — the official Claude Code plugin (six skills) to make music by talking to Claude.
pytheory-vst - AU/VST3 plugins for your DAW (MIDI, instrument, drums, effects). Latest release.
ableton-pytheory - Ableton Live Extension that runs PyTheory inside Live (key/chord detect, generate, transform). Fully offline.
kennethreitz/pytheory thuộc nhóm Backend trên TopGit, cùng 6 topic GitHub. Trang Trending và Topics liệt kê các repo cùng số sao và cùng ngôn ngữ để so sánh.
Đọc thêm về kennethreitz/pytheory ở đâu?
Trang TopGit này là một snapshot — tab "Readme" hiển thị nguyên văn README của repo (đã bỏ link, giữ ảnh). Repo GitHub ở github.com/kennethreitz/pytheory là nguồn chính thức.
kennethreitz/pytheory có bao nhiêu sao?
kennethreitz/pytheory có 1.7k sao GitHub — tải lại trang để xem số mới nhất, hoặc xem trực tiếp github.com/kennethreitz/pytheory. TopGit phản chiếu số sao của GitHub nhưng không cam kết đến từng phút.
kennethreitz/pytheory có phải mã nguồn mở không?
Có — kennethreitz/pytheory phát hành theo license MIT, nghĩa là mã nguồn mở để đọc, fork và (tùy license) tái sử dụng. Mã: github.com/kennethreitz/pytheory.
kennethreitz/pytheory có trang demo không?
Dự án có trang chủ ở https://pytheory.org/. Tab "Readme" ở trang này thường có ảnh chụp và hướng dẫn bắt đầu nhanh.
kennethreitz/pytheory là gì?
kennethreitz/pytheory (kennethreitz/pytheory) là dự án Python trên GitHub. Theo mô tả gốc: Music Theory for Humans.
kennethreitz/pytheory so với các dự án Backend khác thế nào?
kennethreitz/pytheory được TopGit xếp vào nhóm Backend, với 1.7k sao GitHub và viết bằng Python. Xem trang chủ đề Backend trên TopGit để so sánh với các dự án tương tự theo số sao và mức độ hoạt động.
Đọc đầy đủ README ở tab phía trên.
Vẫn đang phân vân về pytheory?
Một cú bấm sẽ gửi câu hỏi kèm trang này cho AI — xem AI nói gì về pytheory.