Keywords: Blue, Csound

Advanced
Prev | PolyObjects | Next

### Advanced

Before tackling some of the more advanced concepts of PolyObjects, a couple of clarifications must be made. When this document refers to editing the actual PolyObject, that means editing it as a SoundObject (moving it around on the timeline, stretching it, editing its properties, etc.). This is very different from editing the contents of said PolyObject. The distinction will be made in this section whenever applicable.

#### Time

PolyObjects can have their Time Behavior changed like any other SoundObject when one is editing the actual PolyObject. This is very important to keep in mind, because your sounds within the PolyObject may span 10 beats, but if you leave the Time Behavior settings for the PolyObject to the default (Scale), they may in actuality span only two beats, depending on the size of your PolyObject. One can test this with the Test button: shrink a PolyObject that has the Scale Time Behavior and the notes within it will shrink as well.

##### No Special Time Behavior

There are a couple of easy ways to make sure that the sounds you place in a PolyObject remain to scale in the parent container, or the root score. One method is to right-click on the PolyObject itself and click "Set Subjective Time to Objective Time." This will change the length of the PolyObject to be equal to the beat at the end of the last SoundObject within it. In other words, it will expand or contract to the actual total length of all of the notes within it. The other method is to change the Time Behavior of the PolyObject to None. Blue will not do any processing of the length of the notes within the PolyObject; they'll just be played exactly the way they are in the PolyObject.

There are advantages and disadvantages to each method. The first is good because it allows one to see the actual length of the PolyObject within the main score, but you have to remember to click "Set Subjective Time to Objective Time" each and every time you make a change to the PolyObject's contents. If you set the Time Behavior to None, the length of the PolyObject may appear to be two beats, but it may actually be ten or 20 or whatever; you don't know until you edit the contents of that PolyObject. However, with a Time Behavior of None, you can edit the contents of the PolyObject frequently and drastically without having to worry if your changes will be accurately represented in the CSD rendering. A good way to work may be to set a new PolyObject's Time Behavior to None and edit the contents of it as much as you like. Then, when it sounds satisfactory, you can click "Set Subjective Time to Objective Time" on it, so that you may edit the rest of the score while having an accurate picture of the actual length of the PolyObject. Keep in mind that you may use the "Set Subjective Time to Objective Time" feature on any SoundObject with any Time Behavior setting.

##### Repeat/Looping Time Behavior

One can lay down a series of sounds in a PolyObject and setup the PolyObject to loop them. The Time Behavior of the PolyObject itself needs to be set to Repeat, and the notes will loop for as long as the PolyObject's length. When the PolyObject's contents actually start looping in relationship to each other is determined by the Repeat Point; one can edit the Repeat settings in the property box of any SoundObject. The Repeat Point specifies the beat at which the group of notes will begin after the previous note group begins. If the Use Repeat Point is not checked, the next note group will begin immediately after the previous note group's last note ends.

An example would be a PolyObject whose contents are three one-beat notes played back-to-back:

    i1 0.0 1.0 3 4 5
    i2 1.0 1.0 3 4 5
    i3 2.0 1.0 3 4 5

If one set the Time Behavior to Repeat without using a Repeat Point and stretched the length of the actual PolyObject to six beats, six one-beat notes would play back-to-back, like this:

    i1 0.0 1.0 3 4 5
    i2 1.0 1.0 3 4 5
    i3 2.0 1.0 3 4 5
    i1 3.0 1.0 3 4 5
    i2 4.0 1.0 3 4 5
    i3 5.0 1.0 3 4 5

However, if one were to change the PolyObject to use Repeat Points and set the repeat point to 2.5, this would be the result:

    i1 0.0 1.0 3 4 5
    i2 1.0 1.0 3 4 5
    i3 2.0 1.0 3 4 5
    i1 2.5 1.0 3 4 5
    i2 3.5 1.0 3 4 5
    i3 4.5 1.0 3 4 5
    i1 5.0 1.0 3 4 5

