Wednesday, November 18, 2020

Music21 v6.3 released

 Music21 version 6.3 has been released. Biggest new feature is compatibility with macOS 11.0 Big Sur, whose numbering system change broke music21. Major bug of corpus.search() on Windows not working should be fixed also. Chordify users get a nice upgrade also.

Update with

pip install --upgrade music21

This is primarily a bug fix release, so let's list the major bugs squashed first:

Bug fixes

  • Music21 gets the proper mac version and runs in Big Sur (thanks Daniel Fürst)
  • corpus.search() should work on PC now. Sharing music21 scores that have been frozen and thawed should also work across Mac and PC.
  • ChordSymbols preserve root and bass (thanks to Jacob Tayler Walls = JTW for this and so much else in this release!)
  • Instrument names that cannot be decoded from MIDI do not crash MIDI parsing (JTW)
  • Audio searches and other searches on empty streams are improved. (JTW)
  • Non existent user scratch directory does not raise major bugs any more (David Garfinkle and JTW)
  • New location for System/Preview on macOS since Catalina and musescore on Windows (MSC + JTW)
  • remove() now searches endElements as well.
  • Corrected octaves on pitches derived in IntervalNetwork.nextPitch() (JTW) -- should fix some weird scale pitch octaves.
  • TextExpressions now have correct offsets when derived from a tempo indication or coda (JTW)
  • MIDI files parsed multiple times with different quantization settings work properly (JTW)
  • MIDI files with zero-length notes now create zero-length GraceNotes and not 1.0 length notes in music21 (JTW)
  • All tests pass in Python 3.8 (now on to 3.9!)
  • Beethoven Opus 59 no 3 mvmt 4 contained all 4 movements in it. Now it only contains movement 4.
  • MIDI's matchedNoteOff was not working properly. Works now (Thanks SunWoong KIM)
  • If two keys had the same likelihood in probe-tone analysis then only one appeared in .alterateInterpretations. Now there will always be a 23-element list. (ZM-J + JTW)
  • C-version of Python Levenshtein was sometimes not being called even if installed. This will greatly speed up similarity searching.
  • Harmony.addChordStepModification gets an updatePitches=True attribute that will immediately apply the chordStepModification to the computed pitches. The default of False remains for now, but will become True in music21 v.7.

Improvements:

  • Chordify and Verticality.makeChords gets a new keyword attribute "copyPitches=False" which makes it so that the original pitches (and not deepcopies) from the score appear in the chordified score. This can make it MUCH easier to see which pitches in a chordified score relate to the pitches in the original. However, they are identical objects, so changing one later will change the other. Default behavior is unchanged.
  • Repeats play back properly in MIDI (JTW)
  • Improved Docs (configuration instructions, typos, examples) (many people but especially JTW)
  • Much better typing all around for developers
  • math.log2 used instead of math.log(x, 2) for no more floating point confusion in many quarterLengths (JTW)
  • Braille keeps its debugging information in Note.editorial instead of custom attributes (backwards incompatible change, but okay)
  • Braille/runAllBrailleTests improved for non-sighted developers.
  • Incomplete 7th/9th/11th chords find roots better (JTW)
  • Legacy code for Python 3.5 removed (JTW)
  • Augmented sixth RomanNumerals work w/o needing a key. Also work with secondary numerals (JTW)
  • Bach chorales sort by BWV as a number rather than a string (JTW)
  • Beethoven quartets from Project Gutenberg had hidden voices w/ incorrect durations to show playback of trills, etc. Those voices have been removed. Speeds up the parsing of those pieces greatly, and gives better feature extractions. Affected pieces are opus 59.1.3, 59.1.4, 59.2.1, 59.2.2, 59.3.2, 59.3.3, 59.3.4, and opus 133.
  • Improvements to instrument name lookups (Thanks Mark Gotham)
  • Unnecessary list comprehensions are removed.
  • For running tests, missing optional modules and Lilypond. will cause import errors.
  • ABC module has been partially cleaned up, and made easier for developers to hack new ABC extensions to.

Changes:

as this is a 6.X release, we have tried to keep backwards incompatible changes to a bare minimum, but a few obscure cases are changed:

  • .seconds.beat.beatStrength on notes without a TimeSignature or MetronomeMark context now return nan instead of raising an exception.  .beatStr returns the string "nan". Python 3.8's mock methods iterate through all properties before setting up the mocked object and properties that might raise exceptions cause problems. This seems like a good direction to go in, so please expect that all property getters will switch to never raising an exception but giving nan or another failure indicator in the future.
  • KrumhanslSchmucker and KrumhanslKessler probe tone analysis are now identical. The difference before was probably a typo. They are now synonyms for each other.

Thanks always to the Seaver Institute, the National Endowment for the Humanities, and the School of Humanities, Arts, and Social Sciences and the Music and Theater Arts Section of MIT for their support in making music21 possible. And can we all give applause to Jacob Tayler Walls for all the great work done on this release!