Humdrum Extras

myank manpage


    myank -- Extract selected measures from a Humdrum score.


    myank [-m list | --mark ]


-m list Extract the list of one or more measures from the score.
-i Print any instrument codes (tandem interpretation tokens which start with the characters "*I") if they occur before the first measure/notes and any spine manipulators.
-B Do not display the last barline from the list of extracted measures.
--double Place a double bar-line between non-successively numbered measures in output data.
--mark Extract measures containing marked notes.
--max List the largest measure number present in the score.
--min List the smallest measure number present in the score.
--visible Don't automatically mark the first measure in the output as "invisible".


    The myank program will extract a measure or range of measures from a score, including the prevailing key signature and time signature. In order to extract a particular measure, the measure needs a number present in the measure token in the first column of the data. Use the barnum program to add bar numbers if they are not present in the data already.

    The myank program functions in a similar manner to the Humdrum Toolkit command yank. However, myank is optimized for pulling measures out of full scores, including one with complicated spine manipulations, and also keeping track of current key signatures, keys, time signatures, meter symbols, and tempo markings. Here is an example illustrating the difference between extracting a measure with myank and yank:

    myank -m 90 input.krn
    yank -n ^= -r 90 input.krn

    Differences between the two programs:

    • myank preserves reference records and global comments before and after the main body of the data (use rid -G to remove), while yank does not include these lines.
    • yank echos all interpretation records prior to the extracted data which allows the monitoring of all global values and spine manipulations. myank simplifies this interpretation data and ignores interpretations which it does not understand and which are not present in the extracted measure(s). Global settings of clef, key signature, key, time signature, metric symbol, and tempo are the tandem interpretations which myank will keep track of, and display the current setting for this interpretations at the start of the extract measure(s).
    • myank will close the data more gracefully than yank, joining any subspines together so that the number of columns at the start of the data on the first exclusive interpretation line matches the count on the end-of-data markers (*-) line.
    • myank allows extracting measures in reverse orderings and duplications, while yank only extracts in forward temporal sequence.

    Extracting a single measure

    Use the -m option with a single integer to extract a particular measure.
    myank -m 5

    Extracting a range of measures

    Use a dash in the measure string for the -m option to indicate the starting and ending measure of the extracted measures. If the range starts with the larger number, then the measures will be extracted in reverse order.
    myank -m 2-6
    myank -m 6-2

    Extracting non-contiguous range of measures

    Multiple measures or ranges of measures can be extracted by placing a comma between the single measure and range of measures.
    myank -m 2,4,6,5-3,4-6

    Using dollar sign for last measure

    The dollar sign ($) can be used to represent the last measure of the file when extracting single measures or range of measures. Place the measure list within single quotes so that the command-line interpreter does not try to interpret the dollar sign as the marker for an environmental variable.
    myank -m '$'
    myank -m '4-$'

    Placing a non-negative integer value immediately after a dollar sign will subtract that amount from the value represented by the dollar sign. If the last measure in the score is 100, then $5 is measure 95.

    myank -m '$1'
    myank -m '$2-$5'

    Including instrument codes

    To include instrument codes found before the start of any notes, measures, or spine manipulators, use the -i option.
    myank -m 3
    myank -m 3 -i

    Supress last barline

    Use the -B option to supress printing of the last barline in the list of extracted measures.
    myank -B -m 5
    myank -B -m 2,4,6

    Double barline separator

    The --double option can be used to place a double barline between mesures in the output which are not in sequential order. This is useful for separating different segments from the same score in the output from myank.

    Measure extraction by marked notes

    Instead of giving a measure list with the -m option, you can use the --mark option to extract all measures which contain a mark character in any **kern data. A mark character is defined by either of the following reference record starting characters:
         !!!RDF**kern: @= match
         !!!RDF**kern: |= mark 
    If the --mark option is used, the program searches for reference records of this format (with any characters following on the lines after the above contents). In this case, any measures which contain the characters "@" or "|" in **kern data, that measure will be output by myank. The "@" and "|" characters are only examples. Any user-definable character can be used in an !!!RDF reference record, and any number of markers will be used to pull measures out of the input score. User-definable characters in **kern data are: i, j, l, N, U, V, Z, @, |, +, <, and >.




    The compiled myank program can be downloaded for the following platforms:
    • Linux (i386 processors) (dynamically linked) compiled on 8 Nov 2013.
    • 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 1 Apr 2013. Click here to go to the full source-code download page.