Note that there are more notes being played this time. Why? Because with a Time Behavior of Repeat, blue will try to fit as many notes that it can into the PolyObject using the repeat settings given, without violating the order and length of the PolyObject's note arrangement. With the previous example, blue played the second group of three notes at beat 2.5, and realized it could squeeze in a partial third loop. This third loop begins at beat five, since that is equivalent to beat 2.5 in the second loop, which is our Repeat Point. It inserted the first note there and realized it couldn't fit any more notes, since the next note would begin at beat six and play until beat seven; that's longer than the length of our PolyObject, which is six.

#### NoteProcessors and PolyObjects

NoteProcessors are great when used in conjunction with PolyObjects. They can be very powerful, but you have to be careful of a few gotcha's.

##### P-fields and PolyObjects

One thing to be aware of with PolyObjects and NoteProcessors are p-fields. The user must make sure that the p-field(s) that is being operated on by the Note Processor(s) is the same for all sounds within the PolyObject. If one has a lot of typical notes in a PolyObject where p4 equals the pitch, and one errant note where p4 equals phase, for instance, things could get disastrous if one tries to apply a PchAddProcessor to the whole PolyObject. Please refer to the Best Practices section for more information.

##### Time Behavior and NoteProcessors

Everything that is to follow in this section can be summed up in one important fact: NoteProcessors get applied to SoundObjects before the Time Behavior does. What this means is, if you have a PolyObject with Repeat Time Behavior and set it up to loop twice, and have a LineAddProcessor on that same PolyObject, you will have a group of notes looped twice with the LineAddProcessor behavior applied twice; that is, applied individually to each looped group of notes.

So, to borrow from the example in Repeat/Looping Time Behavior, our group of three notes with no NoteProcessor and no Repeat Point would render like this:

    i1 0.0 1.0 3 4 5
    i2 1.0 1.0 3 4 5
    i3 2.0 1.0 3 4 5
    i1 3.0 1.0 3 4 5
    i2 4.0 1.0 3 4 5
    i3 5.0 1.0 3 4 5

If I add a LineAddProcessor to p-field four, starting from zero and going to two, here's what the result would look like:

    i1 0.0 1.0 3.0 4 5
    i2 1.0 1.0 4.0 4 5
    i3 2.0 1.0 5.0 4 5
    i1 3.0 1.0 3.0 4 5
    i2 4.0 1.0 4.0 4 5
    i3 5.0 1.0 5.0 4 5

This may be the desired effect, and it may not. In order to apply a NoteProcessor after the Time Behavior has been applied, take the following steps:

1. Apply the Time Behavior to you PolyObject, with no NoteProcessor on it.

2. Right-click on the PolyObject and select "Convert to PolyObject." What this will do is embed your PolyObject in yet another PolyObject.

3. Edit the Properties of the new PolyObject and apply the NoteProcessor to it.

If one applies the previous steps to the example cited above, the rendered notes look like this:

    i1 0.0 1.0 3.0 4 5
    i2 1.0 1.0 3.4 4 5
    i3 2.0 1.0 3.8 4 5
    i1 3.0 1.0 4.2 4 5
    i2 4.0 1.0 4.6 4 5
    i3 5.0 1.0 5.0 4 5

One thing the user will have to keep in mind, though; when referring to beats, those beats will be applicable to the notes as they are after the Time Behavior change. So, in the previous example, in order to get those results, one has to change the ending beat in the LineAddProcessor to five instead of two, because five is the beat at which the last note plays in the looped sequence.

#### Multi-layered Polyobjects

As mentioned previously, PolyObjects can contain other PolyObjects. The thing to remember when doing this is that each PolyObject's settings, NoteProcessor's, etc. are local to itself. For blue, the notes generated from a PolyObject SoundObject are the same as the ones generated from a GenericScore or any other type of SoundObject, and can be manipulated in the same way.

Prev | Up | Next
Basic | Home | Best Practices