Humdrum Extras

hum2xml manpage


    hum2xml -- Convert Humdrum files into MusicXML files.


    hum2xml [-r[input[> output]


-r Reverse the ordering of the staves in a printed system. Usually a Humdrum file contains the bottom staff in a system in the left-most column. If the ordering of the staves in a Humdrum file are reversed, then use the -r to store them in correct order in the MusicXML output.


    Printing Humdrum data in Finale 2003 or higher

    Humdrum files converted into MusicXML files can be imported into the Finale Music Typesetting program by following these instructions:

        hum2xml input.krn > output.xml

    For the sample input data on the left, the output file will contain the following data:


    To load the MusicXML file into Finale, first create a blank default document. This must be done in order to activate the "MusicXML Import..." item in the "Plug-ins" menu. If you do not have a blank Finale document open, then the MusicXML data cannot be imported. To open a blank document go to the "File" menu and choose "New" then "Default Document" as illustrated below:

    Default Document menu item

    Next, go to the "Plug-ins" menu at the top of the Finale menu and select "MusicXML Import..." as illustrated in the next figure:

    Plugin Menu list

    In the "MusicXML Import..." window, select your MusicXML file to load into Finale. You should end up with music in the Finale window like this:

    You may also use the translation from Humdrum into MusicXML to import the musical data into other notation programs listed on the website, such as LilyPond which is a popular linux music-typesetting program.


    Non-kern spines

    Non-kern spines to the right of a **kern spine will be converted into lyrics when the file is converted into a MusicXML file. For example, the following input:

    Will generate this result when the MusicXML file is loaded into Finale:

    Music with verses in Finale

    More example usages of the hum2xml program are available on the hum2xml examples page


    Input arguments or piped data which are expected to be Humdrum files can also be web addresses. For example, if a program can process files like this:
           program file.krn
    It can also read the data over the web:
    Piped data works in a somewhat similar manner:
           cat file.krn | program
    is equivalent to a web file using ths form:
           echo | program

    Besides the http:// protocol, there is another special resource indicator prefix called humdrum:// which downloads data from the kernscores website. For example, using the URI humdrum://brandenburg/bwv1046a.krn:

          program humdrum://brandenburg/bwv1046a.krn
    will download the URL:
    Which is found in the Musedata Bach Brandenburg Concerto collection.

    This online-access of Humdrum data can also interface with the classical Humdrum Toolkit commands by using humcat to download the data from the kernscores website. For example, try the command pipeline:

          humcat humdrum://brandenburg/bwv1046a.krn | census -k



    The compiled hum2xml program can be downloaded for the following platforms:
    • Linux (i386 processors) (dynamically linked) compiled on 28 Jun 2012.
    • Windows compiled on 29 Jun 2012.
    • Mac OS X/i386 compiled on 13 Nov 2013.
    • Mac OS X/PowerPC (version 10.2 and higher) compiled on 13 May 2009.

    The source code for the program was last modified on 26 Jun 2012. Click here to go to the full source-code download page.