Sunday, March 27, 2022

Music21 v7.3 released

Music21 version 7.3 is released.  This is the second and probably final release on the v7 line.  I begin work on version 8 today.

Version 7.3 is a bug-fix, improvement, and maintenance release of music21.  Aside from a few obscure corners of the code, it is designed to be fully backwards compatible with the previous v7 releases (7.1).  It represents half a year's work since the original v7.1 release.

Thanks go especially to Jacob Tyler Walls who really steered the contributions to this release.

Among the major improvements in this branch are:

  • Full support for Python 3.10.
    • I've been doing all my recent dev on 3.10 taking advantage of new features, and it's great, and plays well with numpy, tensorflow, and so many other cutting edge analysis tools.
    • In keeping with music21's policy of supporting the last three versions of Python, music21 v7.3 will be the last version of music21 to support Python 3.7.  A decision on whether 3.8 or 3.9 will be the minimum version for music21 v8 will come later, depending on its release date; we may also update policy somewhat and raise the minimum version to 3.9 during the v8 cycle.
  • MIDI and MusicXML import/export will create and use Unpitched and PercussionChord objects. (slight incompatibility but worth it).
  • The stripTies method's "matchByPitch" setting is improved.
  • Slight incompatibility:  3/8 is default configured to one beat with two sub beats (like 6/8)
  • Lots more typing improvements.  mypy is now being run on a subset of the music21 code to ensure that our docs match our work.
  • Individual notes in Chords can be styled more easily and robustly.
  • The tree module is slightly better documented, for anyone who wants to work with insane speed (and complexity)
  • Some superfluous natural signs no longer appear after running makeNotation; makeAccidentals improvements throughout.  displayType="never" is now respected.
  • Improvements in instrument names and lookup (Thanks Mark Gotham)
  • Music21 gives better introspection in more developer environments. Music21 now imports its own modules individually.  The former way of doing its own imports while "legal" was preventing code analysis on some IDEs.
  • Dissonance score on certain compound intervals has been improved.
  • ChordSymbol constructor has been improved
  • Metronome marks only appear on the top staff of piano and other PartStaff scores.  Other superfluous meters and key signatures on various outputs (especially MIDI) have been fixed.
  • Braille exports voices properly; full scores including piano (PartStaff) export to Braille.
  • Ottava objects import better from musicxml
  • Bug fixes on changing RomanNumeral objects, or round-tripping chordFromFigure(romanNumeralFromChord(ch).figure), especially with bracketed alterations and on minor vi/VI/vio and vii/VII/viio
  • GarageBand is now set as the default MIDI player on MacOS.  It's a bit of overkill to be sure, but it's the only MIDI player that comes with the system, and to be honest, it sounds really good.
  • More .commonName improvements for enharmonic respellings of common chords.
  • TempoText preserves styles even if the text changes (thanks Greg Chapman)
  • RomanNumerals now treat common ways of inputting suspensions (V54, etc.) as suspensions rather than obscure 11th chords, etc.  Note, however, that RomanNumerals are not a fully consistent/comprehensive chord description format, so there will always be some gaps in coverage.
Smaller improvements and features include:

  • Root position Neapolitan chords can be written as "N53"
  • Better support for output on systems where UTF-8 is not the default.
  • Time Signatures export to MIDI
  • Instruments that normally have a certain transposition (Trumpet = Bb, etc.) now respect part parsing of "Trumpet in C"
  • More gaps in streams export to MusicXML as "forward" tags.
  • Braille output supports more technical indications beyond fingerings, such as bowings.
  • Hidden features in chord.tables are now exposed and documented.
  • chordReduction (beta) crashes less often. 
  • Figured bass input supports notation like "64" (same as RomanNumeral) in addition to the older "6, 4" syntax.
  • Date metadata supports error ranges better.
  • attachIntervalsBetweenStreams is now more robust on subsequent runs if the streams are being edited.
  • Some edge cases of ChordSymbol's with add/subtract/alter/omit have been fixed.
  • A corpus file with an offensive name has been renamed and edited.  It came from a bulk import of an existing collection that was never closely scrutinized.  There are files in the corpus from minstrel show traditions that would never been added today; however, because so many existing tutorials etc. rely on these files being in the corpus, they have not been removed now.  They may be in the future.
  • ChordSymbols with realized durations are exported properly.
  • Up to 2048th notes can now be beamed.
  • getSpannerSites can now take classes.
  • Correct spelling of "bemol" in Spanish.
  • localCorpus.removePath fixed.
  • harmony.NoChord improvements.
  • Faster MIDI import/export
  • Crescendo and Decrescendo wedges have correct and sane id numbers in musicxml output.
  • el.next(activeSiteOnly=True) no longer occasionally finds things in other streams.
  • .show('musicxml') on a single measure is improved (and works well in Finale 27).
  • Users who choose to skip makeNotation on musicxml writing (in general don't!) will have exceptions thrown if notation that cannot appear in musicxml gets through, rather than just corrupt musicxml.  This does not affect the 99.9% of us who let music21 change notation to reflect what can be written in a score. 
Deprecations:
  • TimeSignature.loadRatio() deprecated.  Use TimeSignature.load() [same] or TimeSignature.ratioString = '4/4'
  • Score.flattenParts() -- just iterate over .parts and call flatten() on that.
  • Duration.fill() -- this was a testing routine that got exposed.
Goals for the upcoming v.8 include support for MusicXML 4.0 and SMuFL and better round-tripping between various formats, cleaner typing, improved docs and faster operations.  Improved support for IDEs including Jupyter notebook and Colab will also be prioritized.

There are other new features, such as improving OMR post-processing, restoring the web/VexFlow 4.0 connection, etc., but (as people who have proposed major new features on GitHub will be aware), I'm planning on considering the core music21 largely "feature complete" and encouraging people to make external libraries (now that pip + GitHub makes this so much easier) rather than stuffing more into music21.  I'd rather focus music21 on being the core system for so much else than putting more into it.  I don't plan on removing anything currently in music21 in the next version, but you may find that they're being imported from other libraries instead.  This will let the community move at the pace some people there want while letting me guide the core project as 15 years of development on it has taught me.

As ever, music21 would not have been possible without support from the Seaver Institute, the National Endowment for the Humanities and the multinational Digging into Data challenge, and the support of MIT/SHASS/Music & Theater Arts.


No comments:

Post a Comment