Saturday, May 11, 2013

music21 v. 1.5 Released

A new version of music21 has been released, the first public release since January.  This release focuses primarily on speed and stability improvements so it is worth an upgrade even if none of the new features is of use to you.  A summary of what's new:


  1. Many improvements to Layout -- information soon, but pixel level positioning of measures can now be extracted from MusicXML files.
  2. Chordify addPartIdAsGroup=True works better.
  3. Better triplet handling in Humdrum SpineParser.
  4. Some .nwc files (not just .nwctxt) files can now be parsed.
  5. Improvements for PartStaffs (Piano scores, etc.)
  6. .transpose works on Key objects.
Thanks to everyone for support and new ideas on where to take the project.

Friday, January 11, 2013

Music21 version 1.4.0 Released

Version 1.4.0 of music21 is released.  This is a minor release on the outside, but incorporates a number of changes that will let us do more substantial changes in the upcoming next release.  Among the most substantial changes that people will notice are:

  1. Better documentation and more chapters in the User's Guide
  2. Ability to import Capella XML (.capx) files
  3. Articulations, grace notes, crescendo, and diminuendo now import in ABC (and the code is in place to bring in many more !exclamation! tags).  Thanks to Dylan Nagler, Harvard Research Partner for the code.
  4. analysis.neoRiemannian allows for analyzing the effect of smooth voice leading on chords.  Thanks to Maura Church, Harvard Research Partner for the code.
  5. Humdrum parsing improvements, including comments and better handling of multiple voices and importing of instruments.
  6. Lilypond now supports different numbers of stafflines in output
  7. Percussion support for MIDI and the basics of an Unpitched object type.  Thanks to Ben Houge for commits.
  8. Improvements to chords, including a better .root() algorithm for incomplete chords, geometricNormalForm -- implements Dmitri Tymoczko's algorithm for normal form.
  9. More useful errors when parsing incorrect or unsupported features in several formats.
  10. New files in the corpus, including many 14th century scores, and the 2nd movement of Clara Schumann's Piano Trio.  Female composers are hugely underrepresented in computer-readable music repertories (we couldn't find any substantial piece that was available), so we're proud to add an important work (known to many of us from the Norton Anthology of Western Music) by a great compose.
  11. Serialization of Streams via Pickle is much better tested and works even on large scores.  See the freezeThaw module.  If you're going to work with the same pieces over and over again, freeze them once and you'll load them over 3x as fast the next time you need them.
  12. MusicXML improvements: bowing marks are now supported as are pizzicato, etc.  A bug on piano staves where one used multiple voices but the other did not has been fixed.
  13. Improvements to the harmony module.  Thanks to Beth Hadley, MIT Undergraduate Research Assistant.
  14. Big speed increase on startup for people who have installed additional modules: numpy, scipy, and matplotlib are only loaded when first needed.

The next release will include support for virtualenv installs (I know people have been waiting for it, but this release included switching the entire development/commit platform, so we didn't want to change too much at once) and will have optional support for Rational number durations and offsets for perfect work with complex tuplets, etc.

In the meantime, I've been using music21 to explore similarity in fourteenth-century music to great success, so I hope to be able to share my own experiences as a user, not just a developer, of the toolkit very soon.  -- Michael

Sunday, October 28, 2012

New Orleans news and Josquin Research Project

Several items of interest:

1) The joint meeting of the American Musicological Society, Society for Music Theory, and Society for Ethnomusicology will take place on Nov 1-4 in New Orleans.  There are several sessions of interest for music21 users: a panel on Corpus Research by ELVIS collaborator Ian Quinn on Saturday morning, a discussion of MEI the day before the conference on Oct 31, a panel on musical databases for medieval and Renaissance music on Thursday afternoon (concurrent with my less digital paper on Italian influence in early fifteenth-century music), the meeting of the Computational Music Theory group, and several other meetings that are slipping my mind right now -- all in all an important place for digital musicology!

2) The New England Chapter of the American Musicological Society will host its Winter meeting on Saturday, Feb 2 at Tufts University in Medford, MA (a Boston suburb).  The call for papers has just gone out requesting:
abstracts of up to 300 words for papers and roundtable sessions. Submissions in the area of digital musicology are of particular interest, but proposals on all musicological topics are welcome. Abstracts should be submitted by Monday, 26 November 2012 via email to jsholes at bu.edu (Jacquelyn Sholes)
I hope that people working on digital musicology will choose to apply.   
3) Craig Sapp's recent blog post details the work being done by our friends in the Josquin Research Project at Stanford University.  In addition to creating a number of wonderful tools for analyzing their data online or with Humdrum, the JRP has made all their data available, primarily in Humdrum's KERN format.  Music21 reads these files, including the new KERN rhythm extension.  The results of the JRP so far will be part of the Thursday afternoon AMS session in New Orleans.

