Dear all,
I am delighted to announce the completion of dealing with Csound!
I programmed the loading of "-cs" Csound instrument files which wasn't
difficult because of similarity with "-mi" Sound-object prototypes.
But things went bad when errors showed up in the CsoundMaths.c file! The
regressions weren't working… In fact this was caused by the value of a
"very large number" indicating that a numeric field is empty. (Otherwise
it can be negative or positive…)
The "almost infinite" number used on the PHP interface is 2147483647 =
2^31 - 1. But on the console we were using Infpos which is calculated
with LONG_MIN, i.e. 9223372036854775807, indeed system dependent.
I feel relieved not going back to these regression calculations!
You can run an example with a command line such as:
../bp produce -gr ../ctests/-gr.tryCsound -se ../ctests/-se.tryCsound
-cs ../ctests/-cs.tryCsound -d --csoundout ../my_output/out.sco
--traceout trace.txt --seed 0
The item is:
_ins(3) _volumecont _volume(127) A4 G4 C5 A5 A4 G4 C5 A5 _volume(0)
The resulting score is:
t 0.000 60.000
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
It shows the effect of Csound instrument 3 (Harpsichord) which is
translating MIDI volume control (0 .. 127) to (-24 .. +24) on parameters
7 and 8 of each event. Because of _volumecont, the volume is also
changing gradually within each event. That's the great thing MIDI would
never achieve…
In addition, the mapping from MIDI value to Csound parameters is set by
a quadratic regression, given the points defined on instrument
"Harpsichord". Imagine that if the same is done with pitchbend any sort
of glissando can be designed. Srikumar Subramanian had started playing
with a melodic movement of the sarasvati veena.
I admit that the whole thing would not make sense with a harpsichord.
Names of instruments have been attributed arbitrarily ;-)
If you want to complete the experiment, set up the same volume mapping
on "Flute" (intrument 2), replace _ins(3) with _ins(2) in the grammar,
and… design a Csound orchestra able to play a flute with these
parameters! ;-)
Bernard
|