Sequence content
MNX uses the term sequence content to mean a series of musical events that are both presented and performed in a given order, each at a distinct time. For example, these musical events include notes and rests.
Sequence content has three attributes:
- The content itself, which is encoded via the sequence object.
- A starting position, which is the metrical position of the content's first element within the containing measure.
- A time modification ratio, which is a rational number scale factor that implicitly applies to all positions and durations within the content.
Sequencing the content
Within sequence content, each event is assigned a metrical position according to the following procedure, called sequencing the content:
- Let sequence cursor be the starting position of the sequence content.
- Let content be the list of MNX objects comprising the sequence content.
- For each object obj within content:
- If obj has a
"type"
value of"event"
:- If obj has a
"measure"
value oftrue
,- If sequence cursor is greater than zero, throw a processing error.
- Set sequence cursor to the end of the measure as defined by its time signature.
- Else,
- Set the metrical position of obj to sequence cursor.
- If obj has a
"duration"
, assign it to event duration. - Else, throw a processing error.
- Multiply event duration by the time modification ratio, and add the result to sequence cursor.
- If obj has a
- Else, if obj has a
"type"
value of"space"
:- Set the metrical position of obj to sequence cursor.
- Add the
"duration"
of obj, multiplied by the time modification ratio, to sequence cursor.
- Else, if obj has a
"type"
value of"tuplet"
:- Sequence the content of obj, using sequence cursor as the starting position, and multiplying the time modification ratio by the tuplet's outer / inner ratio for the processing of the tuplet.
- Add the total duration of obj as given by outer, multiplied by the time modification ratio, to sequence cursor.
- Else, if obj has a
"type"
value of"grace"
:- Process the contents of obj, assigning them a non-metrical ordering relative to preceding or following elements as appropriate.
- If sequence cursor exceeds the specified duration for the enclosing element (time signature for a measure,
"inner"
value for a tuplet), throw a processing error.
- If obj has a