Humdrum Extras

harm2kern manpage


    harm2kern -- Convert **harm data into **kern data.


    harm2kern [-a[-R #[-b|-r[input(s)[> output]


-a Append **kern spine to input data lines;
-b Extract only the base pitch of the chord.
-o # Octave of the base note. The default is 3 (octave below middle C). Other pitches in the chord are given in the fourth octave (starting on middle C).
-r Extract only the root pitch of the chord.
-R # Apply rhythmic values from specified **recip spine. (first **recip is 1, second is 2, etc.)


    harm2kern converts data in the Humdrum format **harm into its equivalent a sets of pitches in the **kern data format. The **harm data format is a description of functional harmony chords.

    Triads in major/minor keys

    Triads in major keys:

    harm2kern input.hrm > output.krn

    Triads in minor keys use the harmonic minor for the scale degrees, so the third and sixth scale degrees are flattened compared to the parallel major key. The seventh scale degree is placed on the leading tone rather than the flatted seventh scale degree of the parallel major key. The chord quality is independend of its starting scale degree, so "v" (lower case) indicates the minor dominant, and V (upper case) indicates the major dominant in both major and minor keys.

    harm2kern input.hrm > output.krn

    Chord Qualities

    Triads can be major (uppercase Roman numerals), minor (lowercase Roman numerals), augmented (adding a plus after uppercase Roman numerals), or diminished (adding a "o" after lowercase Roman numerals):

    harm2kern input.hrm > output.krn

    Chord tones higher than a fifth include the interval number.

    harm2kern input.hrm > output.krn


    Chord inversions are given as the letters a, b, c, d, etc., which indicate the root, first, second, third, etc. inversion of the chord, respectively. When an inversion is not specified on a chord label, the root position is assumed. The root chord is given as the first pitch in the output **kern spine, and the bass note is specified with an upper case diatonic pitch name (octave 3). Pitches in the chord are ordered from root upwards (by thirds).

    harm2kern input.hrm > output.krn

    Secondary Chords

    Chords in a key other than the prevailing key are written in the temporary key followed by a slash and the scale degree in the prevailing key. The secondary keys can be nested. For example, "V/V/V" is the dominante chord in the key with a tonic on the dominant's dominant; in C major, the dominant of the dominant is on D, and V in D major/minor is the pitches a c# e. Here are some further examples of secondary chords which are functional in a key different from the prevailing key:

    harm2kern input.hrm > output.krn

    Chromatic Chords

    The Neapolitan chord is labeled as N in **harm data, and is a major chord occuring on the flatted second degree of the key. The Neapolitan is typically found in first inversion, and progresses to the dominant (listen).

    harm2kern -R1 input.hrm > output.krn
    hum2mid output.krn -o output.mid



    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 harm2kern 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 2 May 2010. Click here to go to the full source-code download page.