The Sorting Hat

You thought you were going to get clear through this book without running into a single Harry Potter reference? Hah! Foolish muggle!

Before Csound can use a score to produce sound, the score has to be processed. This processing takes place in three phases, called Carry, Tempo, and Sort. The processing is well explained in the page of The Canonical Csound Reference Manual called “The Standard Numeric Score.” In practice, the process is usually fairly transparent to the user, but if you don’t know what’s being done, you may occasionally find that your scores don’t sound the way you expect them to.

Each section of the score is processed individually; sections don’t overlap.

During the Carry phase, groups of consecutive i-statements whose p1 fields (the instrument numbers) correspond are processed. When a p-field contains a carry symbol, such as a dot or a plus sign, this symbol is replaced with an actual number. Likewise, when p-fields at the end of an i-statement have been left empty (an implicit carry operation), the missing data is added.

Macros created using #define statements are replaced with actual values during this phase.

During the Tempo phase, t-statements are considered. This operation converts p2 values from beats into actual values in seconds. With i-statements, the same operation is carried out on p3, so that the duration of the event is now defined in seconds rather than beats.

Finally, the Sort routine sorts all of the statements in the score into chronological order based on their p2. Sorting also “unfolds” any looped sections within the score, producing a list of discrete events, and macros whose values change during loop repetitions are turned into actual values at this time. When two events have the same p2 value, they are sorted so that their p1 values are in ascending order; this ensures that lower-numbered instruments will start before higher-numbered instruments.

The sorting process has an important implication: With certain restrictions if you’re using carry symbols, -b and -v statements, or repeating loops using the {} loop syntax, it doesn’t matter what order you place the events in within a given section. You can write out all of the events for instrument 2 from the beginning of the section to the end, and then below them write out phrases for instruments 1 and 3, intermingled. Csound will sort them all out and perform them in the proper sequence.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.142.136.226