previous up next
6.5 Introducing complex time dependencies in a composition

In certain cases we want to relate the logical time in the composition to the ``absolute time'' in a non-trivial fashion. Time deformations are useful in the following cases:

  • It is easier to reason about the organization of a composite structure on a ``linear'' time axis followed by a projection of the organization with a non-linear ``warping'' function, then it is to reason directly on a ``non-linear'' time axis.

  • Time warping can be used to change the speed of execution of a composition. This change of speed does not have to be constant, which would be quite trivial, but can vary during the performance. This tempo change can be used to introduce expressiveness, but also to synchronize the playback with a performer.

The issue of time deformation can be seen more generally in the light of the representation of continuous time. Of course, no such thing as continuous time exists in digital systems. However, we have defined our control functions such that their value can be requested at any time value (section 5.3). It is in this fashion that we interpret the notion of ``continuous'' time functions in this text. Our proposition for the manipulation and integration of continuous time is a combination of Honing & Desain's generalized time functions [Hon93] and time warping, in particular Dannenberg's work [Dan97]. Other works relevant to this discussion are those by Rodet & Cointe [RC84], and Anderson & Kuivila [AK89].

To represent

  • continuous control functions within compositional structures,

  • non linear time relations between ``local time'' and ``absolute time'',

  • a rich time model during the execution of a piece,

we will introduce

  • a layered, hierarchical, and continuous representation of time,

  • time models to warp time from one layer onto the next layer of this hierarchy, and

  • time contexts to encapsulate the time information of an activity use during runtime.

The layered time models coincides with the structural hierarchy described by patterns and motifs. This rich time representation is used to transform the start times and durations of activities and to describe non-linear dependencies of control functions on absolute time.


 
Figure 6.7.a
Figure 6.7.b
 
Figure 6.7: The figure shows an example of a time model. A) Above is depicted the original pattern and motif as it is used in the composition. Below are shown the activities with their final durations after scheduling. B) The start times and the durations of the activities are mapped using the time model.

To the hierarchy of motifs and patterns will we attach a hierarchy of time models. Consider figure 6.7. Motif msubscribes to pattern p. When motif m requests its contents, pclones its contained activities and organizes them according to m's duration. We will introduce a virtual time axis tp for pattern p. In reality p has no such time axis. This axis only exists when p organizes the activities for a particular motif. In that case the length of the time axis is the duration of the motif. Once the activities are organized, their start times and the durations are mapped from p's virtual time axis onto m's time axis. For this mapping pattern p uses a time model. The example in figure 6.7 depicts a logarithmic time model. This time model provokes an accelerando. Time models are defined as follows:

Definition 2 (Time model)   A time model tm is a bijection that maps a value t onto a value t'tm: [0,1]->[0,1], t'=tm(t). TM denotes the set of time models. A special time model is the linear model, tmlinear: t' = t.


 
Figure 6.8
 
Figure 6.8: Figure a) shows a simple organization. Motif m and activity a have a local time axis. Both axes stand in some relationship to each other. This relationship is described by the time model of pattern p. B) Time models describe the mapping of the time axis of an activity onto the time axis of a motif.

Time models are not only used to adjust the start position and durations of the activities. With every activity we associate a local time axis (see figure 6.8). Motif m has a local time axis tm, and activity a has a local time axis ta. These two axes stand in some relationship to each other. This relationship is described by the time model of the pattern p that contains a. How this relationship is articulated is shown in the figure. For the construction of this relationship we will rely on p's virtual time axis tp. The mapping of the time axis of activity a onto the time axis of motif m requires the time model of the pattern p and the offset and duration of a. When we let the time grow linearly on the time axis of a, it will grow logarithmically on m's time axis. Vice versa, when the time advances linearly on axis tm, ta grows exponentially.


 
Figure 6.9
 
Figure 6.9: Any synthesis process created by an activity is embedded in a time context. This time context describes the time dependencies, as defined in the composition, between the local time axis and the real time.

When the activities are scheduled, they will provoke the creation of new synthesis processes (see also figure 6.6). These synthesis processes and the control functions that steer them must experience the same time dependencies as the activities in the composition. We must therefore pass all the time information and the context in which the activity finds itself in the composition to the synthesis processes and their control functions. We will group this information in a structure called time context (Fig. 6.9). This time context ensures the correct conversion from the real time to the local time of the synthesis process.


 
Figure 6.10
 
Figure 6.10: The construction of time contexts.

Consider figure 6.10. An activity a1 starts at a time sa1 and has a duration da1. Both sa1 and da1 are measured on the time axis of a1's pattern p2. When a1 is performed, it experiences a time ta1. Motif m2subscribes to the organization of pattern p2 and is included into the pattern p1. It has a start time sm2 and duration dm2measured on the time axis of p1. When motif m2 is performed, it experiences a time tm2. Motif m1 subscribes to the organization of pattern p1 and has a duration dm1. When the user request the performance of motif m1 at some time sm1, activity a1 will be scheduled at its appropriate time. The mapping of the time experienced by the activity a1 onto the real time dictated by the system depends on the start times of a1, m2, and m1, and the time models of p2 and p1. The mapping of ta1 onto tm2 is described by the time model of p2. The mapping of tm2 onto tm1 is described by the time model of p1. A synthesis process created by the activity a1 must be able to reconstruct this hierarchy of time dependencies during the performance. For this purpose, we chain the necessary data into a series of time contexts.

Definition 3 (Time context)   A time context c is a quadruple <s,d,tm,c'>. s in R+ indicates an offset time, d in R+ a duration, tm in TM a time model. c' is the parent time context of c.

In the case of activity a1 in figure 1.9 the context c is equal to <sa1,da1,tmp2,c'>. c' is the parent time context of a1, i.e. the time context of motif m2.


 
Figure 6.11
 
Figure 6.11: Any synthesis process created by an activity refers to a linked list of time contexts. The synthesizer passes the synthesis process the real clock time. Using this time and the contexts, the process can calculate the time on any level of its parent's contexts.

We can now fully specify the interfaces of the synthesizer object and of the activities. The add method of the synthesizer expects three arguments:

1.
an identifier for the synthesis process (see section 5.3.2),
2.
the time context of the synthesis process,
3.
the synthesis process.

When activity a1 is scheduled, its start program ps is invoked. The first arguments passed to ps is the time context c of a. c holds a reference to its parent time context, and so forth. The argument passed to ps is thus a chained list of time contexts (Fig. 6.11). ps creates a new synthesis process sp and adds it to the synthesizer passing along the time context. When the synthesizer calls the synthesis process sp it converts the absolute time indicated by the system to the local time of the synthesis process using sp's time context. When the synthesizer calls the synthesis process to produce the sound, it gives as parameters the synthesis buffer, the local time, and the time context. sp calls upon any control function with its local time and, again, the time context. Using this local time and time context, the control functions can calculate the time on any superior time level of the composition. This possibility will be used in the example of amplitude curves, portamento, and vibrato discussed in section 6.7. First, we take a closer look at activities used for sound production.

previous up next