Csound checkup

Csound in the Bol Processor (BP2, BP3) environment

This arti­cle and the next one on Csound objects are reserved for Csound geeks inter­est­ed in cre­at­ing Csound scores with Bol Processor. They are com­ple­men­tary but they can be stud­ied independently.

The exam­ples in this sec­tion are not intend­ed to be audi­to­ry. Rather, the idea was to pro­duce short Csound scores that could be used to illus­trate the treat­ment of para­me­ters in a vari­ety of contexts.

The cal­cu­la­tions in this arti­cle can be eas­i­ly checked against the Csound instru­ment file "‑cs.chekAllCsound" includ­ed in the bp3-ctests-main.zip exam­ple set, which can be down­loaded from GitHub along with the Bol Processor BP3's inter­face: php-frontend-master.zip. See the Bol Processor ‘BP3’ and its PHP inter­face page for the instal­la­tion and testing.

All items can be pro­duced with the gram­mar "‑gr.checkAllCsound".

Let us start with a sim­ple example:

A4 G4 C5 A4

This pro­duces the fol­low­ing Csound score:

t 0.000 60.000
i2 0.000 1.000 440.00 90.000 0.000 0.000 0.000 ; A4
i2 1.000 1.000 392.00 90.000 0.000 0.000 0.000 ; G4
i2 2.000 1.000 523.25 90.000 0.000 0.000 0.000 ; C5
i2 3.000 1.000 440.00 90.000 0.000 0.000 0.000 ; A4
s

Instrument 2 is used because it's the one assigned to chan­nel 1 by default in the Csound instru­ment file "-cs.checkAllCsound".
This score will not pro­duce any sound with the default orches­tra file "default.orc" because it does not con­tain a def­i­n­i­tion for instru­ment 2.
Argument 4 is the pitch (in Herz) relat­ed to the dia­pa­son (fre­quen­cy of A4) set in "-se.checkAllCsound".
Argument 5 is the MIDI val­ue of the vol­ume, default 90 accord­ing to the set­tings.
Arguments 6 and 7 can be used for the 'blurb' para­me­ter (see infra).
Argument 8 is not not used, its val­ue remains 0.

No treat­ment of MIDI pitch­bend in instru­ment 2

Instrument 2 does not use the pitch­bend val­ue as a para­me­ter, but changes the pitch para­me­ter (in Hz) accord­ing­ly. In the fol­low­ing exam­ple, G4, which is 200 cents high­er, will be played 2 semi­tones high­er, at the same pitch as A4 (440 Hz).

_pitchrange(200) A4 _pitchbend(200) G4 _pitchbend(0) C5 A5

i2 0.000 1.000 440.00 90.000 0.000 0.000 0.000 ; A4
i2 1.000 1.000 440.00 90.000 0.000 0.000 0.000 ; G4
i2 2.000 1.000 523.25 90.000 0.000 0.000 0.000 ; C5
i2 3.000 1.000 880.00 90.000 0.000 0.000 0.000 ; A5

Volume map­ping in instru­ment 3

Now we will force the instru­ment to 3. Note that many new para­me­ters are dis­played.
The default vol­ume is 90 on the MIDI scale. This is con­vert­ed to 16.98 (log scale) using the vol­ume map­ping defined in instru­ment 3.
As instru­ment 3 accepts pitch­bend cor­rec­tions (argu­ments 5 and 6), pitch­bend = 16383 (+2 semi­tones) is applied to G4 instead of chang­ing its frequency.

_ins(3) _pitchrange(200) A4 _pitchbend(200) G4 _pitchbend(0) C5 A5

i3 0.000 1.000 440.00 8191.500 8191.500 16.981 16.981 0.000 0.000 0.000 0.000 0.000 ; A4
i3 1.000 1.000 392.00 16383.000 16383.000 16.981 16.981 0.000 0.000 0.000 0.000 0.000 ; G4
i3 2.000 1.000 523.25 8191.500 8191.500 16.981 16.981 0.000 0.000 0.000 0.000 0.000 ; C5
i3 3.000 1.000 880.00 8191.500 8191.500 16.981 16.981 0.000 0.000 0.000 0.000 0.000 ; A5

