Thursday, September 27, 2012

Music21 in Polish, in Germany, and in Montreal

In Polish

A nice description of what we do, and music21's connection (I'd say, deep indebtedness) to Humdrum, appears in this article in Ruch Muzyczny, Rok LVI, Nr. 19:

Na szczególną uwagę zasługują dwa programy pracujące z danymi zakodowanymi symbolicznie. Jeszcze w latach dziewięćdziesiątych powstał opracowany przez Davida Hurona system analityczny Humdrum Toolkit6, w którym różne wymienialne formaty reprezentacji partytury (podstawowym jest **kern) stanowią materiał podlegający manipulacji (np. klasyfikacji, restrukturyzacji, kontekstualizacji) i prowadzą do wyszukiwania rozmaitych wzorów lub podobieństw między różnymi typami informacji. Alternatywą dla Humdruma jest dziś zbiór narzędzi dla "komputerowo wspomaganej muzykologii" - system Music21 (, oparty na języku programowania Python. Symboliczne dane do analizy pozyskiwane mogą być z rozmaitych źródeł (np. z edytora Finale i MusicXML) i eksportowane do rozmaitych formatów, w tym do **kern i MIDI, co znacznie rozszerza funkcjonalność systemu. Dając polecenie "from music21 import *", można wykonać wiele prostych zadań, jak wizualizacja krótkiej melodii, utworzenie macierzy dwunastotonowej lub wypisanie pod nutami ich nazw (w wybranej konwencji językowej). Siłą pakietu są jednak obiekty wyższego poziomu - Pitches, Chords, Durations, TimeSignatures, Intervals albo Instruments, które dokonują bardziej skomplikowanych analiz, jak znajdowanie dźwięku prowadzącego w aktualnej (zmieniającej się w przebiegu utworu) tonacji. Wyrafinowanym komponentem Music21 są moduły graficzne pozwalające na przykład na wizualizację profilu tonalnego wybranego utworu lub ukazanie korelacji między określonymi parametrami muzyki (np. między wysokością a dynamiką), co jest zwykle trudne do zauważenia w partyturze.

(Machine translation of the second half:)
An alternative to Humdrum today is a set of tools for "computer-aided musicology" - the Music21 system (, based on the Python programming language. Symbolic data for analysis can be obtained from a variety of sources (e.g., Finale and MusicXML) and exported to various formats, including the **kern [MSC: actually, we don't export Kern yet, but we do import it] and MIDI, which greatly extends the functionality of the system. Giving the command "from music21 import *", you can perform many simple tasks, such as visualization of a short melody, creating a matrix of twelve-tone or print the notes of their names (in the selected language conventions). The strength of the package, however, are higher-level objects - Pitches, Chords, Durations, TimeSignatures, Intervals or Instruments, who make more sophisticated analyzes, such as finding the leading tone in the current (evolving work in progress) key. Music21 is a sophisticated component of graphical modules allowing, for example, to visualize the tonal profile of the selected song or show a correlation between certain parameters of music (for example, between the height and velocity), which is usually difficult to see in the score.

Reports from Germany

In July of 2012, the music21 project went to Germany, sponsored by the generosity of the Germany Seed Fund of the MIT MISTI program, of the German government, and the Seaver Institute.  There we met with Hans-Peter Kriegel of the LMÜ and his great database lab, including Vladimir Viro of Peachnote, and worked together on future collaboration projects.  After recovering from jet-lag for a day with a quick trip to Salzburg, we worked all day (and most of the night) on the ICE to Hamburg.  The next day we presented our work (along with our absent collaborator Christopher Reyes) on "Interoperable Digital Musicology Research via music21 Web Applications"at the Digitial Humanities Conference.  We then continued our discussion and coding in Berlin where we met up with members of the musicology community there and took a trip to Leipzig to pay our homage to Bach. 

Thanks to Beth Hadley, a video of the trip is now available from the MISTI website.  Thanks to all our funders, collaborators, and friends.

Montreal ELVIS Collaboration

Work on the ELVIS (Electronic Locator of Vertical Interval Successions) project--a multinational cooperation between the US, Canada, and the UK, via the Digging into Data challenge grant--continues.  I'm ecstatic to learn about VIS, a Python-based music visualization system by Christopher Antila of the McGill team, built on top of music21 and Lilypond.  (Read about it here)

The McGill ELVIS group is greatly increasing our understanding of Renaissance and later polyphony, and music21 is proud to be a part of their work.

v.1.3 released; music21 at Grace Hopper

Two important items in the music21 world:

Beth Hadley and music21 at Grace Hopper

If you're in Baltimore, whether you're attending the Grace Hopper Women in Computing conference or not, you'll definitely want to attend Beth Hadley's presentation on "Porting Computer-Aided Musicology using music21 to the Cloud" on Thursday Evening.  Beth has done fantastic work integrating feature extraction, analysis of popular music leadsheets, and (most recently and coming soon) Vladimir Viro's Peachnote extractions of IMSLP with music21 and Amazon Web Services.  She is also a key player in the music21 TheoryAnalyzer tool (with Lars Johnson) that will play a big part in the future of online music theory education.  Beth is a sophomore undergraduate in Computer Science (Course VI) at MIT.

Music21 v.1.3 Released

Music21 version 1.3 has been released, and is available at for Mac (.tar.gz), PC (.exe) or as a Python .egg file.  Upgrading consists of simply downloading the new version and using the installation instructions (  You should not need to uninstall a previous version unless it’s extremely old.

Version 1.3 contains a number of bug fixes, much improved documentation (we’re beginning a rewrite of our user’s guide over the next few months), and new features.  Of particular importance is greatly increased support for Lilypond output, support that will continue to expand soon.  N.B. -- this is the first version that removes some method calls that were not placed in the best modules, were obsolete, or duplicated functionality that could be found elsewhere, so for the first time in a while, we caution that upon upgrading you may need to change some parts of your code, especially if you were using some of these features:

* Advanced musicxml features (beyond .show(‘musicxml’) or .write(‘musicxml’)) have been changed: .mx and .musicxml have been removed from music21 objects; the musicxml subpackage has been broken into smaller modules.  To get the same output as obj.musicxml call musicxml.m21ToString.fromMusic21Object(obj); to get the same functionality as .mx look for the appropriate method in musicxml.toMxObjects or musicxml.fromMxObjects.

* Advanced MIDI features (beyond .show(‘midi’) or .write(‘midi’)) have been changed.  .midifile is now midi.translate. music21ObjectToMidiFile(obj). 

* Stream freezing/unfreezing (now “thawing”) is handled by the new freezeThaw module.  jsonpickle has been removed as an option since it was not dereferencing objects properly.

* obsolete methods of note (compactNoteInfo, pitchNames, setAccidental [use .accidental = Accidental], noteFromDiatonicNumber, sendNoteInfo) have been removed

* The __repr__ (representation) for pitch objects is now instead of G#4 (etc.).  A large-scale standardization of all __repr__ to begin with is underway.  TimeSignatures have also been affected. String representations of both classes remain the same.

* Almost all keyword attributes that mapped to Python reserved words (dir, format, map, min, max) have been renamed.  In the vast majority of cases, users will have been using unnamed attributes, so nothing will have changed.  In the few cases where we believe many people will have used named attributes, we have left them alone.

So those are the incompatibilities.  What about the reasons to upgrade:

* Much better docs mean that the documentation will match v.1.3.

* harmony improvements, esp. in chordSymbolFromChord.

* melodic voiceleading analysis in the analysis.theoryAnalyzer package.

* bug fixes and improvements in scale, abc, medren.  Octaveless pitches now choose more sensible octaves in scales.

* improved serial module

* 50% speedup in startup.  Full IDLE compatibility.   Lots of little speedups everywhere.

In other news: The music21list is being split into two lists – a discussion list (music21list) and an announcement-only list (music21-announce).   All messages sent to music21-announce will also appear on music21list, so there’s no need to subscribe there if you want discussions and announcements.  But if you would like to move to a lower-level of email activity, please subscribe to the announce list and unsubscribe from this list (or, better, don’t subscribe but turn off emails so you can turn them back on easily when you have a question).