pytheory  by kennethreitz

Python music theory and composition engine

Created 7 years ago
1,564 stars

Top 26.2% on SourcePulse

GitHubView on GitHub
Project Summary

Music Theory for Humans. PyTheory provides a Python framework for music theory exploration and MIDI composition. It enables musicians and developers to rapidly prototype musical ideas, experiment with harmonies, and export results to DAWs, providing a faster iteration cycle than graphical interfaces.

How It Works

PyTheory uses a Score object to orchestrate parts (drums, chords, lead, bass). Users define music with classes for Key, Chord, Scale, and Tone, specifying tempo, synths, envelopes, and effects. It supports diverse musical systems and scales. Composition involves adding notes, chords, and patterns, with options for effect automation and LFO modulation. Output includes audio previews and MIDI files.

Quick Start & Requirements

  • Install: pip install pytheory
  • Demo: $ pytheory demo
  • Requires Python. No specific version or hardware dependencies mentioned.
  • Docs: pytheory.kennethreitz.org

Highlighted Details

  • 10 synth waveforms (sine, saw, supersaw, FM, etc.) with modulation.
  • 58 drum patterns and 21 fill presets with stereo panning.
  • 6 effects (distortion, chorus, delay, reverb, lowpass) with automation, LFOs, sidechain compression, and master limiting.
  • 6 musical systems (Western, Hindustani, Arabic, Japanese, Blues/Pentatonic, Javanese Gamelan) and 40+ scales.
  • 25 instrument presets (guitar, bass, world instruments) with chord fingering.
  • Extensive command-line interface for theory queries and generation.

Maintenance & Community

No specific details on contributors, sponsorships, or community channels were found.

Licensing & Compatibility

The license type is not specified. Commercial use compatibility cannot be determined.

Limitations & Caveats

Positioned for rapid musical idea sketching and prototyping, not as a full Digital Audio Workstation. Advanced audio production may require exporting to external DAWs.

Health Check
Last Commit

20 hours ago

Responsiveness

Inactive

Pull Requests (30d)
9
Issues (30d)
7
Star History
47 stars in the last 30 days

Explore Similar Projects

Starred by Luis Capelo Luis Capelo(Cofounder of Lightning AI), Patrick von Platen Patrick von Platen(Author of Hugging Face Diffusers; Research Engineer at Mistral), and
2 more.

muzic by microsoft

0.1%
5k
AI research project for music understanding and generation
Created 4 years ago
Updated 1 year ago
Starred by Aravind Srinivas Aravind Srinivas(Cofounder of Perplexity), Dan Abramov Dan Abramov(Core Contributor to React; Coauthor of Redux, Create React App), and
11 more.

jukebox by openai

0.0%
8k
Generative model for music research paper
Created 6 years ago
Updated 1 year ago
Feedback? Help us improve.