Timeline

Timeline

A timeline represents either a request for music to be created, or an entire music composition.

Data Item Type Required/ Optional Description
random_seed number optional A seed the Composer uses to generate random information. If a value is not specified, the Composer generates a value automatically
meta object optional An object containing user-defined information. The Composer ignores this data, but it is added to the output timeline (if requested)
spans array optional An array of span objects. At least one span must be specified to create music
unmetered_hits array optional An array of unmetered hit objects
notifications array optional An array of any notable modifications the Composer made to the processed timeline. This data is ignored on input. For output, it contains processing notifications. The strings are are prefixed with “WARNING:” for non-fatal errors or “ERROR:” for fatal errors

Note: The last span must be unmetered to represent the end of the music. Also, unmetered hit objects can exist after the final unmetered span. The render ends at either the final unmetered span or at the time of the final unmetered hit because the Composer has no knowledge of how long the hit sample lasts.

Example:

  {
      "random_seed": 1337,
      "meta": { ... },
      "spans": [ ... ],
      "unmetered_hits": [ ... ],
      "notifications": [ ... ]
  }

Example — Mininal Input Timeline (30 seconds of “driving classic rock”):

{
    "spans": [
        {
            "id": 111,
            "type": "metered",
            "time": 0,
            "regions": [
                {
                    "id": 222,
                    "region": "music",
                    "descriptor": "driving_classic_rock",
                    "beat": 0
                }
            ]
        },
        {
            "type": "unmetered",
            "time": 30
        }
    ]
}