The event object

Type: Dictionary

The event object represents a discrete period of time during which one or more notes are performed, or in which a rest occurs.

All events other than whole-measure events require a value attribute to provide their duration as a note value. This duration is implicitly multiplied by the current time modification ratio, as specified by the process of sequencing the content of the event’s containing element.

Keys:

Name Type Required? Description
"duration" note value object No The duration of this event. This is required unless this event has measure=true.
"id" id object No
"markings" event markings object No
"measure" boolean object No Whether this event is a whole-measure event — meaning its duration lasts the entire measure. This is used, for example, for rests that last an entire measure.

If this value is set to true, then this event may not specify "value" and this event must either be empty or contain exactly one rest.
"notes" An array of note objects No
"orient" orientation object No A specific orientation for this event. If not provided, the orientation is inherited from any ancestor element that specified it. If no ancestor did so, the orientation is determined automatically according to the implementation’s rendering rules.
"rest" rest object No
"slurs" An array of slur objects No
"smufl-font" smufl font object No The SMuFL-compliant font to be used when rendering this event.

The primary purpose of this attribute is to override a global font assignment.
"staff" staff number object No A specific staff index for this event. If not provided, the value is inherited from any ancestor element that specified it. If no ancestor did so, the value is determined automatically according to the implementation’s rendering rules.

The primary purpose of this attribute is to override a default staff assignment at the sequence level — as in cross-staff keyboard notation.
"stem-direction" stem direction object No Whether the stem of the note(s) in this event is up or down. If not provided, this is left to consuming software to decide automatically.
"type" The string "event" Yes

Examples

This object is used in the following examples:

Accidentals, Articulations, Beams, Beams (across barlines), Beams (hooks), Beams (secondary beam breaks), Beams (with inner grace notes), Clef changes, Dotted notes (augmentation dots), Grace note, Grace notes (beamed), Jumps (D.S. al Fine), Jumps (Dal Segno), Key signatures, Multimeasure rests, Multiple layouts, Multiple voices, Octave shifts (8va), Organ layout, Parts, Repeats, Repeats (more than once repeated), Repeats (with alternate endings, advanced), Repeats (with alternate endings, simple), Repeats (with implied start repeat), Rest positions, Slurs, Slurs (for chords), Slurs (incomplete slurs), Slurs (targeting specific notes), Styling elements (basic), Styling via a class (basic), Tempo markings, Three-note chord and half rest, Ties, Time signatures, Tremolos (single-note), Tuplets, Two-bar C major scale, “Hello world”