Compound Actions¶
Compound actions act as containers for others actions. They serve as temporal containers: their purpose is to organizes actions in time, rather than in space (that is what data structures are for). They can thus also be seen as control structures.
The actions “inside” a container (we also say “nested in” or refer to “child actions”) are specified as a sequence of actions. Successive actions in the sequence are linked with one of the three possible sequencing operators. These operators are described in section continuation operators.
All child actions inherit some of the container's attributes. The nesting of containers creates a hierarchy which can be visualized as an inclusion tree. The father of an action A is its immediately enclosing container F, if it exists, and A is a child of F.
The nesting of actions can be explicit. This is the case for a (sub-)group nested in a group (see below): the textual fragment of the score that defines the sub-group is part of the text that defines the enclosing group. But the nesting of action can also be implicit. This is the case for the action launched by a process call: they are “implicitly nested” in the caller.
We first present the group structure. It gathers several actions logically within a same block that share common properties of tempo, synchronization and error handling strategies. The group is the basic container: all other compound actions are variations on this structure
-
a loop is a sequential iteration of a group,
-
a curve is also a sequential periodic iteration of a group,
-
a forall is a parallel iteration of a group,
-
an if or a switch is a choice between several groups to launch, at some point in time,
-
a whenever is a conditional choice in time of the launching of a group.
All compound actions are guarded by an optional end clause that limits its scope of execution. The @exclusive attribute may also be specified to prevent the overlapping execution of the same action.
In a sequence of actions, two successive actions are related by a continuation operator.
General Syntax of a Compound Action¶
Loop¶
ForAll¶
If¶
Whenever¶
Continuation operators¶
The three continuation operators link two successive actions in a sequence of actions. It is not possible to specify an attribute for the resulting actions, but it is easy to embed this sequence as the body of a group and to specify the attributes for this group.