Humdrum Extras

autostem manpage


COMMAND

    autostem -- Add stem directions onto **kern notes.

SYNOPSIS

    autostem [-r | -R | -o | -O[-u[input[> output]

OPTIONS

-r Remove all existing stems (except explicit stems).
-R Remove all stems, including explicit stems. the -x option.
-o Overwrite any stems present in the data (except explicit stems).
-O Overwrite all stems present in the data (including explicit stems).
-p Print the original data with a spine listing the vertical positions of each note on the staff.
-u Stem of note on middle line of staff goes upwards.

DESCRIPTION

    The autostem program adds stem directions onto notes in **kern spines. The two stem signifiers in **kern data are:
      / == stem up
      \ == stem down

    The basic algorithm for adding stems onto single notes when no beams are present:

    1. Whole notes and breves (double-whole notes) do not have stems, but they will be assigned a stem direction which is useful for determining location and orientation of slurs and ties.
    2. If there is only one voice on a staff:
      1. If a note is on the middle line of the staff or higher, then the stem is down; otherwise, the stem is down.
    3. If there are two voices on a staff:
      1. The first voice (first subspine of a staff on the line) has notes with stems up.
      2. The second voice (second subspine of a staff on the line) has notes with stems down.
      3. However, if either the first or the second voice contains an invisible rest (represented by "ryy" in a token), then treat the other voice as if it were the only voice on the staff.
    4. For three or more voices on a staff, you should manually set the stem directions, because the stem directions are indeterminant in the general case.

    In order to determine the location of a note on a staff, the clef must be known. For example, G4 is on the second line from the bottom of the staff when a treble clef is being used, but when an alto clef is being used, the G4 pitch is on the top line of the staff.

    Here is an example of stem directions being added to notes in various clefs. Note that the input to the program does not require valid rhythmic syntax in the **kern spines. For example, the following data contains no rhythms:

    autostem input > output
    input
    output

    Staff positions

    Using the -p option will display the vertical staff position of the notes, which is a preliminary step in assigning a stem direction. The positions will be added to the original data in a single spine listing all of the note positions for the current line.
    autostem -p input > output
    input
    output

    Middle-line stem direction

    By default, autostem will set the stem direction of notes on the middle line downwards. If you want the stem on notes found on the middle line to instead point upwards, then use the -u option:

    autostem -u input > output
    input
    output

    Removing stems

    To remove stems from the **kern data in a Humdrum file, use the -r option:
    autostem -r input > output
    input
    output

    Explicit stem directions

    Stems can be frozen in a specific direction by adding a single "x" character immediately after the stem character. This marker will cause the autostem program to avoid changing/removing a stem on that particular note. Here is an example where the pitches "e" and "ee" have stem directions which are opposite of the stem-direction algorithm:

    autostem -r input > output
    input
    output

    When removing stems, the -r option will not remove stems which have a single "x" character after them:

    autostem -r input > output
    input
    output

    When removing stems, the -R option will remove all stems, including ones which have a single "x" character after them:

    autostem -R input > output
    input
    output

EXAMPLES

ONLINE DATA

    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:
           program http://www.some-computer.com/some-directory/file.krn
    Piped data works in a somewhat similar manner:
           cat file.krn | program
    is equivalent to a web file using ths form:
           echo http://www.some-computer.com/some-directory/file.krn | 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

BUGS

    Probably. Does not work with cross-staff notes.

DOWNLOAD

    The compiled autostem 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.

    The source code for the program was last modified on 7 Feb 2011. Click here to go to the full source-code download page.