MusicSQL: initial thoughts

[Sun, 15 Nov 2009 20:54:25 +0000]
One of the nice things about an emerging standard, namely MusicXML, having a command center (Recordare LLC []) is having a central place to learn about what’s new. On Friday, I was looking at Recordare’s page of MusicXML related software [] for software that worked from the command line and noticed something new and really interesting: MusicSQL []. According the the Goodle Code page that hosts this project, MusicSQL is: ... a system for conducting complex searches of symbolic music databases. The database can import and export MusicXML files. In the current version searches are constructed using a command line interface or through simple Python scripting tools. Basically, at least as I understand it, MusicSQL is a Python program that sits on top of a MySQL [] database - now I really hope Oracle doesn’t kill MySQL if it buys Sun []. I was so excited to get MusicSQL working that I didn’t notate all the little problems I had along the way. The documentation for MusicSQL [] is very good and is written for Windows, Mac, and Linux (Ubuntu) users. But I’m inconceivably impatient, so I just mowed through the installation with little care for remembering what I was doing. I do remember that I had to install Python 2.5, whereas I already have Python 2.6 installed - now I have both. I put/installed all the dependencies in my Python 2.5 directory just to compartmentalized everything - the exception being MySQL, which I installed wherever the default is. So far, I only ran the first query in the documentation that uses "scientific" musical notation in the form Nx, where "N" is the alphabetical note name, say C, and "x" is an integer that denotes what octave the note is a member of. In other words, a C-Major scale would be "Cx Dx Ex Fx Gx Ax Bx Cx+1", something like "C5 D5 … B5 C6", etc. You can place an integer before the note name to denote its duration. Running the query from the command line, I was really happy with the speed and the output of MusicSQL for the test query. One problem I did have, though, is I kept getting errors for another great feature of MusicSQL. Basically, after you run your query, you can see a PDF of the results (i.e. the music excerpt pertaining to the query results). The PDF is made by Lilypond [], a text-based notation software that produces - in my opinion - the absolute best looking engraving out there, that’s why I use it (and yes, it’s free). Now Lilypond doesn’t natively read MusicXML, it uses its own encoding. So MusicSQL takes advantage of a Python script that comes with the Lilypond install called "xml2ly" that converts MusicXML to Lilypond format. I left a message on the project forum for MusicSQL, so I’m hoping I can figure out what I need to do to get the Lilypond outout of the query results to work. At any rate, I do wonder how effective it can be since the conversion from MusicXML to Lilypond can sometimes get ugly. I wonder if an alternative solution is to use the command line options for the MuseScore notation software [] to generate a PDF of the query results. Musescore can also convert MusicXML to other graphics formats (PNG) and even audio (WAV, FLAC, OGG), so theoretically it could be leveraged to make audio files for the corresponding query results. At any rate, I’m really looking forward to the future developments of MusicSQL. And as for using MuseScore’s command line in conjunction with MusicXML and how it can add value to a web collection of MusicXML docs - there will be more to that later ...


  1. Michael [2009-11-25 03:54:48]

    Thanks for the update! It's good to know that the MusicXML software list is proving useful. We try to include new programs in our monthly e-mail updates, but sometimes we miss a few. The mailing list signup is at if you are not already a subscriber.