Sound-objects
containing Csound scores
Sound-objects
contain sequences of elementary events which may be described as a MIDI stream,
a Csound score or both.
When
BP2 is instructed to produce MIDI real-time or a MIDI file, it uses the MIDI
stream of sound-objects and ignores their Csound definitions. Conversely, when
asked to write the performance as a Csound score, it uses the Csound score of
each sound-object. If the sound-object has no score, BP2 converts its MIDI
stream to a Csound score, using the current or default Csound instrument
description, as shown in the preceding section.
To
produce Csound scores it is wiser to design Csound scores in sound-object
prototype
s
rather than rely on a conversion from MIDI which may leave out relevant
parameters.
A
demo of the use of sound-objects containing Csound scores is given in
"-da.tryCsoundObject
s".
Type cmd-e ("Edit prototypes") to load the attached "-mi.tryCsoundObject
s"
sound-object prototype file. Then click button "Csound" to display the Csound
score of prototype 'a' (see Fig.36).
Fig.36
The Csound score of a sound-object prototype
The
score contains four events invoking instruments 1, 2 and 3. Note that this
score is incomplete because it contains only the compulsory arguments for
setting time, duration and pitch. BP2 will complete missing arguments with
their default values.
To
compile this score, BP2 requires the description of instruments supplied by the
"-cs.tryCsoundObject
s"
Csound instrument file. This file has been loaded automatically for two reasons:
• Its
name appears on top of the "-da.tryCsoundObject
s"
file
• Its
name has been found in the "-mi.tryCsoundObject
s"
file (on the left top of the window, see Fig.36). It can be changed by
clicking the "Change instrument fil
e"
button.
To
avoid inconsistencies it is sufficient to state the name only once, preferably
in the sound-object prototype file.
On
the graphics Csound events are marked with red lines whereas MIDI events show
as black lines. Objects 'a', 'b' and 'c' in this file contain only Csound
scores (as told by radio buttons on Fig.36), whereas the sound-object prototype
'midiobject' also contains a MIDI stream. The MIDI stream and the Csound score
of an object may contain similar events as to pitch and timing, but each of
them may also contain additional information that is specific to the
representation: Csound score lines contain parameters that have no equivalent
in the MIDI stream, and conversely a few MIDI messages may not be reflected in
a Csound score.
BP2
checks that the Csound score and the MIDI stream, if not empty, represent
sequences of events with identical durations. If this is not the case a
message is displayed although the user is not forced to correct the mismatch.
In this case, the longest duration is taken as the nominal duration of the
sound-object prototype.