Humdrum Extras

gettime manpage


COMMAND

    gettime -- Create an absloute timing spine to indicate the playing time of **kern data.

SYNOPSIS

    gettime [-i | -s | -t | -T [-R[-C[input[> output]

OPTIONS

-m Calculate attack times in milliseconds rather than seconds.
-t Display tempo information rather than time data.
-i Interpolate at a constant tempo between pre-existing **time values.
-R Do not round the time (in milliseconds only) or tempo value to the nearest integer.
-C Ignore *rit and *accel tempo markers.
-T Display the total time that a **kern score takes to be performed instead of the attack times of the individual **kern lines.
--simple Display the total time values (using the -T option) in terms of plain seconds rather than hours:minutes:seconds.

EXAMPLES

    Performance Time

    The performance time of a **kern file can be calculated by using the -T option.

        gettime -T inven01.krn
           Total time:	1:29.0388 minutes
     
    In 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 minutes
     
    For 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.9
     
    You 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.9
     
    So 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

ONLINE DATA

    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

SEE ALSO

DOWNLOAD

    The compiled gettime program can be downloaded for the following platforms:
    • Linux (i386 processors) (dynamically linked) compiled on 28 Jun 2012.
    • Windows compiled on 29 Jun 2012.
    • Mac OS X/i386 compiled on 13 Nov 2013.
    • Mac OS X/PowerPC (version 10.2 and higher) compiled on 13 May 2009.

    The source code for the program was last modified on 11 Nov 2013. Click here to go to the full source-code download page.