Combining argument values

Let us have a closer look at the Csound score of sound-object prototype 'c'.

t 0 120
i2 0 0.2500 9.00 0 0 90 90 ; C5
i2 0.2500 0.2500 9.02 0 0 62 62 ; D5
i2 0.500 0.2500 9.04 0 0 90 90 ; E5
i2 0.7500 0.2500 9.05 0 0 90 90; F5
e

The last two arguments represent volume. Let p0 be the value in a particular place of a score line. (For instance, p0 = 62 on the second event.) If the volume is not explicitly controlled, then p0 is copied to the output score. However, if a "_volume(x)" instruction precedes the sound-object, the output value p1 is calculated as follows:

p1 = p0 * (x / default)

where 'default' is the default volume, i.e. 90 in BP2.

For other controls such as pitchbend, modulation, channel pressure and panoramic, a different formula is used:

p1 = p0 + x - default

where 'default' takes the following values:

• 8191.5 for pitchbend
• 0 for channel pressure and modulation
• 64 for panoramic

These calculations are performed in the MIDI parameter range. If the parameter is mapped to a different range in the Csound domain, p0 is first converted to the MIDI range (using the reverse mapping), the formula is applied, and then the result is mapped back to the Csound range.