Csound tuning in BP3

This page deals with the Bol Processor BP3 using an updat­ed ver­sion of the Csound orches­tra file "default.orc". Changes to the dia­pa­son ('A4' fre­quen­cy) in the set­tings now affect the pro­duc­tion of Csound scores.

In the revised Csound orches­tra file, a few lines have been added to change the val­ue of icps (oscil­la­tor fre­quen­cy) accord­ing to that of the p4 argument:

if (p4 < 15.0) then
icps = cpspch(p4)
else icps = p4
endif

By default, this instru­ment receives the pitch val­ue (argu­ment p4) in the octave point pitch-class for­mat — see doc­u­men­ta­tion. In this case, the fre­quen­cy depends only on the dia­pa­son set up in the Csound orches­tra, or 440 Hz by default, i.e. cpspch(8.09) = 440.

To "tune" the Csound instru­ment to the dia­pa­son select­ed for the project in the Bol Processor BP3, if the base fre­quen­cy is not exact­ly 440 Hz, p4 will con­tain the actu­al fre­quen­cy of the note (cps for­mat) instead of its octave point pitch-class val­ue. The orches­tra file "default.orc" can decide which for­mat is used because (1) no note is ever sent above the 14th octave and (2) fre­quen­cies are nev­er low­er than 15 Hz. So, the val­ue of p4 auto­mat­i­cal­ly makes the deci­sion in "default.orc".

Let us try for example:

S --> A4 B4 C5

If the dia­pa­son is 440 Hz, we get the stan­dard Csound score output:

i1 0.000 1.000 8.09 90.000 90.000 0.000 0.000 0.000 0.000 ; A4
i1 1.000 1.000 8.11 90.000 90.000 0.000 0.000 0.000 0.000 ; B4
i1 2.000 1.000 9.00 90.000 90.000 0.000 0.000 0.000 0.000 ; C5

On the first line, 'A4' is set to 8.09 in the octave point pitch-class format.

Once we set the dia­pa­son to 435 Hz the Csound score will become:

i1 0.000 1.000 435.00 90.000 90.000 0.000 0.000 0.000 0.000 ; A4
i1 1.000 1.000 488.27 90.000 90.000 0.000 0.000 0.000 0.000 ; B4
i1 2.000 1.000 517.31 90.000 90.000 0.000 0.000 0.000 0.000 ; C5

This score shows the actu­al fre­quen­cies of the notes, for exam­ple 'A4' = 435 Hz. This sequence of notes will sound slight­ly low­er than the pre­vi­ous one.

If the dia­pa­son is rad­i­cal­ly dif­fer­ent from 440 Hz, the names of the notes will not change. Only the fre­quen­cies will be change accord­ing­ly. See for exam­ple the Csound score cre­at­ed with 'A4' = 300 Hz:

i1 0.000 1.000 300.00 90.000 90.000 0.000 0.000 0.000 0.000 ; A4
i1 1.000 1.000 336.74 90.000 90.000 0.000 0.000 0.000 0.000 ; B4
i1 2.000 1.000 356.76 90.000 90.000 0.000 0.000 0.000 0.000 ; C5

Let us now exam­ine the changes in dia­pa­son when deal­ing with Csound objects. Take for exam­ple the object "a" in "-gr.tryCsoundObjects". The Csound score of its pro­to­type (as shown in "-so.tryCsoundObjects") is a mix of 3 instruments:

t 0 120
i1 0 0.5 4.05 ; F0
i2 1.5 0.5 5.05 ; F1
i3 1.5 0.2 643.5 1 ; D#5
e

Instruments i1 and i2 use the octave point pitch-class for­mat, while instru­ment i3 uses the direct cps for­mat. This score has been cre­at­ed with 'A4' = 440 Hz which explains why 643.5 Hz is labelled D#5. The labelling of the notes is of minor impor­tance as it will be revised when the per­for­mance Csound score is created.

When 'A4' = 440 Hz the Csound score of a per­for­mance of "a" exact­ly reflects the score in its prototype:

t 0.000 60.000
i1 0.000 0.250 4.05 90.000 90.000 0.000 0.000 0.000 0.000 ; F0
i2 0.750 0.250 5.05 0.000 0.000 90.000 90.000 0.000 0.000 0.000 ; F1
i3 0.750 0.100 643.50 1.000 ; D#5
s
e

If the dia­pa­son is set to 500 Hz the Csound score of the per­for­mance will be:

t 0.000 60.000
i1 0.000 0.250 24.80 90.000 90.000 0.000 0.000 0.000 0.000 ; F0
i2 0.750 0.250 49.61 0.000 0.000 90.000 90.000 0.000 0.000 0.000 ; F1
i3 0.750 0.100 643.50 1.000 ; C#5
s
e

Pianorolls with A4 = 440 Hz (left) and 500 Hz (right)

All pitch­es are now giv­en in the cps for­mat. The pitch­es of notes F0 and F1 would be changed in the sound out­put. However, the pitch of instru­ment i3 would remain at 643.50 Hz as set in the sound-object's pro­to­type. As a result of the change in ref­er­ence, the name of the note pro­duced by i3 would now be 'C#5'. This change is reflect­ed in the pianorolls (see image).

Important…

This auto­mat­ic the pitch for­mat selec­tion does not work if you try to send a fre­quen­cy low­er than 15 Hz, as it would be the case for 'F0' in the pre­vi­ous exam­ple if the dia­pa­son was set to 300 Hz. This should nev­er hap­pen, how­ev­er, as 15 Hz is below the range of audi­ble sounds.

At the oppo­site end, octaves beyond 14 are way beyond the musi­cal range since 'C15' is already more than 535 KHz…

This might have an inci­dence on Csound scores being used for pro­duc­ing any­thing else than music, although in this case the use of the octave point pitch-class for­mat is very unlikely.

Changing middle C key number

"Middle C", or 'C4' in the English con­ven­tion, is the key in the mid­dle of a piano key­board. By con­ven­tion, its MIDI key num­ber is 60, but this val­ue can be changed in the settings.

For exam­ple, set­ting 'C4' to key #48 will cause all notes on a MIDI device to be one octave (12 semi­tones) low­er . This does not change the Csound sound out­put. Playing "A4 B4 C5" with 'C4' oth­er than 60 will pro­duce the same sound out­put and the same Csound score, but in the cps pitch format:

t 0.000 120.000
i1 0.000 1.000 440.00 90.000 90.000 0.000 0.000 0.000 0.000 ; A4
i1 1.000 1.000 493.88 90.000 90.000 0.000 0.000 0.000 0.000 ; B4
i1 2.000 1.000 523.25 90.000 90.000 0.000 0.000 0.000 0.000 ; C5
s
e

When applied to Csound objects, chang­ing 'C4' to a key num­ber oth­er than 60 will not change the note names or their actu­al fre­quen­cies, but it will use the cps pitch for­mat. For exam­ple, play­ing "a" will result in the fol­low­ing Csound score:

t 0.000 60.000
i1 0.000 0.250 21.83 90.000 90.000 0.000 0.000 0.000 0.000 ; F0
i2 0.750 0.250 43.65 0.000 0.000 90.000 90.000 0.000 0.000 0.000 ; F1
i3 0.750 0.100 643.50 1.000 ; D#5
s
e

Leave a Reply

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