Python Music Libraries Compared
The 49 main Python libraries for making, analyzing, and generating music — what each is actually for, so you pick the right one the first time.
| Library | Category | License | Install | Best for |
|---|---|---|---|---|
| Abjad | Composition & notation | GPL-3.0 | pip install abjad | Algorithmically composing and engraving complex contemporary notation. |
| ACE-Step | ML & generative | Apache-2.0 | Clone the repo, pip install -e ., then run: acestep | Fast, openly-licensed music generation you can build products on. |
| Amphion | ML & generative | MIT | git clone the repo and build the conda env via env.sh | Research and experimentation across speech, singing and audio generation models. |
| aubio | Audio analysis | GPL-3.0-or-later | pip install aubio | Lightweight real-time note-onset, pitch, and tempo detection. |
| AudioCraft (MusicGen) | ML & generative | MIT | pip install -U audiocraft | Text-prompted music and sound-effect generation and neural-codec research. |
| AudioLazy | Synthesis & DSP | GPL-3.0 | pip install audiolazy | Learning and prototyping DSP and stream processing in Python. |
| Bark | ML & generative | MIT | pip install git+https://github.com/suno-ai/bark.git | Prototyping generative speech and sound from text prompts. |
| Basic Pitch | Audio analysis | Apache-2.0 | pip install basic-pitch | Converting monophonic or polyphonic recordings into MIDI for editing or composition. |
| Bespoke Synth | Trackers & modular | GPL-3.0-only | Download binaries from bespokesynth.com or build from source; Python livecoding is built in | Modular-synth and livecoding enthusiasts who want to build patches and script them live. |
| CREPE | Audio analysis | MIT | pip install crepe | Precise fundamental-frequency tracking of single-voice audio (vocals, solo instruments). |
| DDSP | ML & generative | Apache-2.0 | pip install ddsp | Neural audio synthesis and timbre transfer with interpretable, controllable DSP. |
| Demucs | ML & generative | MIT | pip install demucs | High-quality offline stem separation for remixing, karaoke, or sampling. |
| Essentia | Audio analysis | AGPL-3.0-only | pip install essentia | Comprehensive, production-scale audio feature extraction and music description. |
| FL Studio MIDI Scripting API | DAW & host scripting | Proprietary | Built into FL Studio (v20.7+); place a device_*.py script in the scripts folder | Developers building MIDI hardware-controller integrations for FL Studio. |
| FoxDot | Live coding | CC-BY-SA-4.0 | pip install --user FoxDot (needs SuperCollider) | Beginners learning live coding in a familiar Python-like syntax. |
| Frescobaldi | Composition & notation | GPL-2.0-or-later | pip install frescobaldi, or use the installers from frescobaldi.org | Engraving publication-quality scores with LilyPond. |
| isobar | Composition & notation | MIT | pip install isobar | Building generative, pattern-based music and sonification pipelines. |
| librosa | Audio analysis | ISC | pip install librosa | Music information retrieval and audio feature extraction for research and ML. |
| madmom | Audio analysis | BSD-2-Clause | pip install madmom | Research-grade beat, downbeat, and onset detection with pretrained models. |
| Magenta | ML & generative | Apache-2.0 | pip install magenta | Learning classic deep-learning approaches to symbolic music generation and reusing pretrained models. |
| MIDIUtil | MIDI tools | MIT | pip install MIDIUtil | Simple, dependency-free generation of MIDI files from code. |
| Mido | MIDI tools | MIT | pip install mido | Reading, writing, and sending/receiving raw MIDI messages and files. |
| mingus | Composition & notation | GPL-3.0 | pip install mingus | Exploring and computing Western music theory in Python. |
| music21 | Composition & notation | BSD-3-Clause | pip install music21 | Analyzing and manipulating symbolic scores and computational-musicology research. |
| MusPy | Composition & notation | MIT | pip install muspy | Preparing and converting symbolic music datasets for machine-learning research. |
| note-seq | ML & generative | Apache-2.0 | pip install note-seq | Representing and converting symbolic music data in ML generative pipelines. |
| Partitura | Composition & notation | Apache-2.0 | pip install partitura | Research pipelines that parse and analyze symbolic music across formats. |
| Pedalboard | Synthesis & DSP | GPL-3.0 | pip install pedalboard | Batch audio processing, applying effects, and hosting VST/AU plugins from Python. |
| pretty_midi | MIDI tools | MIT | pip install pretty_midi | MIR/ML preprocessing: extracting features and piano rolls from MIDI files. |
| pydub | Synthesis & DSP | MIT | pip install pydub | Quick, scripted audio-file editing and format conversion. |
| pyFluidSynth | MIDI tools | LGPL-2.1-or-later | pip install pyfluidsynth | Programmatically playing MIDI/notes through SoundFont software synthesis. |
| pyo | Synthesis & DSP | LGPL-3.0 | pip install pyo | Writing real-time synthesis and DSP patches directly in Python. |
| python-rtmidi | MIDI tools | MIT | pip install python-rtmidi | Sending and receiving real-time MIDI messages to hardware or software ports. |
| python-sounddevice | Synthesis & DSP | MIT | pip install sounddevice | Recording and playback of audio in Python scripts and realtime callback pipelines. |
| RAVE | ML & generative | CC-BY-NC-4.0 | pip install acids-rave | Live/real-time timbre transfer and generative audio inside DAWs and Max/PD. |
| ReaScript | DAW & host scripting | Proprietary | Built into REAPER (Lua/EEL2 embedded); Python must be installed separately and enabled | REAPER users automating workflows or building custom tools and extensions. |
| Renardo | Live coding | GPL-3.0 | pip install renardo | Live-coding performances and algorithmic music using FoxDot-style Python syntax. |
| Riffusion | ML & generative | MIT | Clone the riffusion repo, or use the web app | Experimenting with spectrogram-based generation, or quick song sketches on the web. |
| Sardine | Live coding | GPL-3.0 | pip install sardine-system | Python programmers who want to live code with MIDI/OSC/SuperCollider. |
| SCAMP | Composition & notation | GPL-3.0 | pip install scamp | Composers who want to script music and get both audio playback and notation. |
| SoundFile | Synthesis & DSP | BSD-3-Clause | pip install soundfile | Loading and saving audio files as NumPy data in analysis and DSP pipelines. |
| Spleeter | ML & generative | MIT | pip install spleeter | Fast batch stem separation when speed matters more than peak quality. |
| Stable Audio Open | ML & generative | MIT | pip install diffusers transformers torch soundfile | Generating instrumental loops and sound effects locally with open weights. |
| Supriya | Synthesis & DSP | MIT | pip install supriya | Driving SuperCollider synthesis and sequencing from Python, including offline rendering. |
| thebeat | Audio analysis | GPL-3.0 | pip install thebeat | Cognitive/behavioral timing and rhythm-perception experiments. |
| torchaudio | Audio analysis | BSD-2-Clause | pip install torchaudio | Audio feature extraction and dataset/transform pipelines within PyTorch ML. |
| Troop | Live coding | See project | Download a release or run the server/client scripts; requires a backend language | Small groups wanting to co-edit live-coding sessions, especially FoxDot ensembles. |
| Vortex | Live coding | GPL-3.0 | pip install -U tidalvortex (needs Python 3.11+, liblo, Qt 6) | Python users wanting TidalCycles-style algorithmic patterns without Haskell. |
| YuE | ML & generative | Apache-2.0 | Clone the repo and run the inference scripts | Self-hosting open full-song generation with vocals from your own lyrics. |