Body Statements

Note Statements

When a scorefile is read by an application, a single MKNote object is created for each note statement in the file. MKNote statements take the following form:

partName , ( typeAndTag ) [ , parameters ] ;

partName is the name of the MKPart to which the MKNote belongs. It must be declared in a part statement in the header.

typeAndTag provides noteType and noteTag information; its form depends on the noteType:

parameters is a list of parameters separated by commas. A parameter takes the form:

parameterName : expression

parameterName is the name of the parameter. Its form is that of a MusicKit parameter identifier minus the “MK_” prefix. For example, MK_freq becomes, in a scorefile, freq. In a scorefile you can create your own parameters simply by including them in a note statement. When the scorefile is read by an application, a parameter identifier is automatically created and named for each of your invented parameters.

expression is computed as the value assigned to the parameter. An expression can include variable assignments:

parameterName : ( variable = expression )

Time Statements

A time statement specifies the performance time in beats for all subsequent MKNote statements until another time statement is encountered. A time statement takes the form:

t [ + ] expression ;

The keyword t is a special symbol; its value is the current time, in beats, in the scorefile. At the start of the scorefile, the value of t is 0.0. If expression is preceded by +, t is incremented by the value of expression. Otherwise, t takes the value of expression directly. Time always moves forward in a scorefile―the value of t must never decrease.

t can be used as a read-only variable in an expression.