Here are the 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 ), bugs in Capella parsing. Bugs related to Apple File System High Sierra not sorting files by default.
I neglected to post on this forum the announcement of music21 v.5 alpha 1, so the many great improvements there are listed below, with a new installation link:
- 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.
pip3 install --upgrade music21==5.0.5a2
Download from https://github.com/cuthbertLab/music21/releases or from the terminal, type:
pip3 install --upgrade music21
(or without the "3" if you are using Python 2)
Version 4 is the last version of music21 that will support Python 2.7. If you run Version 4 on Python 2.7, you will see a warning that it's time to move up to the brilliance that is Python 3.6.
Upgrades for most users should work automatically by typing:
pip3 install --upgrade music21
or (Python 2)
pip install --upgrade music21
Or download from GitHub
A summary of the most important changes since v.2.2 are below:
Fun and easy to understand changes:
Lots more MusicXML support -- better support for time signatures, for grace notes, for spanners, for metadata, for...you name it! And the system is refactored in such a way as to make contributing missing features quite easy.
MIDI files play back in Jupyter/IPython contexts. Lots of improvements there for people who use MuseScore.
The User's Guide has become much more awesome, and you can play with all the good features there.
Many new ways to search scores -- LyricSearcher is fully polished and documented in the User's Guide. Carl Lian's search.serial is upgraded from alpha to a full release that will be easy to expand in the future -- want to know where certain motives are used or transformed? This will make it easy to do. And search.segment -- the old standby -- is even better than ever (see below)
Try splitting notes and recombining them -- lots of intelligence going into this.
There's a big difference between taking a passage up a major third and taking it up 4 semitones. In Chromatic contexts, music21 will now spell things how a musician would like to see them. If you're working with MIDI data, without explicit enharmonics specified, you'll appreciate this.
Go ahead and use '~/../dir' and things like that in your file parsing -- music21 groks all that.
Look at you, fancy programmer, with your 4-CPU laptop! Why not give common.runParallel(tasks, function) a try and get music21 working 2-3x faster than before? (just make sure that "tasks" isn't a list of Streams). Oh, and if you're using search.segment to search for a particular passage inside a large collection of files, don't worry about using runParallel -- we'll do that for you automatically.
Docs are pretty and much better. The User's Guide is the place to start.
Too many other changes to mention, but some shoutouts to Shimpe for new Lilypond code (triplet chords, etc.), Frank Zalkow for enharmonic spelling , dynamics, tempos and other things, Chris Antilla for continued dedication to MEI processing, Emily Zhang for hashing functions and speeding up MIDI quantization, Sonovice for articulation handling, Dr. Schmidt for Chord symbol translations, Bagratte for IO cross Py2/3 fixes, Bo-Cheng Jhan for great braille contributions.
Big under the hood changes.
Big, backwards incompatible change: Many calls such as .parts, .notes, .getElementsByClass(), .getElementsByOffset(), etc. no longer return Streams. They now are iterators (returning something called a StreamIterator). For most uses, this is not going to change anything. You can still use: for n in myStream.notes: and it'll work great. It makes many parts of music21 much, much faster. For small scores, the differences will be small. For large scores, the differences will be tremendous, especially when filters are chained, such as: myScore.recurse().notes.getElementsByClass('Chord').getElementsByOffset(0.0). You're going to find that writing iterator chains is an amazing way to only get at items you want, especially with custom filters. To get the old behavior, just add .stream() to the end of your iteration.
Because none of these filters change the activeSite of an element, you'll find that this is much more stable than before.
If you want to know what the note after a given note is in a musical context, call n.next() or n.previous(). If it's the last note of a measure, it'll move on the first note of the next. And once you've called .next() on one note of a stream, the remaining calls will be super super fast. I still haven't wrapped my mind completely around this paradigm, but it sure beats all the fooling around I used to do to figure out if one note was the same pitch as the next one, etc.
If you've been using music21 for some time, but have never looked at the docs for base.contextSites(), do it -- this is a very fast and extremely powerful way of figuring out how two objects relate to each other. Together with the .next(), .previous(), and better support for .derivation, many extremely powerful systems can be written in music21 easily that could only be written with huge difficulty before.
Nearly all functions marked deprecated in v.2. have been removed. Lots of super obscure functions in .base.Music21Object or .sites.Sites are gone. This is a positive step since it'll make the documentation for these objects simple enough to understand.
Sorting works. I mean, it just works. With grace notes, with oddly positioned elements, with what have you. And it's pretty darn fast. This might seem like something small, but it's enormous for us.
Corpus managing is much simplified -- if you ever thought in the past, "Hey, I'd like to use a custom corpus" and then thought, "uhh...no thanks..." give a look at what is needed to set one up now. You'll be glad for it!
Musescore and not Lilypond is used in Jupyter/IPython notebooks.
Complex durations are a lot less complex -- and faster.
PyLint on all code -- I estimate that at least 200 undetected bugs vanished through this major effort.
As noted in messages to the music21 mailing list (music21list at Google Groups), v.3.1 is the first non-beta release in the v.3 lineup. Version 3 happens to share a version number with Python 3, but that is merely coincidence. Music21 version 3 continues to work with Python 2.7 as well as Python 3.4. Version 3 adds explicit support for Python 3.5 and drops support for Python 3.3. Music21 will continue to develop into a Version 4 to be released next summer (4.0.x will be alpha and beta releases and 4.1.0 will be the public release). Version 4 will likely be the last version to support Python 2.
This release represents the end of a year's sabbatical where I got to work on low-low-level music21 functions that I didn't think anyone else would want to. Due to teaching and other obligations, I'll be taking off work on the heart of music21 until the holidays (I'll still be taking bug fixes, etc.) and working more on documentation, examples, and applications. The changes put in place for music21 v.3 has made working with it a lot more fun for me, so you'll probably see more a lot more applications get added, first to the alpha directory and then into the main set. I've also put up a version 4 roadmap (trees are almost done, they should make it in. Style objects will be introduced so that beautiful musical scores can be created or at least imported and exported properly without major speed loses) so if anyone wants to take the lead on a project you can do so. I'm working on a project called STAMR, Small Tools for Agile Music Research, which should create standalone tools using music21 and music21j for musicologists to get their work done faster. Given that I'm teaching music fundamentals online again, you should see music21 and music21j integration working far better than ever before.
Thanks to MIT for supporting my work, and the Seaver Institute and the NEH for initial funding to make music21 a success. And thanks to this great community for all your contributions in the past and contributions to come.
Cuthbert received his A.B. summa cum laude, A.M. and Ph.D. degrees from Harvard University. He spent 2004-05 at the American Academy as a Rome Prize winner in Medieval Studies, 2009-10 as Fellow at Harvard's Villa I Tatti Center for Italian Renaissance Studies in Florence, and in 2012–13 was a Fellow at the Radcliffe Institute in 2012-13. Prior to coming to MIT, Cuthbert was Visiting Assistant Professor on the faculties of Smith and Mount Holyoke Colleges. His teaching includes early music, music since 1900, computational musicology, and music theory.
Cuthbert has worked extensively on computer-aided musical analysis, fourteenth-century music, and the music of the past forty years. He is creator and principal investigator of the music21 project. He has lectured and published on fragments and palimpsests of the late Middle Ages, set analysis of Sub-Saharan African Rhythm, Minimalism, and the music of John Zorn.
Cuthbert is writing a book on Italian sacred music from the arrival of the Black Death to the end of the Great Schism.
Download what is almost certainly an out-of-date C.V. here (last modified June 2012)
Bologna Q15: the making and remaking of a musical manuscript, review for Notes 66.3 (March), pp. 656-60.
"Palimpsests, Sketches, and Extracts: The Organization and Compositions of Seville 5-2-25," L’Ars Nova Italiana del Trecento 7, pp. 57–78.
Der Mensural Codex St. Emmeram: Faksimile der Handschift Clm 14274 der Bayerischen Staatsbibliothek München, review for Notes 65.4 (June), pp. 252–4.
"Generalized Set Analysis and Sub-Saharan African Rhythm? Evaluating and Expanding the Theories of Willie Anku," Journal of New Music Research (formerly Interface) 35.3, pp. 211–19. [.pdf]
Unless otherwise mentioned, the writings, compositions and recordings on this site are licensed under a Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 United States License.
Copyright 2010-11, Michael Scott Cuthbert. Web design by M.S.C.
Fonts for musicology: Ciconia (14th/15th c.) and ClarFinger (clarinet music).
In my copious spare time as a junior faculty member on tenure track, I do web design and programming consulting for the National Bureau of Economic Research.
Lectures on the web
enChanting: Musical Artifacts in Unlikely Places, lecture March 3, 2009
Ambiguity, Process, and Information Content in Minimal Music, podcast of a lecture to Comparative Media Studies at M.I.T.
Just for fun...
Mondrian meets Finding Aids in a map of books in my former apartment.
Numeric Deathmatch, a game I coded that was taught to me by Jon Wild. More fun in person, but the web interface encourages trashtalking.
Musicology Buzzword Bingo, useful for AMS meetings (requires Bach and Futura fonts)
Automatic New Musicology Paper Generator based on the Dada engine