Csound tuning in BP3

This page deals with Bol Processor BP3 mak­ing use of an updat­ed ver­sion of Csound orches­tra file “default.orc”. Now, mod­i­fi­ca­tions of the dia­pa­son (‘A4’ fre­quen­cy) in the Settings have an influ­ence on the pro­duc­tion of Csound scores.

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

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 — read doc­u­men­ta­tion. In this case, the fre­quen­cy depends exclu­sive­ly on the dia­pa­son set up in the Csound orches­tra, or 440 Hz by default, mean­ing cpspch(8.09) = 440.

In order to “tune” the Csound instru­ment to the dia­pa­son cho­sen for the project in Bol Processor BP3, if the base fre­quen­cy is not exact­ly 440 Hz then 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. Orchestra file “default.orc” is able to decide which for­mat has been used because (1) no note is ever sent beyond the 14th octave and (2) fre­quen­cies are nev­er low­er than 15 Hz. Thus, 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

When 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 dis­plays actu­al fre­quen­cies of notes, for instance ‘A4’ = 435 Hz. This tonal sequence will sound slight­ly low­er than the pre­ced­ing one.

If the dia­pa­son is rad­i­cal­ly dif­fer­ent from 440 Hz, the names of notes will not dif­fer. Only fre­quen­cies will be mod­i­fied accord­ing­ly. See for instance the Csound score pro­duced 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 changes of dia­pa­son when deal­ing with Csound objects. Take for instance object “a” in “-gr.tryCsoundObjects”. The Csound score of its pro­to­type (as shown in “-mi.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 where­as 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 label­ing of notes is of minor impor­tance as it will be revised when cre­at­ing the per­for­mance Csound score.

When ‘A4’ = 440 Hz the Csound score of a per­for­mance of “a” reflects pre­cise­ly 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 spec­i­fied in the cps for­mat. The pitch­es of notes F0 and F1 would be mod­i­fied in the sound out­put. However, the pitch of instru­ment i3 would stay at 643.50 Hz as this had been set up in the sound-object’s pro­to­type. Consequently, giv­en the change of 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 picture).

Important…

This auto­mat­ic selec­tion of the pitch for­mat does not work when attempt­ing to send a fre­quen­cy low­er than 15 Hz, as it would be the case for ‘F0’ in the pre­ced­ing exam­ple if the dia­pa­son was set to 300 Hz. However this should nor­mal­ly nev­er hap­pen because 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 octave point pitch-class for­mat is very unlikely.

Changing middle C key number

“Middle C”, or ‘C4’ in the English con­ven­tion, des­ig­nates the key at 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 mod­i­fied in the settings.

For instance, set­ting ‘C4’ to key #48 results in all notes one octave (12 semi­tones) low­er on a MIDI device. However, this does not mod­i­fy the Csound sound out­put. Playing “A4 B4 C5″ with ‘C4’ dif­fer­ent from 60 pro­duces the same sound out­put and the same Csound score, yet 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 dif­fer­ent from 60 also does not change note names nor their actu­al fre­quen­cies, but the cps pitch for­mat is used. For instance, the per­for­mance of “a” yields 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 *