--- id: music21 version: "10.5.0" license: BSD-3-Clause license_treatment: permissive maintenance: active --- # music21 — A Toolkit for Computer-Aided Musical Analysis and Computational Musicology. License: permissive · Maintenance: active · Downloads: 409.5K/mo ## 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 above — verify before relying. music21 is a Python toolkit for analyzing, processing, and computationally working with musical scores and MIDI data, supporting symbolic music representation and analysis workflows. 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 pip install music21 uv add music21 poetry add music21 ## Installing music21 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. 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) Requires Python 3.11 or later. 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_current - Install friction: low - Maintenance: active - Downloads: 409.5K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags music analysis python, symbolic music processing, musicology toolkit, midi score analysis, computational music, music notation parsing, music theory automation, music-analysis, symbolic-notation, musicology [View on SkillFed](https://skillfed.io/packages/music21) · [View on PyPI](https://pypi.org/project/music21/)