Be notified of new releases
Create your free GitHub account today to subscribe to this repository for new releases and build software alongside 28 million developers.Sign up
Version 5.5 brings some small but important improvements to
music21 and is a maintenance release. V5.5 is the first release to no longer support Python 3.4, so please use Python 3.5 or higher to upgrade.
Important changes and bugfixes.
- Chord.commonName gets many improvements, detecting for instance, the differences between dominant-seventh chords and augmented sixths.
- much better metadata on Bach Chorals (thanks Norman!)
- Stream.voiceToParts() is much improved and gets an optional
separateByIdkeyword argument which will only merge voices whose
.idmatches. -- this is very exciting to me from an analytical perspective and one reason I decided to release now.
- Volpiano is upgraded to a full conversion method. Most people will go, "buh??" people who work with Gregorian chant will rejoice.
- obj.activeSite is set more reliably.
- better error messages if a stream cannot be chordified.
- ABC parses all major and minor keys properly -- there were a few bugs especially on sharp keys in minor before. (Thanks @a-papadopoulos )
- "Cad64" is now an acceptable RomanNumeral alternative for "I64" for all you theorists out there who cringed when writing it. Resolves to I64 in major context (or as a secondary dominant) and i64 in minor contexts.
- bug fixes on rounding approximate durations (such as in MIDI parsing)
converter.parse('tinyNotation: ...', raiseExceptions=True)allows tinyNotation to bubble up anything that prevents reading a token. off by default, but useful for debugging. Expect this keyword to start appearing (w/ default False) for other conversion methods.
- Changed: as promised years ago, the default on Stream.recurse() is now NOT to include the caller itself in recursion. Use keyword argument "includeSelf=True" to do so. Recurse keywords are keyword only.
- Changed: arguments to Music21Object.contextSites are keyword only. This fixes a few little bugs. Same with Stream.elementsChanged()
- MusicXML stores Fingerings properly (thanks @hofst !)
- Fixes for extreme pitchbends (very close to wheel minimum) on MIDI.
- Dropped bug-fixes for very old versions of Sibelius and MuseScore < 2.0
- Added bug catching for MusicXML that gives the shape of the clef ('G', 'F') but no line -- uses sensible defaults. And many other cases in MusicXML where an attribute is empty (as one musicxml writer is now producing)
As always thanks to MIT, the Seaver Institute, and the NEH for funding early development of
music21 v5.3 is the latest release for music21 and the first since the v5 (v5.1) release in March 2018. The biggest feature is a major improvement to the quality of the Bach Chorales in the corpus, thanks to the amazing work of Doctor Norman Schmidt to check the files and add lyrics for all chorales. The upgrade also adds missing repeat signs (and collapses several sections that were expanded repeats).
And it's not just Dr. Schmidt we have to thank: music21 v5.3 represents an important milestone in community involvement, where for the first time, the community's pull requests have contributed much more to the development than the MIT dev. team. As I (Cuthbert) move to a new role in Digital Humanities at MIT and have less time for active music21 development, I hope that this activity continues and music21's development accelerates!
Some changes, big and small:
- ABC parsing improvements, especially Chord Symbols (Thanks to Alex Papadopoulos and Vincent Degroote) and ties and grace notes.
- Stream.containerInHierarchy(note) -- given a Score object, will retain the container (Measure or Voice) that the note or other element is in. Long-requested method.
- ChordSymbol subclass NoChord for absence of chords (thanks Alex!)
- Significant speedup in MIDI parsing (Thanks HalfVoxel)
- New module in analysis.segmentByRests (thanks to Mark Gotham)
- Chord.isSeventhOfType([0, 4, 7, 10]) lets you search for more obscure seventh chords.
- improvements to braille output (thanks ajirving)
- Setting the root or bass of a chord directly, will attempt to use the actual pitch from the chord as the root.
- compatibility w/ newer versions of Sphinx
- ABC supports C# major (thanks David Randolph)
- Improvements to docs, including ability to cut and paste code (click the >>> button on the top right)
- bug fixes for Python 3.7.
- repr bug fixes (thanks Adrian Borucki).
- ChordSymbols with Fretboards in the tablature package now export to MusicXML (import coming soon). Thanks Luke Poeppel.
- Musescore output works even if there are spaces in the filepath (thanks Philip Kirlin)
- Move to Keyword-only status: musicxml.archiveTools.*,
deleteOriginal, Stream.iterators.Iterator parameters,
- Deprecations: several unused and seldom-used Stream methods: _yieldReverseUpwardsSearch, restoreActiveSites, Chord.findRoot() (call Chord.root() instead).
- Some obscure beaming routines moved from TimeSignature to Beams.
- Lots of obscure bugs fixed through linting.
In keeping with the release of Py 3.7, and our policy of supporting the last three versions of Python, music21 v5.3 will be the last version to support Python 3.4. Please upgrade to at least Python 3.6 to stay current. A reminder that Python 2 users should use music21 v.4 or upgrade Python.
Thanks always to MIT, the NEH, and the Seaver Institute for their support of music21.
music21 v.5 is PYTHON 3 ONLY
Do not upgrade to this version if you are using Python 2.7 (or better still, upgrade yourself to Python 3.6 instead). It runs on Python 3.4-3.6 only.
music21 v.4 is the last version to support Python 2.
music21 v.5 brings with it seven months of determined work by an open-source team to streamline music analysis. The move to Python 3 allowed us to greatly simplify the codebase and to speed up many commonly used features in
music21. If you are apprehensive about switching to Python 3, I hope you'll be convinced that it is worth it the first time you run
chordify() on a large score v.5. and see that what might have taken an hour can now be done in few seconds. A great number of bugs involving working with non-English text have been fixed.
As a new major release,
music21 breaks backwards compatibility where necessary and deprecates underused functions and things that can be done better in other ways. We're always trying to balance bringing new features with keeping the software as simple to use as possible.
Python 3 only. Yes, I said that but I'm saying it again. This change has made developing much faster and a lot more fun. Also it's made music21 more powerful and faster.
Chordify moves from O(n^2) to O(n) time -- Chordify on large scores works great now.
MusicXML roundtrip now preserves much about appearance, style, metadata, etc. -- you can now load a musicxml file into music21 and back into your software and 90% of the time you'll get visually the same result as the original software. Finale roundtrip is especially good!
Corpora searching is much better and much faster. Metadata is stored in pickle format.
Feature Extraction runs multicore by default. Together with the average of 10x faster chordify, feature extraction on large datasets on multicore systems is now very strong. Parallel processing is easier and much better documented.
Features with JSymbolic equivalents much more closely match the spec and new features have been added (thanks Micah Walter!)
Many routines that used to return string filepaths now return pathlib.Path objects. Especially useful for people running on Python 3.6
Almost all functions deprecated in v. 4 have been removed.
Many keyword functions now require the keyword, so instead of
makeNotation(inPlace=True), since explicit is better than implicit, this is a good way of being sure that only the right arguments are being changed.
parsing of Volpiano (Gregorian chant notation) added.
RehearsalMarks are now supported internally and in MusicXML reading/writing.
Other musicXML improvements: Volume of individual notes is now imported and exported. Glissandi and barlines and transposition work better. More elements can be hidden. Empty spaces in MusicXML measures are converted to hidden rests, to avoid gapped streams. Pitches in chords on musicxml import are always sorted from lowest to highest. Fretboard diagrams are supported and Instrument objects have the MusicXML v. 3 sound tags attached. (thanks to Luke Poeppel for these last two)
Corpora improvments: works by Amy Beach, Schubert (Lindebaum), better Bach Chorales (thanks Dr. Norman Schmidt), and Scott Joplin. Errors in various pieces fixed.
Scales and IntervalNetworks run much faster and are better documented.
voiceLeading.VoiceLeadingQuartet improved. compatibility change: improperResolution renamed to isProperResolution and improved. Former title implied that False meant it was proper; now the title reflects the output. Many other fixes and improvements thanks to Ryaan Ahmed.
analysis.transposition -- searches pitch lists for number of distinct transpositions; neoriemannian analysis improvements (thanks to Mark Gotham for both) Stream alignment tools in alpha.analysis (thanks to Emily Zhang)
Copyright and other metadata is preserved in many formats on import. This is just being a good neighbor.
Demos and most alpha code has been moved to a new separate repository: https://github.com/cuthbertLab/music21-demos -- they will be updated much less frequently. This will also make code development faster. Thanks to all who have contributed to music21's development. We'll be able to get more demos into the codebase by not needing to update them at every moment.
Bugs fixed: chords not in voices in measures with voices were not found in some routines. Instrument objects without midiProgram explicitly set get a program on MIDI output. MIDI no longer inserts a rest at the beginning (thanks KKONZ). Chord.normalOrder fixed (thanks luiselroquero), bugs in Capella parsing. Bugs related to Apple File System High Sierra not sorting files by default. Accented braille characters are exported properly.
Docs can be downloaded as a separate zip file.
I have no major backward-incompatable plans for the near future, so I expect v.5 to have a longer life than the last few releases (at least 18 months, and possibly 2-3 years), but work will continue on smaller subreleases to come. Thanks again to MIT, School of Humanities, Arts, and Social Sciences, and the Music and Theater Arts section for their support of
music21 and the Seaver Institute and the National Endowment for the Humanities for financial support.
Music21 v. 5 beta 1 (5.0.6b1) is also a release candidate -- except for bug fixes, I do not expect to make any changes to music21 v.5 between here and the final release.
Note again: music21 v.5 is Python 3 only. Use v.4 for Python 2.7.
Changes since Alpha 2:
- braille -- accented characters translate to braille
- features -- many jSymbolic Feature Extractors match the spec more closely (thanks to Micah W. for the patches). Expect more of these improvements throughout the v.5 lifecycle.
- Bach chorales -- improvements to naming and texts. Expect more of these improvements throughout v.5. Thank you to Dr. Norman Schmidt for these.
- Improvements and fixes in voiceleading.py -- thanks to Ryaan Ahmed
- More objects can be hidden with "hideObjectOnPrint"
- Joplin, Maple Leaf Rag added to corpus
- Guitar and other fretboards supported. Thanks to Luke Poeppel
- Improvements to IPython/music21j MIDI
- Added stream alignment tools in alpha.analysis. Thanks to Emily Zhang
- docs for Stream.insertAndShift improved greatly.
- separate zip file for docs.
main changes since alpha 1:
- Better parallel processing system (esp. in terms of docs)
- Pitches are 30% faster to create, notes are 15% faster. You do create notes, don't you? :-)
- Better musicxml support: volume. Improvements to transposition, glissando, barlines
- Corpus: added works by Amy Beach, Schubert (Lindenbaum), fixed missing Bach Chorales (thanks Dr. Schmidt!) and error in Haydn op. 1 no. 1 movement 1(thanks Joshua Ballance)
- Scales, IntervalNetwork: faster and better documented.
- NeoRiemannian analysis greatly improved (thanks Mark Gotham!)
- voiceLeading.VoiceLeadingQuartet improved. compatibility change: improperResolution renamed to isProperResolution and improved. Former title implied that False meant it was proper; now the title reflects the output.
- Instrument objects now have their MusicXML v.3 sound tags attached (thanks Luke P.!)
- Bugs fixed: chords not in voices in measures with voices were not found in some routines. Instrument objects without midiProgram explicitly set get a program on MIDI output. MIDI no longer inserts a rest at the beginning (thanks KKONZ). Chord.normalOrder fixed (thanks luiselroquero), bugs in Capella parsing. Bugs related to Apple File System High Sierra not sorting files by default.
Releasing alpha 1 of v.5 of music21 quite early, because it includes an amazingly faster improved version of Chordify (thanks in large part to work by Josiah Wolf Oberholtzer)
music21 v.5 is PYTHON 3 ONLY
Do not upgrade to this version if you are using Python 2.7 (or better still, upgrade yourself to Python 3.6 instead). It runs on Python 3.4-3.6 only.
This is alpha code -- I am still formulating the changes for m21 version 5. Some things that have disappeared since v.4 may reappear, but some things that are currently here may be gone or significantly changed by v5 release. YMMV.
Other big changes:
- Python 3 only. Yes, I said that but I'm saying it again. This change has made developing much faster and a lot more fun. Also it's made music21 more powerful and faster.
- Chordify moves from O(n^2) to O(n) time -- Chordify on large scores works great now.
- MusicXML roundtrip now preserves much about appearance, style, metadata, etc. -- you can now load a musicxml file into music21 and back into your software and 90% of the time you'll get visually the same result as the original software. Finale roundtrip is especially good!
- Corpora searching is much better and much faster. Metadata is stored in pickle format.
- Feature Extraction runs multicore by default. Together with the average of 10x faster chordify, feature extraction on large datasets on multicore systems is now very strong.
- Many routines that used to return string filepaths now return pathlib.Path objects.
- Almost all deprecated functions are removed.
- Many keyword functions are now keyword only, so no worries about passing in "inPlace" accidentally.
- parsing of Volpiano (Gregorian chant notation) added.
- RehearsalMark is added (and in musicxml also).
- Empty spaces in MusicXML measures are converted to hidden rests, to avoid gapped streams.
- Pitches in chords on musicxml import are always sorted from lowest to highest.
- analysis.transposition -- searches pitch lists for number of distinct transpositions (thanks Mark Gotham)
- Copyright and other metadata is preserved in many formats on import. This is just being a good neighbor.
- Demos and most alpha code has been moved to a new separate repository: https://github.com/cuthbertLab/music21-demos -- they will be updated much less frequently. This will also make code development faster. Thanks to all who have contributed to music21's development. We'll be able to get more demos into the codebase by not needing to update them at every moment.
The remarkable work over less than a month has been largely aided by dropping the Python 2 code dependencies, so while upgrading to Python 3.6 might cause some grumbling, my ability to forge ahead quickly I hope will more than make up for it!
This is alpha code. It won't install by default on pip. Use
pip install --upgrade music21==5.0.3a1
Music21 v. 4 is released! 273 commits mean a lot of new features! See:
Download here or run
pip3 install --upgrade music21
to get the latest version
Lots of work towards the v4 release in the past 18 days, among the changes since 4.0.6:
documentation has been moved out of the music21 directory into the root directory -- it is no longer installed with music21 from pip -- this change was necessitated by the move to retina quality graphics, but reduces the installation size from 90MB to 15MB for the full corpus version and 6MB for the no-corpus version.
But docs are still extremely important as witnessed by the 3 new user's guide chapters and removal of some obsolete docs. And all docs pass a new nbval test. nbval is now required to build docs.
Chord.add (was append()) and Chord.remove() allow for direct manipulation of bugs.
Improvements to parallel processing in music21.
Ottava spanners now come in two types, transposing and non-transposing -- reflecting whether the pitches under the spanner already reflect the transposition (non-transposing) or not.
Many improvements to spanners and RomanNumerals.
.exe files are no longer generated -- they were rarely used and pip is a better choice for Windows users now.
v4.0.4 beta represents the first preview release of the new
music21 v. 4 system. As with all new "X" release names, v.4 has backward incompatible behaviors that I think are worth it for the great new features. The release is stable enough for general use and almost might be a release candidate.
among the 157 commits since v.3.1:
Major new features:
- Graphing rewrite!
.plot() and Graphing has always been one of the most powerful parts of
music21 since long before v.1.0 (mad props, Christopher Ariza!) but it's also been one of the most daunting aspects of using
music21. It shouldn't be any more. The code has gone through a major rewrite to improve the simplicity of doing easy things and the power when doing difficult things. The easy things are documented in Chapter 22 and the hard things in Chapter 44.
the all new style module and style.Style object handles aspects of a note or other object's visual display that are not (usually) semantic. This class has allowed a major increase in the ability to properly preserve MusicXML visual formatting on input and export.
Style objects are created only when needed, so el.hasStyleInformation() allows for checking for the presence of a .style object without creating one.
(To be documented more soon)
- Major rewrite of TinyNotation allows for easy extensibility.
Documented in the User's Guide! Check it out!
- Always improving docs
The User's Guide goes up to chapter 24 now, with major new examples in Chapter 20 along with rewritten chapters on keys, time signatures, sorting, and so on and so on. Plus all examples are now Retina quality for viewing fine details of scores.
Other new features
- much better metadata processing in musicxml, humdrum, and braille
- improved braille translation (tuplets) -- thanks Bo-Chen
- better beaming, meter, and tuplets in ABC
- output directly to PDF if MuseScore is installed.
- Nested Tuplets! including in MusicXML.
- Non-traditional key signatures
- New works by Clara Schumann in the corpus.
- stream.iterators.OffsetIterator() -- iterate groups of objects by offset.
- improvements to analysis.discrete
- demos/build_melody shows how to build MidiFile directly (thanks PeterMitrano!)
- corpus paths are now searchable in corpus.search()
- matplotlib and musescore graphics in Jupyter notebook are now retina quality.
Others, including bugs squashed:
- Warning on Python 2 that music21 v. 4 is the last version to support Py 2.
- ABC key signature and mode error fixed.
- AudioSearch bugs fixed (thanks jjrob13)
- Chord.normalOrderString (thanks emzhang)
- Removed lots of old crutches including the "analysisData" on Stream, Note.editorial, and others. Style fixes most of this.
- fix to Bach BWV 386 (thanks alexcoplan)
- Note.pitches returns a tuple not list, just like Chord.pitches
- Converter can deal with some wrong file extensions now.
- Instrument reprs are fixed
- configure finds many more notation programs.
- ties are imported better between elements in and out of voices in musicxml
- configure works on macOS when user directory contains spaces.
- Bugs in ending and restarting a recursiveIterator fixed.
- doc errors fixed (thanks Andrew Sanchez)
Deprecations and deprecated elements removed
- (this list does not contain changes to the alpha/ directory which can change at any time)
- Note.ps, and Note.accidental, Note.pitchClass, Note.pitchClassString, Note.diatonicNoteNum, and Note.microtone are all deprecated. Use Note.pitch.ps, etc. instead.
- Chord.normalForm is deprecated because it gave the wrong answer. use normalOrder instead; same with normalFormString
- SpannerBundle.list is deprecated; use list(SpannerBundle) instead
- with the advent of .style, el.color is deprecated, use el.style.color instead
- Stream.stream() is deprecated -- now that the transition to iterators is done, there should be no need for this.
- REMOVED stream.getOffsetByElement; use s.elementOffset(el) instead.
- REMOVED stream.haveBeamsBeenMade; use stream.streamStatus.haveBeamsBeenMade
- REMOVED stream.makeTupletBrackets(); use stream.makeNotation.makeTupletBrackets(s)
- REMOVED stream.realizeOrnaments; use stream.makeNotation.realizeOrnaments(s)
- nbconvert is no longer packaged with music21