The following is an example of successful combiination of Bol Processor and Csound. Both music creation software packages are still in development after four decades… Csound was originally written by Barry Vercoe at MIT in 1985, while Bol Processor dates back to 1981.
Short musical phrases were composed in 1995 by Srikumar Karaikudi Subramanian, an accomplished practitioner of Carnatic music with deep understanding of mathematics and physics — read his blog, PhD thesis (2013) and list of patents.
Listen to the result:
The making of this example requires a 33-millisecond waveform sample of Sarasvati vīna (vina-wave-table.aif) and a grammar (-gr.vina3) associated with a Csound instrument description (-cs.Vina). All this is handled by the Bol Processor in both BP2 and BP3 versions. This process produces a Csound score which Csound converts into a sound file using a Csound orchestra file (new-vina.orc).
The demo was initially developed on Bol Processor BP2, the standalone application still available for Mac computers. In October 2020, it was repeated on BP3, the multi-platform version, to check the validity of Csound procedures in the new environment.
The grammar
The grammar "-gr.vina3" is available with all the necessary ingredients in the example set bp3-ctests-main.zip shared on GitHub. Follow the instructions on the Bol Processor ‘BP3’ and its PHP interface page to install BP3 and learn its basic operation. Download and install Csound as instructed.
The grammar "-gr.vina3" is shown below.
This grammar is exemplary for its use of variables that represent "musical gestures" before their sound representation. For example, "Pull0", "Pull1" and "Pulll2" are different ways of pulling the string to raise its pitch. This is reflected by changing the value of a pitchbender, which is a MIDI standard and has been reproduced in the Csound orchestra.
Another gesture is named "slide", which is the movement from one fret to the next one. It also affects the frequency of the note, but in a discontinuous way, because the movement is a rapid change.
A more sophisticated model might include the strength of the plucking of a note, which could be mapped to a parameter similar to the velocity parameter in MIDI.
The Csound score
Once the grammar is open in the BP3/PHP interface environment, clicking on "Produce item(s)" will (by default) create a Csound score named "vina3.sco", as shown below.
Note that the first line of this score — table "f1" — contains the link to the sampled waveform "vina-wave-table.aiff" and the Csound orchestra file "new-vina.orc" located in the same folder. The value "1" in the fourth argument indicates that data from a sound file will be transferred into a function table (see documentation).
Lines starting with "i1" are note instructions submitted to the instrument "vina" to produce notes 'C3', 'G3', 'F4' etc. The second and third arguments are the start time and duration respectively (see documentation). The fourth argument is the pitch, expressed as "octave.note": for example, "7.05" means the 7th note of octave 7, which is F3. The pitch could also be given in Herz with respect to 'A4' = 440Hz — see Csound tuning in BP3.
Instructions "f102", "f103" etc. describe tables used for the interpolation of pitchbend and "slide" parameters associated with the "vina" instrument. In the "slide" parameter settings, the table index is the 13th argument. In fact, the 13th parameter of the "i1" instructions contains "101", "103" etc. In each of these tables, the fourth argument indicates the GEN routine that Csound will use for its interpolation. The value "-7" means "GENO7" (linear interpolation) with no post-normalization (see documentation).
Instructions "f102", "f104" etc. are tables for interpolating pitchbender values. These are referenced in the 10th argument of "i1" events, as shown in the picture. We see that the range of MIDI values [0 .. 16383] is mapped to the [-500 .. +500] interval used by the Csound instrument, both being logarithmic scales. The central mapping of 8191.50 to 0 is used to construct this interpolation with a quadratic regression. See the Csound argument mapping page for a detailed explanation.
For example, in this event:
i1 4.750 0.656 7.07 90.000 90.000 0.000 0.000 100.000 104.000 0.000 0.000 105.000 ; G3
table "f104" (10th argument) is invoked to interpolate pitchbend values between 0.000 and 100.000 (the 8th and 9th arguments). In event:
i1 21.000 1.000 7.05 90.000 90.000 0.000 0.000 0.000 0.000 0.000 201.000 117.000 ; F3
table "f117" (13th argument) is used to interpolate the "slide" parameter between 0.000 and 201.000 (the 11th and 13th arguments). However, in the orchestra file "new-vina.orc", this parameter is not treated as continuous because it represents a quick move from one fret to the next. Therefore, the _cont(slide) instruction is irrelevant for this version of the grammar. It could be deleted or replaced by _step(slide).
Making the sound file
Open a Unix console and go to the folder containing "vina3.sco" and "new-vina.orc".
Type :
csound -o Vina3.aif new-vina.orc out.sco
If the operation is successful — as confirmed by messages on the console — the desired sound file "Vina3.aif" has been created.
WAV format, 24-bit resolution etc. are also available with Csound. Just type "csound" to see some options, or "csound --help" to see the full list.
By default, Csound displays messages that mimic the graphical representation of all tables used in the score. This option can be turned off.
This whole process of converting a Csound score into a sound file has been made automatic on the Bol Processor BP3 interface. If Csound is installed and responding, it will be called to do the conversion. The sound file it is instructed to create is in WAV format, because this format (unlike AIFF) is recognised by the
Microtonal intonation
An important feature of this example is the choice of a microtonal scale to replace the equal tempered 12 tone scale commonly used on electronic or modern keyboard instruments. The scale is defined in the tonal resource "-to.Vina" and is set by the instruction _scale(just intonation,0).
In BP3 it is possible to define microtonal scales and use them either in the MIDI or the Csound environment. (Read the MIDI microtonality page.) Csound uses function tables, which are automatically superimposed on the Csound score. For example, a "just intonation" scale can be defined as follows:
f2 0 128 -51 12 2 264 60 1 1.066 1.125 1.2 1.25 1.333 1.42 1.5 1.6 1.666 1.777 1.875
Numbers in red indicate frequency ratios. For example, the size of the fifth (C - G) is 1.333 = 4/3, which makes it "perfect". Listen to both interpretations in just intonation and equal temperament:
Discussion
This detailed interpretation of a musical phrase in Carnatic music was just an early demonstration of Bol Processor + Csound features. In 2013, Srikumar Karaikudi Subramanian submitted his PhD thesis to the National University of Singapore entitled Modeling Gamakās of Carnatic Music as a Synthesizer for Sparse Prescriptive Notation. He went on to develop the Pāṭāntarā system of high-quality Carnatic music notation.
Apart from using a sample of the real Sarasvati vīna sound to create the musical piece, is it worth using the Csound environment instead of MIDI on the Bol Processor? After all, any MIDI sampler could handle the waveform and produce the same sound as Csound…
We do not have a MIDI sampler to reproduce the sound of a Sarasvati vīna, but "-gr.vina3" can be played on a MIDI device, either in real time or via a MIDI file. The following is a rendering on PianoTeq:
Listening to this version, it is clear that the pitchbend instructions have been partially interpreted, while the "slide" parameter specific to the "vina" Csound instrument has been ignored. This confirms that Csound offers the possibility of enriching the description of any piece of music with performance parameters that do not belong to the standard MIDI categories: pitchbend, modulation, pressure, etc.
We have documented all the features of the Csound implementation on the Csound checkup and Csound objects page, showing examples that can be checked with BP3. More details on the handling of continuous parameters can be found on the page Continuous parameters in Csound scores.
A call for participation
We invite musicians who are familiar with Csound to create examples of the full use of Csound on Bol Processor. This will increase our confidence that none of the implemented Csound features are incomplete or erroneous.
➡ The development of Csound beyond our initial work on the subject (in 1995) is expected to stimulate new ideas for more advanced integration in future versions of BP3.