Thursday, December 31, 2020

Music21 v6.5 Released

Happy New Year! I am pleased to announce that the newest Version of music21, version 6.5 has been released. It is nearly completely backwards compatible with other v6 releases and runs on Python 3.6–3.8.  Music21 is an open-source toolkit for computational music theory and musicology, and also used in composition and music production. Download it via pip with:

pip install --upgrade music21

Version 6.5 adds several important new features since the bug-fix version 6.3 (from mid-November 2020) while squashing many bugs and speeding up a number of parts of the system. Many of the contributions were made by members of the open source community, including major contributions by Jacob Tyler Walls (JTW), Mark Gotham (MG), Néstor Nápoles López (NNL), and Paula Muñoz Lago.

Highlights include:

  • PartStaff objects such as a staff of a piano part now export properly back to MusicXML as one part with <staff> tags. Huge work by JTW!
  • RomanText is now a valid output format in addition to input! Save your analyses for later! Thanks Mark Gotham!
  • search/lyrics now finds second and subsequent lyrics (thanks to Paula ML and DIDONE project)
  • Improvements to VI and VII roman numerals in minor (JTW)
  • MIDI tries to import part names from instruments (JTW)
  • MIDI properly reads and writes conductor tracks (JTW)
  • Doc improvements for many places including RomanNumerals, insertIntoNoteOrChord, chordify with GraceNote (MSC)
  • Major speedups for many chord actions including getLeadingTone, isTriad, isMajorTriad, etc. (NNL + MSC w/ JTW)
  • music21 loads or starts up in 1/3 the time as before. (MSC)
  • Opus.write() improvements -- now all filenames of an Opus write call have similar names and only the last filename is returned (JTW)
  • All properties in music21 are readable without raising an exception. This will help inspection/debugging software. (MSC)
  • Staff-type is imported and exported properly to/from musicxml as the .staffType attribute on layout.StaffLayout objects. .staffLines is now settable on all Stream types (not just Parts) as a shortcut to manipulating layout.StaffLayout().staffLines at the start of the Stream. (MSC)
  • roman.RomanNumeral.isNeapolitan() (MG)

Smaller features and bug fixes:

  • midi.realtime.StreamPlayer now allows for non-blocking playing and for stopping at various points. (antran22)
  • If scratch/temp directory is not writable or does not exist, use backup directories (JTW + Tanchihpin0517 )
  • Use subprocess.run() for launching external tools (JTW)
  • Deprecated method Environment.launch() is removed. (JTW)
  • MusicXML reader selection improved, especially on Windows (MSC)
  • Refactor of the musicxml subpackage for smaller files and more expandability (MSC)
  • Default readers set for Unix (Thomas Wilson).
  • RomanNumeral parsing improvements, esp. for chords like V7b5. (MSC)
  • testing is moved to Github Actions for faster responses. Thanks to Travis-CI for years of support (MSC)
  • works on Python 3.9 -- v6 is likely the last version to support py 3.6. (MSC)
  • Instruments outside of voices are retained when making measures (JTW)
  • all tests pass on Windows for windows developers. (JTW)
  • better installation on conda-forge w/ a webcolors change (JTW)
  • unmeasured scores export to MusicXML better (JTW)
  • MIDI instruments no longer get incorrect durations (JTW)
  • MIDI pitch bends are easier to understand (JTW)
  • Improved tuplet brackets when number is not shown (JTW)
  • Coverage improved (MSC + JTW)
  • Better commonName for 0, 1, 2 note chords, and microtonal chords (MSC)
  • .show('scala') works on more scales. (JTW)
  • More XML Chord symbols import (JTW)
  • Fixes for aadd6 and other chord symbols where the name of the note ("A") is also present in the modifier ("Add") (JTW)
  • Chord.quality returns "other" for C C# E G (MG)
  • An empty degree-alter now matches MusicXML spec (JTW)
  • ABC and MIDI parsing cleanups to make it easier for developers to extend (MSC)
  • Very old musicxml files with empty "tie" elements parse better. (JTW)
  • Improved handling of omitted pitches in RomanNumerals (JTW)
  • instrument.deduplicate() removes duplicate instruments at the same offset in a stream (JTW)
  • Repeat endings with no number displayed now export to musicxml properly (JTW)
  • Several routines such as findGaps were leaving Streams in corrupt states -- fixed (MSC)
  • partitionByInstrument() no longer leaves instruments with non-zero durations (MSC)
  • MuseData reading works properly on zip files created on an OS with different line breaks (MSC)

Thanks always to the Seaver Institute, the NEH, and MIT for support on creating music21.

I'm not sure if the next release will be v7 (with some backwards incompatible changes) or another v6 release (6.7). I do know that better piano support and percussion support are high on my lists. However, I'll be taking a bit of a break from music21 over January at least in order to get other publications out and work with my other projects. Happily, the community engagement with music21 has never been stronger and I'll still be here reviewing Pull Requests and thinking about the next steps!

-- Myke Cuthbert