location -- List musical/file location of each data line.
location -flmbapdLQRS [-x|-q|-h|-w] [input(s)] [> output]
||Append location as last spine.
||Display beat position within a measure.
||Double label markers so that they appear before and after location information.
||Display duration since start of music in eighth notes.
||Display filename as part of location information.
||Display duration since start of music in half notes.
||Display current file (segment) line as part of location information.
||Do not display label markers.
||Display measure of current data line.
||Prepend location information as first spine.
||Display duration since start of music in quarter notes.
||Do not display quotes around filename.
||Display musical locations as rational numbers instead of floats.
||Don't put a space between each location information field.
||Display duration since start of music in whole notes.
||Display duration since start of music in sixteenth notes.
- Filename enclose in double quotes.
- Line number, prefixed by capital "L".
- Measure number, prefixed by capital "M".
- Beat number, prefixed by capital "B".
- Absolute quarter note position. (time from start of music until current line), prefixed by capital "Q".
Each of these features can be selectively extracted from the score.
When none of the location features are given as an option, all of them
- -f include the filename in the **location spine.
- -l include the original file line number in the **location spine.
- -m include the measure number in the **location spine.
- -b include the metric beat position in the **location spine.
- -q include the absolute quarter note position in the **location spine.
The location prefix markers can be duplicated after each feature in
order to make regular expression more robust by using the -d option
to double the labels. This helps to avoid matching cases such as M11
when searching for M1:
Label prefixes can be removed with the -L option:
Spaces between the features can be removed with the -S option:
The -a option will append the **location spine
to the input data, while -p will prepend the analysis data to
the input data.
The filename quotes can be removed by using the -Q option.
Alternate absolute position descriptions
In addition to -q for absolute quarter note rhythmic positions of data lines,
several other rhythmic values can be used:
- -x: express absolute position in terms of sixteenth notes.
- -e: express absolute position in terms of eighth notes.
- -q: express absolute position in terms of quarter notes.
- -h: express absolute position in terms of half notes.
- -w: express absolute position in terms of whole notes.
Rational numbers for rhythms
The -R option can be used to list rhythmic values as rational numbers instread of
location -mba | location -Rmba
Locate French augmented-sixth chord sonorities in Bach chorales
tntype -Da h://chorales | location -Qafmb | dittox -p | grep -i French
8FnJ 8BJ 8d#J (4a) French-sixth Chord chor146.krn M4 B2.5
A French sixth sonority occurs once in Chorale 146 at measure 4
on the offbeat of beat 2.
Compare to using hgrep:
tntype -Da h://chorales | hgrep -NHmb -x '**description' French
chor146.krn:measure 4:beat 2.5:FnJ 8BJ 8d#J (4a) French-sixth Chord
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
The compiled location program can
be downloaded for the following platforms:
- Linux (i386 processors)
(dynamically linked) compiled on 24 Oct 2013.
- Mac OS X/i386 compiled on 13 Nov 2013.
The source code for the program was last modified on 17 Oct 2013. Click here to go to the full source-code download page.