music21
A Toolkit for Computer-Aided Musical Analysis and Computational Musicology.
Decision gist · record as of 2026-08-14
Yes, if you work with symbolic music notation, analysis, or computational musicology. Low install friction, active maintenance, no known vulnerabilities, and permissive licensing make it a safe choice. Not suitable if you need audio processing or real-time synthesis—music21 works with symbolic scores, not sound files.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.11 or later.
- Low friction: pure Python wheel with 8 runtime dependencies (chardet, joblib, jsonpickle, matplotlib, more-itertools, numpy, requests, webcolors).
- Active maintenance with a commit from 2026-08-12 and a release 58 days prior.
License · maintenance · safety
BSD-3-Clause (permissive) — BSD-3-Clause permissive license. Free to use, modify, and distribute provided you retain the LICENSE file and copyright notice. Externally provided software and encoded musical scores in the corpus may carry separate licenses.
last release 2026-06-17 (58 days) · last repo commit 2026-08-12 · 2,558 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 409,505 downloads/mo, #6,871 on PyPI
Alternatives
Verify before relying
pip install music21
from music21 import converter, stream
# Load and analyze a score
score = converter.parse('path/to/score.musicxml')
for note in score.flatten().notes:
print(note.pitch, note.quarterLength)- Whether matplotlib is required for all use cases or only for visualization features.
- Whether external music notation software (e.g., MuseScore, Finale) is needed for rendering or playback.
- Performance characteristics when processing large scores or corpora.
What it is and what it does
music21 is a Python library for symbolic music analysis and computational musicology, developed at MIT since 2010. It provides tools to parse, analyze, and manipulate musical scores in formats like MusicXML and MIDI, enabling programmatic access to musical notation, pitch, rhythm, harmony, and other analytical properties. The library is built on standard scientific Python dependencies (numpy, matplotlib, joblib) and supports modern Python versions (3.11+).
Typical workflows involve loading scores from files or URLs, traversing their hierarchical structure to extract notes and measures, performing analytical operations (harmonic analysis, voice leading checks, statistical studies), and generating visualizations or new scores. It's commonly used in music education, research, and computational analysis projects where symbolic representation of music is more relevant than audio processing.
Use it for
- Analyze harmonic progressions and voice leading in classical scores for music theory research.
- Extract melodic or rhythmic patterns from a collection of scores for statistical musicology studies.
- Programmatically generate or modify MusicXML scores based on algorithmic composition rules.
- Build educational tools that parse student compositions and provide automated feedback on notation or structure.
- Convert between MIDI and MusicXML formats for integration with other music software workflows.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you work with symbolic music notation, analysis, or computational musicology.
Low install friction, active maintenance, no known vulnerabilities, and permissive licensing make it a safe choice. Not suitable if you need audio processing or real-time synthesis—music21 works with symbolic scores, not sound files.
Install
music21 on PyPI
Before you install
Low friction: pure Python wheel with 8 runtime dependencies (chardet, joblib, jsonpickle, matplotlib, more-itertools, numpy, requests, webcolors). Active maintenance with a commit from 2026-08-12 and a release 58 days prior.
Requires Python 3.11 or later.
License in practice
BSD-3-Clause permissive license. Free to use, modify, and distribute provided you retain the LICENSE file and copyright notice. Externally provided software and encoded musical scores in the corpus may carry separate licenses.
Quickstart
pip install music21
from music21 import converter, stream
# Load and analyze a score
score = converter.parse('path/to/score.musicxml')
for note in score.flatten().notes:
print(note.pitch, note.quarterLength)
Verify before relying
- Whether matplotlib is required for all use cases or only for visualization features.
- Whether external music notation software (e.g., MuseScore, Finale) is needed for rendering or playback.
- Performance characteristics when processing large scores or corpora.
Package facts
| License | BSD-3-Clause permissive |
| Python support | Supports the current Python release >=3.11 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 8 packageschardetjoblibjsonpicklematplotlibmore-itertoolsnumpyrequestswebcolors |
| Maintenance | Actively maintained 58 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 409,505 / month, #6,871 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableEnvironment :: ConsoleEnvironment :: Web EnvironmentIntended Audience :: DevelopersIntended Audience :: EducationIntended Audience :: End Users/DesktopIntended Audience :: Science/ResearchLicense :: OSI Approved :: BSD LicenseNatural Language :: EnglishOperating System :: MacOSOperating System :: Microsoft :: WindowsOperating System :: OS IndependentOperating System :: POSIXProgramming Language :: PythonProgramming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: Artistic SoftwareTopic :: Multimedia :: Sound/AudioTopic :: Multimedia :: Sound/Audio :: ConversionTopic :: Multimedia :: Sound/Audio :: MIDITopic :: Software Development :: Libraries :: Python ModulesTyping :: Typed |
Evidence: music21-10.5.0-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “music analysis python”
- music21music21 is a Python toolkit for analyzing, processing, and…
- librosalibrosa provides audio and music signal processing algorithms and…
- mir-evalmir_eval computes standard accuracy metrics for music and audio…
Give your agent the search over MCP, or paste the wish link into any chat.
More Python Modules packages
Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.
Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.
Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.
PyYAML parses and emits YAML 1.1 data format, enabling serialization and deserialization of configuration files and Python objects to and from human-readable YAML text.
Pydantic validates Python data structures against type hints, coercing and checking input at runtime to ensure it matches a declared schema.
Provides reusable metadata objects for use with PEP-593 `typing.Annotated` to express common constraints like bounds, collection sizes, and predicates on types.
Install it if you use or build libraries that need to express type constraints in a standardized, inspectable way—or if you want to annotate your own types with…
Provides runtime tools to inspect and introspect Python type annotations, enabling programmatic examination of type hints at execution time.
See also symusic · pretty-midi · mir-eval · aubio · librosa · mido · pylast · basic-pitch · syncedlyrics · music-assistant-models