15 Linking and Alignment

The linkAlign module makes it possible to align recorded media (audio, video) with elements in the musical domain. This allows for synchronization between the encoded notation and one or many media.

15.1 Overview of the Linkalign Module

The module described in this chapter makes available the following components:

15.1.1 Elements

  • timeline Provides a set of ordered points in time to which musical elements can be linked in order to create a temporal alignment of those elements.
  • when/ Indicates a point in time either absolutely (using the absolute attribute), or relative to other elements in the same timeline element (using the interval and since attributes).

15.2 Linking and Alignment Examples

The timeline element contains a reference to an external file using the avref attribute. The path to this external file may be a location on a hard disk or a URL. The origin attribute specifies the when element corresponding to the beginning of the timeline.

The when element specifies timestamped locations on the referenced media file. These may be defined using either an absolute time stamp (specified in ISO 24-hour time format, HH:MM:SS.ss), or using a combination of the interval, inttype, and since attributes.

  <timeline avref="http://example.com/mediafile.mp3origin="linkAlign.e1t2w1xml:id="linkAlign.e1t1w1">
    <when absolute="00:00:00.0xml:id="linkAlign.e1t2w1"/>
    <when interval="0:01.0inttype="timesince="linkAlign.e1t2w1xml:id="linkAlign.e1t2w2"/>
    <when interval="128inttype="midisince="linkAlign.e1t2w2xml:id="linkAlign.e1t2w3"/>

Musical elements can reference specific time points using the when attribute. This is available on most musical elements, e.g., note, rest, measure, etc.

      <timeline avref="http://example.com/mediafile.mp3origin="linkAlign.e2t1w1">
        <when absolute="00:00:00.0xml:id="linkAlign.e2t2w1"/>
        <when interval="0:01.0inttype="timesince="linkAlign.e2t2w1xml:id="linkAlign.e2t2w2"/>
        <when interval="128inttype="midisince="linkAlign.e2t2w2xml:id="linkAlign.e2t2w3"/>
      <measure when="linkAlign.e2t2w1xml:id="linkAlign.e2m1"/>
      <measure when="linkAlign.e2t2w2xml:id="linkAlign.e2m2"/>
      <measure when="linkAlign.e2t2w3xml:id="linkAlign.e2m3"/>