Span

Span

A span object represents the beginning of a period of absolute time. There are two types of spans: metered and unmetered. Metered spans contain music. Unmetered spans do not contain music and are used to denote the end of a previous metered span. Because of this, spans are always non-overlapping.

Although span objects are defined in terms of absolute time, the events within them are defined in beats. Beats are calculated based on the tempo of the span over time. If the beat of any child data within a span occurs after the span ends, it will be ignored.

Metered Span

Data Item Type Required/ Optional Description
id number required A unique identifier
type text required The type of span (metered in this case)
time number required The absolute time, in seconds, at which the span starts
tempo number optional The tempo, in beats per minute, at the start of the span. If omitted, a random tempo is selected
regions array optional An array of region objects contained within the span. If ommitted or empty, no music will be composed
actions array optional An array of action objects applied to the timeline
instrument_groups array optional An array of instrument_group objects used in this span
tempo_changes array optional An array of tempo change objects representing control points in the span object’s tempo curve
metered_hits array optional An array of metered hit objects

Example Metered Span:

{
    "id": 111,
    "type": "metered",
    "time": 0.0,
    "tempo": 120.0,
    "regions": [ ... ],
    "actions": [ ... ],
    "tempo_changes": [ ... ],
    "instrument_groups": [ ... ],
    "metered_hits": [ ... ]
}

Unmetered Span

Data Item Type Required/ Optional Description
time number required The absolute time, in seconds, at which the span starts
type text required The type of span (metered in this case)

Example Unmetered Span:

{
    "time": 0.0
    "type": "unmetered",
}