!body topmargin="15" leftmargin="5" alink="#ff8080" bgcolor="#e2dfc7" link="#dd0000" marginheight="5" marginwidth="5" text="#321e04" vlink="#118dcc">
The thru command is usually used to expand repeated sections of music. For example, the following music is typically encoded as written:
In the **kern encoding on the left below, there are two labels, *>A and *>B, which demark two sections in the music. The A section will be repeated when performed, and the B section will be played only once. Running the command:
thrux file.krnwill search for the default variation directive, which is *>[A,A,B] in this file, and generate the result on the right which contains the A section twice, and then the B section once.
When data is processed with the thru command, the marker *thru is added to the data to indicate that it has been processed. The any variation interpretations, such as *>[A,A,B] in this case, will be removed unless the -k options is used to keep them in the processed data. Using the -k option might be useful in this case, if you want to generate the norep variation from the thru-processed default variant.
If there is more than one way to realized the data in a file, an arbitrary tag can be added to the variation interpretation between the '>'and '[' characters. For example, the file on the left below contains the default variation *>[A,A,B], plus two other variations called norep (for "no repeating"), and reverse.
The thrux command also includes three additional options: -i, -l, and -r not found in the original thru command.
The -l option generates a single column list containing the variation strings and labels present in the file. Such as the following example:
The -i option gives more detailed information about the labels. Variant strings are listed in global comments above the label data. There are seven columns of data:
The -r option can be used to realize a variant of the score using a label sequence which is not present in the score. For example, if you wanted to repeat the A section of the music from the above examples, there is no variant listed in the file to do that, so you can use the -r option to specify the desired sequence on the command-line:
thrux -r "A,A,B,B2,C,D,D2"
program file.krnIt can also read the data over the web:
program http://www.some-computer.com/some-directory/file.krnPiped data works in a somewhat similar manner:
cat file.krn | programis 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.krnwill download the URL:
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 source code for the program was last modified on 9 Apr 2013. Click here to go to the full source-code download page.