SYNOPSIS
OPTIONS
DESCRIPTION
EXAMPLESMultiple File Input If more than one input file is given, a list of the filenames will be given with the identified scale type. For example, here are the analyses of the first few songs collected by Helen Creighton in Nova Scotia: scaletyle *.krn
nova001.krn: hexatonic
nova002.krn: hexatonic
nova003.krn: heptatonic
nova004.krn: heptatonic
nova005.krn: pentatonic
nova006.krn: hexatonic
nova007.krn: heptatonic
nova008.krn: pentatonic
nova009.krn: pentatonic
nova010.krn: heptatonic
nova011.krn: heptatonic
nova012.krn: hexatonic
...
If you want to count the number of songs in a set with a particular
scale-type quality, you can pipe the output to the unix commands
grep and wc -l:
scaletype *.krn | grep heptatonic | wc -lFor the set of Nova Scotia songs, the resulting count is 66, with hexatonic being 62, and pentatonic being 13. By default, multiple files will be listed with their full pathnames according to the input. If you do not want to see the directory in which a file is located, you can add the -D option. Also, filenames can be suppressed with the -F option scaletype -F *.krn
hexatonic
hexatonic
heptatonic
heptatonic
pentatonic
hexatonic
heptatonic
pentatonic
pentatonic
heptatonic
heptatonic
...
The -F option is useful for counting the number of
songs in each category:
scaletype -F *.krn | sort | uniq -c | sort -nr
66 heptatonic
62 hexatonic
13 pentatonic
8 chromatic
3 toofew
Pitch-Class Sets Using the -p option will add additional pitch-class information after the scale-type designation. scaletype -p nova001.krn
hexatonic C D E F G A
The scaletype program cannot be used to identify the tonic of the scale, so the first pitch-class in the list is not necessarily the tonic note. Here is an example of extracting diatonic pitch-class listings for all of the Bach Well-Tempered Clavier (syntax for bash shells):
for i in 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
do
echo wtc1 $i ==============================
scaletype -p h://wtc/wtc1p$i.krn # WTC1 Prelude
scaletype -p h://wtc/wtc1f$i.krn # WTC1 Fugue
echo wtc2 $i =====
scaletype -p h://wtc/wtc2p$i.krn # WTC2 Prelude
scaletype -p h://wtc/wtc2f$i.krn # WTC2 Fugue
done > wtc.txt
More example usages of the scaletype program are available on the scaletype examples page
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: 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 DOWNLOAD
The source code for the program was last modified on 6 Apr 2013. Click here to go to the full source-code download page. |