previous up next
6.3 Defining modifications to patterns and motifs

The internal relationships between the elements of a pattern define its organization. The structures we propose do not fix these relationships for the user. In addition, time models provide a means to adjust the organization of a pattern thru time deformation. However, in some cases it may be necessary to include additional means of manipulation:

  • to allow changes to other elements than the time dimension,

  • to submit the activities in the pattern to some sort of processing before they are handed to the motif,
  • to let the motif make a variation on the organization received from a pattern.

How the patterns and their activities are adjusted will likely depend on the contents they represent. In section 1.6 we will discuss the cases of activities and patterns that represent sound. In that particular case we will make some additional assumptions about the activities. However, we do want to provide a means to modify patterns in the general case. To solve the problem we defined the interfaces Modifiable and Modifier.

A pattern or motif that is modifiable implements the Modifiable interface. This interface defines three methods: addModifier, removeModifier, and getModifiers. Variations are delegated to another object called modifiers. A modifier implements the Modifier interface.

The interaction between the patterns, motifs, and modifiers is as follows. When a motif requests its pattern to obtain its contents, the pattern organize its activities according to the motif's duration. If the pattern is modifiable and has modifiers, it calls them one at a time. Each modifier can make adjustments to the organization, or to the contents of the activities as pleases. Then the activities are handed to the motif and the same scenario is repeated. If the motif is modifiable and has modifiers, it calls them in turn to adjust the activities. Finally, the activities are scheduled for playback. We will see concrete examples in the section on sound activities.

Although we have said that parts of the composition can be scheduled dynamically, it is not the most appropriate way to include interactivity into a piece. Changes to the composition during playback may lead to inconsistencies: what happens when we start playing a structure and then move its end time before its start time? Interactivity can be best integrated into the composition using causal relations, described next.

previous up next