The performance time of a **kern file can be calculated by using the -T option.
gettime -T inven01.krn Total time: 1:29.0388 minutesIn this case the file inven01.krn is calculated to take 1:29 minutes to perform in real-time. If you want to calculate the time of multiple files, you can give multiple input files to the gettime program and it will provied the performance time of each individual file as well as give a total time for performing all files.
gettime -T inven*.krn inven01.krn: 1:29.0388 minutes inven02.krn: 1:56.9675 minutes inven03.krn: 1:13.9554 minutes inven04.krn: 43.985 seconds inven05.krn: 1:24.0263 minutes inven06.krn: 1:38.9362 minutes inven07.krn: 1:48.0235 minutes inven08.krn: 51.9966 seconds inven09.krn: 1:46.993 minutes inven10.krn: 1:01.97991 minutes inven11.krn: 1:02.02247 minutes inven12.krn: 1:08.9781 minutes inven13.krn: 1:18.0234 minutes inven14.krn: 1:20.9444 minutes inven15.krn: 1:12.0327 minutes Total time: 19:57.9032 minutesFor direct comparison of the times for each file, you can add the --simple option to display in plain seconds:
gettime -T --simple inven*.krn inven01.krn: 89.0388 inven02.krn: 116.968 inven03.krn: 73.9554 inven04.krn: 43.985 inven05.krn: 84.0263 inven06.krn: 98.9362 inven07.krn: 108.023 inven08.krn: 51.9966 inven09.krn: 106.993 inven10.krn: 61.9799 inven11.krn: 62.0225 inven12.krn: 68.9781 inven13.krn: 78.0234 inven14.krn: 80.9444 inven15.krn: 72.0327 Total time: 1197.9You can sort the files according to the performance length by piping the timing data to the unix sort command:
gettime -T --simple inven*.krn | sort -n -k2 -t' ' inven04.krn: 43.985 inven08.krn: 51.9966 inven10.krn: 61.9799 inven11.krn: 62.0225 inven12.krn: 68.9781 inven15.krn: 72.0327 inven03.krn: 73.9554 inven13.krn: 78.0234 inven14.krn: 80.9444 inven05.krn: 84.0263 inven01.krn: 89.0388 inven06.krn: 98.9362 inven09.krn: 106.993 inven07.krn: 108.023 inven02.krn: 116.968 Total time: 1197.9So now it is easy to see that invention no. 4 is the shortest invention, and invention no. 2 is the longest.
Calculating the average number of notes per second
The -T option can be used in conjunction with the command census -k to calculate the number of notes per second, which may be a useful piece of information for research of a particular repertory. To calculate the average number of notes per second, you need to know two things: (1) the total time of the music, and (2) the number of notes in the music. For the Bach Inventions used in examples above, the total duration of the music is 1198 seconds. Using census -k, you find that the number of notes in the inventions is 8,462 notes. Therefore, the number of notes being played per second on the average is 8462/1198 = 7.06 notes/second.
More example usages of the gettime program are available on the gettime 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:
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