Describing Musical Events |
Describing Musical Events |
Streams of Events and Iteration |
Nested control structures and the special variables start and endThe way in which compound events are describedin a score is by nesting control structures representing low-level events within higher level ones. The following (trivial) script illustrates this technique, at the same time as introducing two special variables calledstart and end , which
play a central role in describing compound events:
Audio rate: 44100; Init: ... Score 2 secs: From 0 secs to 1 secs: At start: Print "For interval 0-1 seconds start=", Time, newline; ... At end: Print "For interval 0-1 seconds end=", Time, newline; ... ... From 1 secs to 2 secs: At start: Print "For interval 1-2 seconds start=", Time, newline; ... At end: Print "For interval 1-2 seconds end=", Time, newline; ... ... ... When invoked this script produces the following output: Sample rate=44100 Hz Score duration=2 seconds For interval 0-1 seconds start=0 For interval 0-1 seconds end=1 For interval 1-2 seconds start=1 For interval 1-2 seconds end=2 The four Another example is given below to clarify this point: Audio rate: 44100; Init: ... Score 5 secs: At start: Print "For score, start=", Time, newline; ... At end: Print "For score, end=", Time, newline; ... From 1 secs to 4 secs: At start: Print "For interval 1-4 seconds, start=", Time, newline; ... At end: Print "For interval 1-4 seconds, end=", Time, newline; ... ... ... In this example the first pair of Sample rate=44100 KHz Score duration=5 seconds For score, start=0 For interval 1-4 seconds, start=1 For interval 1-4 seconds, end=4 For score, end=5 Note also that it doesn't matter in which textual order events are given in a score, the only thing which matters is the instant in time, or time interval defined by the values in the head of the control structure. The ability to nest events and define the start and end times of a sub-event in relative rather than absolute terms provides a rudimentary mechanism for describing compound events 1.
| ||
Describing Musical Events |
Describing Musical Events |
Streams of Events and Iteration |
©1999,2000 Mark Pearson
m.pearson@ukonline.co.uk April 30, 2000 |