Happy analyzing!

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 (http://mit.edu/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 (http://mit.edu/music21), 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 http://code.google.com/p/music21/downloads/list 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 (http://mit.edu/music21/doc/html/install.html).  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).

Sunday, July 29, 2012

Music21 in LinuxMagazin.de (auf Deutsch)

Eine kurze Einführung in music21 hat in einem Blog-Post in Linuxmagazin erschienen:
http://www.linux-magazin.de/NEWS/Music-21-Python-Toolkit-fuer-Musikwissenschaftler

Meine Lieblings-Satz:
"In den vergangenen Jahren habe sich der Einsatz von Informationstechnologie in Geistes- und Kunstwissenschaften von einem randständigen Hobby interessierter Geeks zu einem anerkannten Werkzeug für alle Forscher entwickelt, schreibt der Projektleiter Michael Scott Cuthbert"

If only I could actually write that well auf Deutsch!

The music21 team had a great time in Germany visiting with our colleagues at LMÜ München and at the DH2012 conference in Hamburg, in addition to sampling Currywurst in Berlin, Bach-arcana in Leipzig, and fine beer and warm people everywhere.  Thank you to our German friends and the German government for supporting our work.

music21 v.1.1 released

A new version of music21, v.1.1, has been released.  It incorporates 6 weeks worth of feature enhancements, documentation improvements, and bug fixes.  For the next few 1.x releases, we're focusing (in this order) on better documentation and tutorials, making our method calls more robust (for instance, on larger scores with many voices), and applying music21 to more musicological topics.  But there will always be some time for adding new features as well.

---
Music21 has added a robust service-oriented-architecture and a set of web applications that should enable music21 users to work more easily over the web.  See the paper (with Beth Hadley, Lars Johnson, and Christopher R. Reyes) at http://web.mit.edu/music21/papers/Cuthbert_Hadley_Johnson_Reyes_Music21_SOA.pdf .  These tools are still in beta, so the interface may change slightly in future releases.

A new architecture for producing Lilypond output has been released.  Most end users will see little change, but we will be able to continue improving our Lilypond output with this rewrite.

Improvements in serial and post-tonal tools.  Commands such as isLinkChord(), isCombinatorial(), isAllInterval(), etc.will help people working on the music of Elliott Carter and other recent non-tonal composers.  Fixed some bugs in our provided tone rows.

Many bugs in docs have been squashed with our new documentation test suite.

For those working with Bach Chorales, see the corpus.chorales module which allows you to get chorales according to your favorite numbering system and lazily parses them for speed purposes.

Methods for finding repeated or similar sections have been added to repeat.py -- they are very powerful but still not made easy to use.  Version 1.2 will add a simple interface to this.

Incompatible change:  TinyNotation now supports time signatures in the input.  It is best to preface the string with "tinynotation: ".  For instance, "converter.parse('tinynotation: 3/4 C4 D E').makeMeasures()" will give a measure of 3 quarter notes in 3/4.

The Goldberg Variations have been added to the corpus (Thanks to the Open Goldberg Variations project ).  The Art of Fugue was already there, but you might not have known that it was bwv1080.  Now it's "bach/artOfFugue_bwv1080"

Basic support for realtime MIDI playback of streams in midi.realtime for users with pygame installed.  Thanks to Joe Codeswell for the code (original post)  .  A portaudio version (with less lag at the end of a Stream) is on its way...

Further improvements to variants: now you can load in two streams and mark the differences between them as variants.  Works even if Streams are of different lengths!

Bug fixes and improvements in Harmony objects, RomanNumeral processing (including the rntxt format) and more.  A sample of 20 Bach Chorales in rntxt format is now included with music21 thanks to Dmitri Tymoczko for the contribution and suggestions
---

Thanks to Evan Lynch, Varun Ramaswarmy, Carl Lian, Daniel Manesh, Beth Hadley, and Lars Johnson for many contributions to the latest code.

We also thank the Seaver Institute and the NEH/Digging into Data Challenge and our colleagues on the ELVIS project for their continued support.