next up previous contents
Next: Data read from text Up: Score acquisition Previous: Score acquisition   Contents

Score text file syntax

The file used as input to build the score is a text file (.txt format). in this file are stored all the events and their properties, with the following syntax:

Event_type [properties]
Event_type [properties]
...
END_OF_FILE
There are 6 different event types:
0 : note
1 : tempo
2 : time signature
3 : legato parameter
4 : duration tolerance
5 : dynamic
For each type, properties are described as shown:
note:      pitch, note_value(2 numbers), accentuation, measure, beat, fraction
tempo:     value,    0,         measure, beat, fraction
time_sign: up_value, low_value, measure, beat, fraction
legato:    value,    0,         measure, beat, fraction
dur_tol:   value,    0,         measure, beat, fraction
dynamic:   value,    0,         measure, beat, fraction

For a note, the two number of note_value are resp. the upper and the lower value of the duration fraction. Pitch, measure number, beat number and fraction values are like described in chapter 1. Rests are also coded: they are represented by notes with pitch 128.

example: for a C#5, 1/8 note, not accentuated, at measure 2, beat 3, fract 48, we will write:

0 61 1 8 0 2 3 48
END_OF_FILE is coded by a -1. Separators between values are blank spaces.

Figure 3.1: Score example
\resizebox{\figwidth}{!}{\includegraphics{figures/score.eps}}
For example, the score presented here will finaly be coded like:
2  4    4       1 1 0
1  120  0       1 1 0
3  0    0       1 1 0
4  10   0       1 1 0
5  5    0       1 1 0

0  67  1 4  0   1 1 0
3  1    0       1 2 0
0  72  1 8  0   1 2 0
0  71  1 8  0   1 2 48
0  65  1 4  0   1 3 0
3  0    0       1 4 0
0  128 1 4  0   1 4 0

1  80  0       2 1 0

0  64  1 4  1   2 1 0
0  69  1 8  0   2 2 0
0  67  1 8  0   2 2 48
0  62  1 2  0   2 3 0
0  67  1 4  0   3 1 0

-1 -1 -1 -1 -1 -1 -1 -1

Of course it would take a while to code a long and complex score with this syntax (imagine how the ``Toccata and fugue in Dm'' from J.S.Bach would look like...). But building a tool which would allow to create the text file easier is another subject...


next up previous contents
Next: Data read from text Up: Score acquisition Previous: Score acquisition   Contents
Mathieu Gilles (Betr. soltau) 2003-08-25