Arguments 5 and 6 rep­re­sent the start and end val­ues of the pitch­bend. This makes it pos­si­ble to tell Csound to cal­cu­late a por­ta­men­to (see infra).

Mapping of mod­u­la­tion in instru­ment 3

Playing sim­ple notes on chan­nel 2 calls up instru­ment 3, which has vol­ume and mod­u­la­tion con­trol para­me­ters. Here the mod­u­la­tion range (0 to 12431) is mapped to 0 to 3035.097 (argu­ments 11 and 12).

chan(2) _modcont _mod(0) C4 D4__ E4 _mod(12431)

i3 0.000 1.000 261.63 8191.500 8191.500 16.981 16.981 0.000 0.000 0.000 607.019 0.000 ; C4
i3 1.000 3.000 293.66 8191.500 8191.500 16.981 16.981 0.000 0.000 607.019 2428.078 0.000 ; D4
i3 4.000 1.000 329.63 8191.500 8191.500 16.981 16.981 0.000 0.000 2428.078 3035.097 0.000 ; E4

Another way to do the same with­out tem­per­ing with chan­nels is to use instru­ment 3.

ins(3) _modcont _mod(0) C4 D4__ E4 _mod(12431)

Note that instru­ment spec­i­fi­ca­tions over­ride the assign­ments of The_default instru­ment, which are made on the basis of the MIDI chan­nel. For instance, in the fol­low­ing exam­ple, because of the _ins(1) state­ment, _chan(2) does not set the instru­ment index to 3, so _mod() is ignored:

ins(1) _chan(2) _modcont _mod(0) C4 D4__ E4 _mod(12431)

i1 0.000 1.000 8.00 90.000 90.000 0.000 0.000 0.000 0.000 ; C4
i1 1.000 3.000 8.02 90.000 90.000 0.000 0.000 0.000 0.000 ; D4
i1 4.000 1.000 8.04 90.000 90.000 0.000 0.000 0.000 0.000 ; E4

Polymetric struc­ture {C5 D5 E5 F5, G5 D5 C6}

Let us con­sid­er a poly­met­ric struc­ture in which the same note (D5) has two con­sec­u­tive NoteOn's.

In MIDI, a NoteOff is insert­ed before the sec­ond NoteOn of "D5". In Csound the same
instru­ment is called twice. In both ver­sions the break between suc­ces­sive occur­rences of "D5" is audible.

_ins(The_default) {_volume(30) C5 D5 E5 F5,_volume(20) G5 D5 C6}

i1 0.000 1.000 9.00 30.000 30.000 0.000 0.000 0.000 0.000 ; C5
i1 0.000 1.333 9.07 20.000 20.000 0.000 0.000 0.000 0.000 ; G5
i1 1.000 1.000 9.02 30.000 30.000 0.000 0.000 0.000 0.000 ; D5
i1 1.333 1.333 9.02 20.000 20.000 0.000 0.000 0.000 0.000 ; D5 striked again
i1 2.000 1.000 9.04 30.000 30.000 0.000 0.000 0.000 0.000 ; E5
i1 3.000 1.000 9.05 30.000 30.000 0.000 0.000 0.000 0.000 ; F5
i1 2.666 1.334 10.00 20.000 20.000 0.000 0.000 0.000 0.000 ; C6

Note that this exam­ple would sound strange with­out the vol­ume con­trols: we would get a silence dur­ing the time the two D5' are super­im­posed, sim­ply because they are sine waves with equal ampli­tudes and oppo­site phases!

