!body topmargin="15" leftmargin="5" alink="#ff8080" bgcolor="#e2dfc7" link="#dd0000" marginheight="5" marginwidth="5" text="#321e04" vlink="#118dcc">
Text following a '%' character are comments which will be ignored when reading the data into matlab. The kern data is converted into a matrix (currently) with seven columns. Each row in the matrix represents one note in the score, and the columns contain information about the note:
The output data should be saved to a file ending in the extension .mat. This will allow you to read the data file into octave or matlab using the load command for further analysis in one of those programs. Below is an example of loading the file into octave via a file called output.mat and then displaying the contents of the variable called output which is created to store the data read from that file.
Use of time2matlab in the Mazurka ProjectThe output data from time2matlab is intended for use in Andrew Earis's Expression Algorithm program which takes an audio file and a data file containing estimated note positions generated as output from time2matlab. The Expression Algorithm then produces revised notes attack times based on an analysis of the contents of the audio file.
Example input data files can be found starting from this page. Links on that page point to preliminary performance data. Input files to time2matlab end in the extension .time, such as this one for a performance of Chopin's mazurka in C-sharp minor, Op. 63, No. 3 as performed by Richard Farrell in particular on the recording found on the CD label EMI Phoenixa CDM 7641362. This file contains the score for the mazurka music along with estimated timings of note attacks (not the exact timings of notes) in the performance. The timing data found in the first column of the .time score is ultimately generated from this file which marks the times of beats in the performance in the recording. This beat file was in turn created by tapping to the beats inside of the audio editor program called Sonic Visualiser, and saved as a text-based annotation file.
Example output data from the Expression Algorithm software is viewable on this webpage.
Extracting data without performance information
If you are only interested in durations based on the score rhythms and not from an actual performance of a file, you can use the gettime program to extract score-based timings rather than timings based on a performance.
By default, a tempo of 60 beats per minute will be used when extracting timing information. To use a different tempo, you can add tempo information into the file, such as *MM100 for 100 beats per minute:
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 13 Dec 2005. Click here to go to the full source-code download page.