Let us look at the same note played at dif­fer­ent vol­umes in step­wise vari­a­tions. Notice that instru­ment 3 is now spec­i­fied by its name "Harpsichord". (Don't look for it in an orches­tra file!)

_ins(Harpsichord) _volume(0) A4 _volume(32) A4 _volume(64) A4 _volume(80) A4_volume(127) A4

i3 0.000 1.000 440.00 8191.500 8191.500 -24.000 -24.000 0.000 0.000 0.000 0.000 0.000 ; A4
i3 1.000 1.000 440.00 8191.500 8191.500 -2.763 -2.763 0.000 0.000 0.000 0.000 0.000 ; A4
i3 2.000 1.000 440.00 8191.500 8191.500 0.000 0.000 0.000 0.000 0.000 0.000 0.000 ; A4
i3 3.000 1.000 440.00 8191.500 8191.500 13.204 13.204 0.000 0.000 0.000 0.000 0.000 ; A4
i3 4.000 1.000 440.00 8191.500 8191.500 24.000 24.000 0.000 0.000 0.000 0.000 0.000 ; A4

The fol­low­ing illus­tra­tion shows the vol­ume decreas­ing con­tin­u­ous­ly from 127 (i.e. +24 after map­ping) to 0 (i.e. -24 after map­ping). Instrument 3 has two para­me­ters (7 and 8) that take the start and end vol­umes respec­tive­ly, and these val­ues are inter­po­lat­ed by Csound (using scheme GEN07) to pro­duce a con­tin­u­ous change.

_ins(Harpsichord) _volumecont _volume(127) A4 _volume(0)

i3 0.000 1.000 440.00 8191.500 8191.500 24.000 -24.000 0.000 0.000 0.000 0.000 0.000 ; A4

Now we will look at sim­i­lar con­tin­u­ous changes over sev­er­al notes invok­ing the same instrument.

_ins(Harpsichord) _volumecont _volume(127) A4 G4 C5 A5 A4 G4 C5 A5 _volume(0)

i3 0.000 1.000 440.00 8191.500 8191.500 24.000 21.688 0.000 0.000 0.000 0.000 0.000 ; A4
i3 1.000 1.000 392.00 8191.500 8191.500 21.688 18.431 0.000 0.000 0.000 0.000 0.000 ; G4
i3 2.000 1.000 523.25 8191.500 8191.500 18.431 12.899 0.000 0.000 0.000 0.000 0.000 ; C5
i3 3.000 1.000 880.00 8191.500 8191.500 12.899 -0.031 0.000 0.000 0.000 0.000 0.000 ; A5
i3 4.000 1.000 440.00 8191.500 8191.500 -0.031 -1.179 0.000 0.000 0.000 0.000 0.000 ; A4
i3 5.000 1.000 392.00 8191.500 8191.500 -1.179 -2.794 0.000 0.000 0.000 0.000 0.000 ; G4
i3 6.000 1.000 523.25 8191.500 8191.500 -2.794 -5.547 0.000 0.000 0.000 0.000 0.000 ; C5
i3 7.000 1.000 880.00 8191.500 8191.500 -5.547 -24.000 0.000 0.000 0.000 0.000 0.000 ; A5

The same, but step by step:

_ins(Harpsichord) _volumestep _volume(127) A4 G4 C5 A5 A4 G4 C5 A5 _volume(0)

i3 0.000 1.000 440.00 8191.500 8191.500 24.000 24.000 0.000 0.000 0.000 0.000 0.000 ; A4
i3 1.000 1.000 392.00 8191.500 8191.500 21.688 21.688 0.000 0.000 0.000 0.000 0.000 ; G4
i3 2.000 1.000 523.25 8191.500 8191.500 18.431 18.431 0.000 0.000 0.000 0.000 0.000 ; C5
i3 3.000 1.000 880.00 8191.500 8191.500 12.899 12.899 0.000 0.000 0.000 0.000 0.000 ; A5
i3 4.000 1.000 440.00 8191.500 8191.500 -0.031 -0.031 0.000 0.000 0.000 0.000 0.000 ; A4
i3 5.000 1.000 392.00 8191.500 8191.500 -1.179 -1.179 0.000 0.000 0.000 0.000 0.000 ; G4
i3 6.000 1.000 523.25 8191.500 8191.500 -2.794 -2.794 0.000 0.000 0.000 0.000 0.000 ; C5
i3 7.000 1.000 880.00 8191.500 8191.500 -5.547 -5.547 0.000 0.000 0.000 0.000 0.000 ; A5

Changing the vol­ume con­tin­u­ous­ly on the first two notes, then the vol­ume stays unchanged:

_ins(Harpsichord) _volumecont _volume(127) A4 G4 _volume(10) C5 A5

i3 0.000 1.000 440.00 8191.500 8191.500 24.000 4.549 0.000 0.000 0.000 0.000 0.000 ; A4
i3 1.000 1.000 392.00 8191.500 8191.500 4.549 -7.372 0.000 0.000 0.000 0.000 0.000 ; G4
i3 2.000 1.000 523.25 8191.500 8191.500 -7.372 -7.372 0.000 0.000 0.000 0.000 0.000 ; C5
i3 3.000 1.000 880.00 8191.500 8191.500 -7.372 -7.372 0.000 0.000 0.000 0.000 0.000 ; A5

Continuous pitch­bend vari­a­tion over an entire phrase:

_ins(Harpsichord) _pitchcont _pitchbend(16383) A4 G4 C5 A5 A4 G4 C5 A5 _pitchbend(0)

i3 0.000 1.000 440.00 16383.000 14335.125 16.981 16.981 0.000 0.000 0.000 0.000 0.000 ; A4
i3 1.000 1.000 392.00 14335.125 12287.250 16.981 16.981 0.000 0.000 0.000 0.000 0.000 ; G4
i3 2.000 1.000 523.25 12287.250 10239.375 16.981 16.981 0.000 0.000 0.000 0.000 0.000 ; C5
i3 3.000 1.000 880.00 10239.375 8191.500 16.981 16.981 0.000 0.000 0.000 0.000 0.000 ; A5
i3 4.000 1.000 440.00 8191.500 6143.625 16.981 16.981 0.000 0.000 0.000 0.000 0.000 ; A4
i3 5.000 1.000 392.00 6143.625 4095.750 16.981 16.981 0.000 0.000 0.000 0.000 0.000 ; G4
i3 6.000 1.000 523.25 4095.750 2047.875 16.981 16.981 0.000 0.000 0.000 0.000 0.000 ; C5
i3 7.000 1.000 880.00 2047.875 0.000 16.981 16.981 0.000 0.000 0.000 0.000 0.000 ; A5

Here, pitch­bend and vol­ume vary simultaneously:

_ins(Harpsichord) _volumecont _volume(0) _pitchcont _pitchrange(200) _pitchbend(200) A4 G4 C5 A5 A4 G4 C5 A5 _pitchbend(-200) _volume(127)

i3 0.000 1.000 440.00 16383.000 14335.125 -24.000 -5.547 0.000 0.000 0.000 0.000 0.000 ; A4
i3 1.000 1.000 392.00 14335.125 12287.250 -5.547 -2.794 0.000 0.000 0.000 0.000 0.000 ; G4
i3 2.000 1.000 523.25 12287.250 10239.375 -2.794 -1.179 0.000 0.000 0.000 0.000 0.000 ; C5
i3 3.000 1.000 880.00 10239.375 8191.500 -1.179 -0.031 0.000 0.000 0.000 0.000 0.000 ; A5
i3 4.000 1.000 440.00 8191.500 6143.625 -0.031 12.899 0.000 0.000 0.000 0.000 0.000 ; A4
i3 5.000 1.000 392.00 6143.625 4095.750 12.899 18.431 0.000 0.000 0.000 0.000 0.000 ; G4
i3 6.000 1.000 523.25 4095.750 2047.875 18.431 21.688 0.000 0.000 0.000 0.000 0.000 ; C5
i3 7.000 1.000 880.00 2047.875 0.000 21.688 24.000 0.000 0.000 0.000 0.000 0.000 ; A5

So far we have seen how instru­ments inter­po­late between sin­gle start and end val­ues.
Instrument 1, here called "The_default", i.e. the one defined in "default.orc", is able to vary pitch­bend and vol­ume in a more sophis­ti­cat­ed way, using a func­tion table.

BP3 auto­mat­i­cal­ly cre­ates func­tion tables when required and when the instru­ment spec­i­fi­ca­tion (here "-cs.checkAllCsound") pro­vides slots (argu­ments) for enter­ing func­tion table indexes.

Let us look at a sim­ple exam­ple with pitch­bend. Both of the fol­low­ing nota­tions result in the same score.
You will hear the pro­duc­tion of this score with the demo orches­tra "default.orc". (Doesn't sound great!)

ins(The_default) _pitchcont _pitchbend(0) D4__ _pitchbend(16383) E4_ _pitchbend(0)__

ins(The_default) _pitchrange(200) _pitchcont _pitchbend(-200) D4__ pitchbend(+200) E4_ pitchbend(-200)__

i1 0.000 3.000 8.02 90.000 90.000 0.000 -200.000 200.000 0.000 ; D4
f101 3.000 256 -7 200.000 102 -200.000 154 -200.000
i1 3.000 5.000 8.04 90.000 90.000 0.000 200.000 -200.000 101.000 ; E4

Note that GENO7 is used. GENO8 (cubic spline inter­po­la­tion) could be con­sid­ered, but it has the dis­ad­van­tage of forc­ing the first deriv­a­tive to zero at the start and end points. GEN07 is also much faster.

Here, C4 needs a 4-point table, because of _pitchcont where­as D4 only needs lin­ear interpolation?

ins(1) _pitchrange(200) _pitchbend(0) _pitchcont C4_ _pitchbend(20) __ _pitchbend(165) __ D4 _ _ _ _pitchbend(150)

f101 0.000 256 -7 0.000 85 20.000 85 165.000 86 160.000
i1 0.000 6.000 8.00 90.000 90.000 0.000 0.000 160.000 101.000 ; C4
i1 6.000 4.000 8.02 90.000 90.000 0.000 160.000 150.000 0.000 ; D4

Here, the ini­tial por­ta­men­to on a silence '-' is only pro­vid­ed by the
MIDI out­put. Csound ignores silence:

ins(1) _pitchrange(200) _pitchbend(0) _pitchcont - ___ C4 ___ _pitchbend(200) __ D4 ___ _pitchbend(150)

f101 4.000 256 -7 100.000 170 200.000 86 183.333
i1 4.000 6.000 8.00 90.000 90.000 0.000 100.000 183.333 101.000 ; C4
i1 10.000 4.000 8.02 90.000 90.000 0.000 183.333 150.000 0.000 ; D4

ins(1) _pitchrange(200) _pitchbend(0) _pitchcont - _ _pitchbend(20) __ C4 ___ _pitchbend(200) __ D4 ___ _pitchbend(150)

f101 4.000 256 -7 80.000 170 200.000 86 183.333
i1 4.000 6.000 8.00 90.000 90.000 0.000 80.000 183.333 101.000 ; C4
i1 10.000 4.000 8.02 90.000 90.000 0.000 183.333 150.000 0.000 ; D4

ins(1) _pitchcont _pitchrange(200) _pitchbend(0) - ___ C4 ___ _pitchbend(200) __ D4 ___ _pitchbend(150

f101 4.000 256 -7 100.000 170 200.000 86 183.333
i1 4.000 6.000 8.00 90.000 90.000 0.000 100.000 183.333 101.000 ; C4
i1 10.000 4.000 8.02 90.000 90.000 0.000 183.333 150.000 0.000 ; D4

Here the sec­tion between brack­ets { } fol­lows an inde­pen­dent portamento

ins(1) _pitchcont _pitchrange(200) _pitchbend(0) - ___ {C4 ___ _pitchbend(200) __ } D4 ___ _pitchbend(150)

f101 4.000 256 -7 42.857 170 200.000 86 200.000
i1 4.000 6.000 8.00 90.000 90.000 0.000 42.857 200.000 101.000 ; C4
i1 10.000 4.000 8.02 90.000 90.000 0.000 107.143 150.000 0.000 ; D4

A poly­met­ric struc­ture. E4 retains the ini­tial pitch­bend val­ue of C4.

ins(1) _pitchcont _pitchrange(200) _pitchbend(0) - ___ {C4 ___ _ pitchbend(200) __ , E4} D4 ___ _pitchbend(150)

f101 4.000 256 -7 42.857 170 200.000 86 200.000
i1 4.000 6.000 8.00 90.000 90.000 0.000 42.857 200.000 101.000 ; C4
i1 4.000 6.000 8.04 90.000 90.000 0.000 42.857 107.143 0.000 ; E4
i1 10.000 4.000 8.02 90.000 90.000 0.000 107.143 150.000 0.000 ; D4

Here, E4 has its own inde­pen­dent move­ment, which would be impos­si­ble with MIDI.

ins(1) _pitchcont _pitchrange(200) _pitchbend(0) - ___ {C4 ___ _ pitchbend(200) __ ,E4_ _pitchbend(180) _ _pitchbend(60) _ } D4 ____ _pitchbend(150)

f101 4.000 256 -7 42.857 170 200.000 86 200.000
i1 4.000 6.000 8.00 90.000 90.000 0.000 42.857 200.000 101.000 ; C4
f102 4.000 256 -7 42.857 128 180.000 64 60.000 64 60.000
i1 4.000 6.000 8.04 90.000 90.000 0.000 42.857 60.000 102.000 ; E4
i1 10.000 4.000 8.02 90.000 90.000 0.000 107.143 150.000 0.000 ; D4

Don't for­get to set _pitchrange(200) on chan­nel 2, oth­er­wise _pitchbend(180) will be used as the MIDI val­ue (range 0..16383). Note again that chan­nel 2 will not call instru­ment 3 because instru­ment 1 has already been specified.

ins(1) _pitchcont _pitchrange(200) _pitchbend(0) - ___ {C4 ___ _ pitchbend(200) __ , _chan(2) _pitchrange(200) E4_ _pitchbend(180) __ } D4 ___ _pitchbend(150)

f101 4.000 256 -7 42.857 170 200.000 86 200.000
i1 4.000 6.000 8.00 90.000 90.000 0.000 42.857 200.000 101.000 ; C4
f102 4.000 256 -7 42.857 128 180.000 128 180.000
i1 4.000 6.000 8.04 90.000 90.000 0.000 42.857 180.000 102.000 ; E4
i1 10.000 4.000 8.02 90.000 90.000 0.000 107.143 150.000 0.000 ; D4

In the above exam­ple, if you for­get to set the instru­ment to 1, instru­ments will be assigned based on MIDI chan­nels. This results in:

pitch­cont _pitchrange(200) _pitchbend(0) - ___ {C4 ___ _ pitchbend(200) __ , _chan(2) _pitchrange(200) E4_ _pitchbend(180) __ } D4 ___ _pitchbend(150)

i2 4.000 6.000 268.18 90.000 0.000 0.000 0.000 ; C4
i3 4.000 6.000 329.63 9946.821 15563.850 16.981 16.981 0.000 0.000 0.000 0.000 0.000 ; E4
i2 10.000 4.000 312.41 90.000 0.000 0.000 0.000 ; D4

Let us now try an arbi­trary para­me­ter 'blurb' (which has no MIDI equiv­a­lent)
on the two instru­ments 'Harpsichord' and 'Flute'.

_ins(Harpsichord) _cont(blurb) _value(blurb,123.42) C4 D4 _ins(Flute) E4 F4 _value(blurb,-211) _step(blurb) G4 A4 _value(blurb,-34) _fixed(blurb) B4 C5

i3 0.000 1.000 261.63 8191.500 8191.500 16.981 16.981 123.420 39.815 0.000 0.000 0.000 ; C4
i3 1.000 1.000 293.66 8191.500 8191.500 16.981 16.981 39.815 -43.790 0.000 0.000 0.000 ; D4
i2 2.000 1.000 329.63 90.000 -43.790 -127.395 0.000 ; E4
i2 3.000 1.000 349.23 90.000 -127.395 -211.000 0.000 ; F4
i2 4.000 1.000 392.00 90.000 -211.000 -211.000 0.000 ; G4
i2 5.000 1.000 440.00 90.000 -122.500 -122.500 0.000 ; A4
i2 6.000 1.000 493.88 90.000 -34.000 -34.000 0.000 ; B4
i2 7.000 1.000 523.25 90.000 -34.000 -34.000 0.000 ; C5

Instrument "Flute" can han­dle func­tion tables for 'blurb'.

ins(Flute) _cont(blurb) _value(blurb,544.5) C4__ _value(blurb,120) __ _value(blurb,-37)___ _value(blurb,0)

f101 0.000 256 -7 544.500 96 120.000 64 -37.000 96 0.000
i2 0.000 8.000 261.63 90.000 544.500 0.000 101.000 ; C4

Note that if the 'arbi­trary' para­me­ter is called 'vol­ume', it will be MIDI vol­ume, here remapped to the range -24..+24

_ins(Harpsichord) _cont(volume) _value(volume,127) A4 B4 _value(volume,0)

i3 0.000 1.000 440.00 8191.500 8191.500 24.000 -0.031 0.000 0.000 0.000 0.000 0.000 ; A4
i3 1.000 1.000 493.88 8191.500 8191.500 -0.031 -24.000 0.000 0.000 0.000 0.000 0.000 ; B4

The same applies to 'pitch­bend', 'pres­sure', 'panoram­ic' and 'mod­u­la­tion' (all case sen­si­tive). In instru­ment 3, MIDI mod­u­la­tion is remapped to the range 0..4000.

_ins(Harpsichord) _cont(modulation) _value(modulation,0) A4 B4 C5 D5 _value(modulation,16383)

i3 0.000 1.000 440.00 8191.500 8191.500 16.981 16.981 0.000 0.000 0.000 1000.000 0.000 ; A4
i3 1.000 1.000 493.88 8191.500 8191.500 16.981 16.981 0.000 0.000 1000.000 2000.000 0.000 ; B4
i3 2.000 1.000 523.25 8191.500 8191.500 16.981 16.981 0.000 0.000 2000.000 3000.000 0.000 ; C5
i3 3.000 1.000 587.33 8191.500 8191.500 16.981 16.981 0.000 0.000 3000.000 4000.000 0.000 ; D5

Now the two have been combined:

_ins(Harpsichord) _cont(volume) _cont(modulation) _value(volume,127) _value(modulation,0) A4 B4 C5 D5 _value(volume,0) _value(modulation,16383)

i3 0.000 1.000 440.00 8191.500 8191.500 24.000 18.431 0.000 0.000 0.000 1000.000 0.000 ; A4
i3 1.000 1.000 493.88 8191.500 8191.500 18.431 -0.031 0.000 0.000 1000.000 2000.000 0.000 ; B4
i3 2.000 1.000 523.25 8191.500 8191.500 -0.031 -2.794 0.000 0.000 2000.000 3000.000 0.000 ; C5
i3 3.000 1.000 587.33 8191.500 8191.500 -2.794 -24.000 0.000 0.000 3000.000 4000.000 0.000 ; D5

Note that if the addi­tion­al para­me­ter is unknown to the instru­ment, it will sim­ply be ignored. No warn­ing will be giv­en. For example:

_ins(Harpsichord) _cont(gasp) _value(gasp,0) A4 B4 _value(gasp,1000)

i3 0.000 1.000 440.00 8191.500 8191.500 16.981 16.981 0.000 0.000 0.000 0.000 0.000 ; A4
i3 1.000 1.000 493.88 8191.500 8191.500 16.981 16.981 0.000 0.000 0.000 0.000 0.000 ; B4

The 'Splashmachine' instru­ment han­dles the 'splash' para­me­ter which is instruct­ed to cre­ate func­tion tables with GEN08 (cubic spline) instead of GEN07.

ins(Splashmachine) _cont(splash) _value(splash,544.5) C4__ _value(splash,120) __ _value(splash,-37)___ _value(splash,130)

f101 0.000 256 -8 544.500 96 120.000 64 -37.000 96 130.000
i4 0.000 8.000 8.00 90.000 90.000 0.000 0.000 0.000 0.000 544.500 130.000 101.000 ; C4

The same instru­ment also uses GENO8 for the pitchbend.

_ins(Splashmachine) _cont(pitchbend) _pitchrange(200) _value(pitchbend,120) C4__ _value(pitchbend,34) __ _value(pitchbend,55)___ _value(pitchbend,-160)

This can be writ­ten more simply:

_ins(Splashmachine) _cont(pitchbend) _pitchrange(200) _pitchbend(120) C4__ _pitchbend(34) __ _pitchbend(55)___ _pitchbend(-160)

f101 0.000 256 -8 120.000 96 34.000 64 55.000 96 -160.000
i4 0.000 8.000 8.00 90.000 90.000 0.000 120.000 -160.000 101.000 0.000 0.000 0.000 ; C4

All these exam­ples pro­duce iden­ti­cal results with BP2.9.8 and its cur­rent ver­sion BP3.

Want to know more? Read the page Csound objects!

Leave a Reply

Your email address will not be published. Required fields are marked *