
Microtonality is a topic addressed by many musical systems dealing with tonal intervals: the use of microtones—intervals smaller than a semitone, also called “microintervals”. It may also be extended to include any music using intervals not found in the customary western tuning of twelve equal intervals per octave. In other words, a microtone may be thought of as a note that falls between the keys of a piano tuned in equal temperament (Wikipedia).
All examples shown on this page are available in the sample set bp3-ctests-main.zip shared via GitHub. Follow instructions on page Bol Processor ‘BP3’ and its PHP interface to install BP3 and learn its basic operation. Download and install Csound from its distribution page.
A brief presentation
On electronic instruments such as the Bol Processor associated with Csound, microtonality is the matter of “microtonal tuning”, here meaning the construction of musical scales alien to the conventional one(s).
Equal temperament is an intuitive model dividing the octave (frequency ratio 2/1) into 12 “equal” intervals called semitones. Each semitone is assigned a frequency ratio of 2 1/12 = 1.059. Tonal intervals are generally measured on a logarithmic scale by which ratio 2/1 is assigned 1200 cents. Thus, each semitone measures 100 cents in a conventional scale system.
An equal-tempered scale is convenient for making a piece of music sound identical when transposed to a different key. However, its intervals do not match the “natural” ones constructed from integer ratios using numbers 3, 4, 5. These simple ratios give an impression of consonance as the frequencies of upper partials (harmonics) may coincide: if two strings vibrate at a frequency ratio of 3/2 (a “perfect fifth”) then the 3d harmonic of the lowest vibration is at the same frequency as the 2nd harmonic of the sharper one.
In an equal-tempered scale, the harmonic major third (C - E) measuring 400 cents yields a ratio of 1.26 instead of 1.25 (5/4). The major fifth (C -G) also sounds slightly “out of tune” with a ratio of 1.498 instead of 1.5 (3/2). These mismatches may produce beats rated unpleasant in harmonic contexts.
When tuning stringed instruments (for instance the piano) octaves may be stretched a little to compensate a slight inharmonicity of upper partials produced by vibrating strings (in higher octaves) as advocated by Serge Cordier. A value of 1204 cents sounds fair, with the additional advantage of making fifths sound “perfect” at the ratio of 3/2. In this setting, the frequency ratio of stretched octaves is 2(1204/1200) = 2.0046. This effect can be reproduced in electronic instruments such as digital pianos imitating mechanical ones. We will see how to implement it in Bol Processor BP3 + Csound.
Musicologists agree that equal temperament has never been accurately achieved on classical instruments such as pipe organs and harpsichords. Instrument tuners rather designed rules to render the most pleasing intervals in specific musical contexts. In other words, a mechanical instrument should be tuned in compliance with a style and repertoire of music. Pierre-Yves Asselin (2000) published a detailed compilation of tuning techniques used by European musicians and instrument makers over the past centuries — listen to examples on page Comparing temperaments. The same flexibility can be achieved with sounds produced by “algorithms”.
Outside western classical music, a myriad of tonal systems are deliberately rejecting 12-tone-in-one-octave tonality. Arabic-Andalusian music is often described as a “quartertone” system dividing the octave in 24 intervals. Equal-tempered 7-grade scales have been identified on various traditional African instruments. The grama-murcchana theoretical model of tonal music in India claims the use of 22 shruti-s, presumably microintervals of unequal sizes (see below).
The scale() operator in Bol Processor BP3 + Csound
Csound scores are flexible in terms of representing tonal positions. A common convention is octave point pitch-class. For instance, note “A4” would be assigned tonal position “8.09”, which means that it is the 9th note in the 8th octave (in English convention). This value yields a note at the diapason frequency (usually 440 Hz) on a basic Csound instrument.
It is also possible to specify the note position by its frequency in cycles per second (cps mode). This allows a high accuracy since frequencies are expressed in floating point. In this format, “A4” would for instance be assigned “440.0”. Better than 1‰ accuracy is not perceptible.
As explained on page Csound tuning in BP3, it is possible to send to the same Csound instrument notes in octave point pitch-class and and cps format. Microtonal scales will indeed use exclusively cps. The cps mode is also activated on BP3 whenever the diapason frequency is not exactly 440 Hz. To render all frequencies visible, set it for instance to “400.01”…
Let us take a simple example to demonstrate the use of several scales. The grammar is:
-se.tryScales
-cs.tryScales
ORD
S --> _scale(0,0) C4 E4 A4 {8,{C4,E4,G4,C5}} {8,{C4,Eb4,G4,C5}} - _scale(piano,C4) C4 E4 A4 {8,{C4,E4,G4,C5}}{8,{C4,Eb4,G4,C5}} - _scale(just intonation,C4) C4 E4 A4 {8,{C4,E4,G4,C5}} {8,{C4,Eb4,G4,C5}}
In this grammar, the same sequence is repeated three times with different tunings:
- _scale(0,0) is the default tuning = twelve-tone equal-tempered
- _scale(piano, C4) is the one mentioned for the piano
- _scale(just intonation, C4) is a (so-called) “just-intonation” scale
Note “C4” appearing in these operators is the block key, here meaning the key that needs to match its equal-tempered value in the tuning adjusted by the scale.
It may be necessary to hear several times the sound rendering to grasp minute differences:
The sound is produced by Csound instrument “new-vina.orc” designed by Srikumar Karaikudi Subramanian to imitate the Sarasvati vina, a long-stringed instrument played in South India — listen to his demo: Sarasvati vina. This type of instrument is able to stress minute tonal subtleties.
Beats are audible on the equal-tempered version, yet a little less on the piano version and almost absent of the just-intonation rendering. Looking at the Csound score makes an easy check of theoretical models:
In the Csound score, note names have been automatically replaced with their translations in the definitions of scales piano and just intonation (see below). For instance, in the piano scale of this example, ‘C4’, ‘D4’, ‘E4’… have been replaced with ‘do3’, ‘re3’, ‘mi3’ and a marker ‘p’ has been inserted: ‘dop3’, ‘rep3’, ‘mip3’… Similarly, just intonation notes are labelled ‘Cj4’, ‘Dj4’, ‘Ej4’ etc. This renaming is optional since all these scales are made of 12 grades with identical key positions, but it is used here to make the Csound score more explicit.
The use of “C4” as a block key results in that it is always rendered at frequency 261.630 Hz. Consequently, “A4” is at 440 Hz in the first occurrence and a bit higher in the piano version due to the octave stretching with ratio 524.463 / 261.630 = 2.0046 = 1204 cents.
Finally, we notice that, as predicted by the model, the perfect major fifth (C - G) yields equal positions (392.445 Hz) in the piano and just intonation scales.
➡ In reality, the “just intonation” fragment in this example would be out of tune if we follow the framework of tonality suggested by Asselin (2000) and confirmed by an extension of the ancient grama-murcchana system in India. In the last “C minor” chord {C4,Eb4,G4,C5}, notes “C4”, “C5” and “G4” should be lowered by a syntonic comma. This means that playing just intonation in western harmony demands more than a single just-intonation scale: each harmonic context requires its own specific tuning, which indeed cannot be achieved on keyboard instruments. A method for building just-intonation scales and using them in Bol Processor music is exposed on page Just intonation: a general framework.
Looking at two scales
From the grammar page “-gr.tryScales” we can follow the Csound resource file “-cs.tryScales” containing scale and instrument definitions. The same file contains instruction
f1 0 256 1 “vina-wave-table.aiff” 0 4 0
telling the Csound instrument to use the “vina” waveform.
Below is a representation of the piano scale (Cordier’s equal temperament):

All intervals have been set in a single click after entering “1204” as the size of the octave in cents, which fixed the last ratio to 2.004 (approximated as 501/250). Then button “INTERPOLATE” was clicked to calculate intermediate ratios.
The scale is displayed as a circular graph clicking the “IMAGE” link:

The display confirms that the position of “G” (“solp”) is ratio 3/2 or 702 cents. However, the tonal distance between “G” (“solp”) and “D” (“rep”) is slightly smaller (699 cents), which means that this scale is not a pure cycle of fifths as the latter would have ended up, after 12 steps, with an octave stretched by one Pythagorean comma (scale “twelve_fifths” in “-cs.tryScales”):

The basekey is the key aimed at producing basefreq. Here basefreq is set to 261.630 Hz for key #60 which is usually the “middle C” on a piano keyboard. Parameter basefreq has an effect on the pitch which is further adjusted by the value of the diapason entered in “-se.tryScales”. If the diapason were set to 430 Hz, the frequency of “C4” would be 261.630 x 430 / 440 = 255.68 Hz.
Parameter baseoctave is not stored in the Csound function table, but it is required by Bol Processor to name notes properly. This scale uses the French note convention by which key #60 is named “do3” instead of “C4”. Therefore baseoctave = 3.
Temperament
At the bottom of the “Scale” page is a form for constructing scales in musical temperament. The range of this procedure is larger than usual because the interface makes it possible to modify any series of intervals, not only fifths and fourths.
Bol Processor procedures for the production of tempered scales (and all scales in general) may be used both for visualizing/hearing intervals and chords derived from a theoretical description of the scale, and for checking that a procedure for tuning mechanical instrument is compliant with its theoretical description. Below is an example of both approaches applied to Zarlino’s meantone temperament.
The long story of temperament in European music is exposed in Pierre-Yves Asselin’s thesis (2000 p. 139-150). During the 16th and 17th centuries, European musicians tended to prefer “pure” major thirds (frequency ratio 5/4) at the cost of compromising the size of fifths. This was named “pure third meantone temperament”, generally achieved by decreasing the size of certain fifths by a fraction of the syntonic comma. After this period there was another fashion of using perfect fifths (frequency ratio 3/2) and compromising the size of major thirds in the same way. Both options — and many more — are implemented on Bol Processor’s interface. Algorithmic tuning is indeed easier to achieve than the tuning of mechanical instruments!
Zarlino, theory
Let us try Zarlino’s meantone temperament (Asselin 2000 p. 85-87) which became popular in the 16th and 17th centuries. It is made of 12 fifths starting from “E♭” (“mi♭”) up to “G#” (“sol#”) diminished by 2/7 of a syntonic comma — that is 6 cents.
➡ This should not be confused with Zarlino’s “natural scale” which is an instance of just intonation.

In theory, this is achieved in two steps from the position of “C” which is known in advance.
First we enter the start note “do” and the sequence of fifths “do, sol, re…, sol#”, specifying ratios equal to 3/2 with a modification of -2/7 comma (see picture).

Then we do the same with fourths (descending fifths) starting from “do” (“C”) down to “mi♭” (“E♭”).
The result is shown by clicking the IMAGE link:


In this temperament, harmonic major thirds (green connections on the graph) are equal and slightly smaller (384 cents) than the “pure” ones (ratio 5/4 or 386 cents). Semitones between unaltered and altered notes are equal (71 cents). All major tones are equal (192 cents) except “do#-mi♭” and “sol#-sib” (242 cents).
Noticeable dissonance is found in the “sol#-mi♭” fifth (746 cents, i.e. an extra 2 + 1/7 commas = 44 cents) and major thirds such as “sol#-do”, “do#-fa”, “fa#-sib” and “si-mi♭” which are larger (433 cents) than Pythagorean major thirds (408 cents). Evidently, these intervals are not supposed to be used in the musical repertoire to which this tuning is applied…

Comparison
A lay person may wonder whether small tonal adjustments — often less than the quarter of a semitone — produce noticeable effects on the musical works using these tuning systems. Comparative experiments are easy on Bol Processor.
Let us for instance play one (among the billion variations) of Mozart’s musical dice game with tuning options selected by activating a first rule in “-gr.Mozart”:
// gram#1[1] S --> _vel(80)_tempo(3/4) _scale(0,0) A B // Equal temperament
// gram#1[2] S --> _vel(80) _tempo(3/4) _scale(piano,0) A B // Equal temperament (Cordier)
// gram#1[3] S --> _vel(80) _tempo(3/4) _scale(Zarlino_temp,0) A B // Zarlino’s temperament
// gram#1[4] S --> _vel(80) _tempo(3/4) Ajust Bjust // Just intonation
Musical productions are listed below. The random seed has been set to 998 (in “-se.Mozart”) as this variation contains a greater number of chords, and the performance has been slowed down by “_tempo(3/4)”.
It is important to remember that among these options only the first three ones (temperaments) are accessible to fixed-pitch instruments with 12-grade keyboards. The last one (just intonation) requires a “retuning” of each harmonic content — read page Just intonation: a general framework.
The first option (equal temperament) is the tuning by default of most electronic instruments:
The second option is an equal temperament with octaves stretched by 4 cents, as advocated by Serge Cordier (see above):
The third option is Zarlino’s temperament:
The last option is “just intonation”:
Zarlino: a simulation of physical tuning
Tuning mechanical instruments (such as a harpsichord) demands procedures different from the programming of “tempered” scales on Bol Processor. However, using the computer makes it possible to quickly verify that the mechanical procedure would yield the expected result. Let us demonstrate it with Zarlino’s temperament.
On the computer we had programmed a series of 7 ascending fifths diminished by 2/7 comma from“do” to “do#”. This is impossible to achieve “by ear” on a mechanical instrument. Pierre-Yves Asselin (2000 p. 86) revealed the method illustrated below.

1st step

From “do”, tune two successive major thirds. This produces a “sol#” positioned at frequency ratio 25/16 (773 cents) above “do”.
This “sol#” is actually “SOL#+2” of the 2nd-order harmonic fifths downward series in Asselin’s tuning framework (2000 p. 62) — read page Just intonation: a general framework. It is not exactly the one expected on Zarlino’s meantone temperament, although close to it. It will be labeled “sol2#”.

2nd step

From “sol2#” tune down a perfect fifth yielding “do#”.
Beware to program a perfect fifth specified as “add 0/1 comma” on the form. There is also a form for creating series of perfect fifths that can be used for this step.
The resulting “do#” (ratio 1.04166) is exactly 52/3/23, the one expected in Zarlino’s meantone temperament (Asselin 2000 p. 194).

3d step

Tune 7 equal fifths between “do” and “do#”. Equalizing fifths is a typical procedure for tuning mechanical instruments. A general procedure is available on Bol Processor to equalize intervals over a series of notes. Here we specify that these intervals should be close to fraction 3/2, even though we know that they will end up as fifths diminished by 2/7 comma.
Missing notes “sol, re ‚la, si, fa#” are created. For note “mi” which is already existing, the machine checks that its current position is close to the one predicted by the approximate fraction.
The graph reveals that the calculated position of “mi” (ratio 1.248) is slightly off its previous position (1.25) but this difference is negligible. We keep both positions on the graph, knowing that only one occurs on a physical tuning.

4th step
Now tune down 3 fifths diminished by 2/7 comma from “do” to “mi♭”. This can be done by reproducing “by ear” intervals created in the previous step. Another method is to tune “mi♭” one major third below “sol” as shown on the form.
5th step

Once “mi♭” has been tuned we can tune three equal (in fact diminished by 2/7 comma) fifths between “mi♭” and “do”. Again the “equalize intervals” procedure is used to this effect. At this stage, the positions of “si♭” and “fa” are created.
The result is shown on the following graph:

On this graph, ratio 1.563 for “sol#” is close (within 7 cents) to 1.557 of Zarlino’s temperament. On a mechanical instrument, since “mi” tuned by equalizing fifths (3d step) was at position 1.248, adjusting the “mi-sol#” major third to a 5/4 ratio would set “sol#” at a better ratio (1.56).
More temperaments
All temperaments listed in Asselin’s thesis can be easily programmed on the Bol Processor. Let us take for example a classical meantone tuning (Asselin 2000 p. 76) popular in the 16th-17th centuries, also known as Chaumont (Asselin 2000 p. 109) . It aimed at producing “pure thirds” (ration 5/4). It is made of a series of fifths from “mi♭” (“E♭”) to “sol#” (“G#”) diminished by 1/4 comma. The problem is that the tuning scheme — unlike Zarlino’s meantone — does not start from “do” (“C”). There are two solutions.
The first solution is to break the series of fifths in two parts: first create the “do, sol, re, la, mi, si, fa#, do#, sol#” series of ascending fifths, then the “do, fa, si♭, mi♭” series of descending fifths.

In the second solution we directly create the “mi♭, si♭, fa, do, sol, re, la, mi, si, fa#, do#, sol#” series of ascending fifths, yielding the graph shown below.

This tuning is correct but it cannot be used by the Bol Processor console because of the displacement of the reference. Complicated procedures would be required to set the diapason (A4 frequency) to the desired standard and assign proper key numbers to notes of the scale.

Fortunately, the problem is solved in a single click by reseting the base of the scale to note “do”, which amounts to a rotation of the graph.
We take this opportunity to replace the Italian/French with the English note convention.
The result is the classical meantone scale tuning which is remarkable for its large number of harmonic major thirds (circa 5/4):

The same methods can be used to implement another temperament popular at the same time (16th-17th c.) which aims at enhancing pure minor thirds (Asselin 2000 p. 83). It can also be described as a series of ascending fifths from “mi♭” to “sol#” with a different adjustment: fifths are diminished by 1/3 comma.
In this tuning, minor thirds are sized 316 cents (harmonic minor third, frequency ratio 6/5) with the exception of “A#-C#”, “D#-F#” and “F-G#” all sized 352 cents:


The BACH temperament designed by Johann Peter Kellner for 18th century music (Asselin 2000 p. 101-103) contains two varieties of fifths (see tuning scheme).
It can be programmed in 3 steps:
- A series of descending fifths from “do-sol-re-la-mi”, diminished by 1/5 comma;
- A series of ascending perfect fifths from “do” to “sol♭”;
- An ascending perfect fifth from “mi” to “si”.
The last interval is a remaining fifth “si-sol♭” (“B-G♭”) exactly diminished by 1/5 comma (i.e. 697 cents).
The result is close to Werkmeister III (1691) (Asselin 2000 p. 94) with all positions close to the Pythagorean/harmonic series used for just intonation.


Source: Asselin (2000 p. 96)
Procedures for tuning temperaments with the Bol Processor sometimes differ from the ones used for physical instruments. An example is Werckmeister IV (Asselin 2000 p. 96) and Werckmeister V (p. 99). To tune Werckmeister IV on a instrument (see picture), we start with the tuning of sequence G C F Bb Eb Ab Db Gb B E as perfect descending fifths. Then interpolate three fifths (diminished by 1/3 comma) between G and E. Then retune G so that G D becomes a perfect fifth, which reduces C G by 1/3 comma. The same is done on E so that A E becomes a perfect fifth and E B is diminished by 1/3 comma. Similar adjustments are done to retune Bb, and finally Ab and Db to reach intervals shown on the picture.
On Bol Processor the same procedure can be followed if the 1/3 comma correction is replaced with 7 cents. Another procedure amounts to “adding” intervals, which is acceptable on a digital model because of the accuracy. This procedure is automatically summarised at the bottom of the “scale” page:
Werckmeister IV temperament (Asselin 2000 p. 96)
Added fifths down: “do,fa” starting fraction 1/1
Created meantone downward notes “fa,sib” fraction 3/2 adjusted -1/3 comma
Created meantone downward notes “sib,mib,sol#” fraction 3/2 adjusted 1/3 comma
Created meantone downward notes “sol#,do#” fraction 3/2
Created meantone downward notes “do#,fa#” fraction 3/2 adjusted -1/3 comma
Created meantone downward notes “fa#,si” fraction 3/2
Created meantone downward notes “si,mi” fraction 3/2 adjusted -1/3 comma
Created meantone downward notes “mi,la” fraction 3/2
Created meantone upward notes “do,sol” fraction 3/2 adjusted -1/3 comma
Created meantone upward notes “sol,re” fraction 3/2

Let us compare a few temperaments on ascending unaltered and descending altered scales…
Eighteen temperaments described by Pierre-Yves Asselin (2000) have been programmed in the “-cs.trTunings” Csound resource. These can be checked against diverse musical works, read pages Comparing temperaments and Tonal analysis of musical works.
As Schlick’s temperament was not fully documented, we set up “do-la♭” as a pure major third and “mi-sol#” as a major third increased by 2/3 comma. Consequently, “sol#” and “la♭” remain distinct.

Implementations of temperaments in the Bol Processor may be taken as reference because (1) errors might have occurred and (2) it is important to know for which musical repertoire each temperament has been designed. Also read in detail chapter VIII Musique et tempéraments (Asselin 2000 p. 139-180) exposing the history of temperament along with musical examples discussed in terms of instrument tuning.

Circular graphs display noticeable intervals — perfect fifths, wolf fifths, harmonic and Pythagorean major thirds — in a broad range of incertitude. For example, in the Tartini-Vallotti temperament shown above, “C-E” is listed as a harmonic major third (green segment) although it is a little larger (+7 cents) than a “pure” major third (ratio 5/4). The safe procedure for checking the compliance of this tuning with its description is to read deviations in the interval list (see picture).

In a few temperaments, the sizes of fifths are not explicitly given as the instrument tuner is instructed to tune slightly larger (than perfect) or slightly smaller fifths. This is the case with D’Alembert-Rousseau temperament (Asselin 2000 p. 119) in which the series “do, fa, sib, mi♭, sol#” is expected to be slightly larger and “sol#, do#, fa#, si, mi” slightly smaller… In addition, the framework should be “complete”, which implies the absence of a left-over fraction of comma when closing the cycle of fifths.
In this example, conditions were met increasing by 1/12 comma (+2 cents) the slightly larger fifths “do, fa, sib, mi♭, sol#”. To close the cycle appropriately, the last series “sol#, do#, fa#, si, mi” was declared as equalized intervals. This resulted in slightly smaller fifths diminished by 2 cents reflecting the slightly larger ones. Incidently, this adjustment of -1/12 comma is also the one required for constructing an equal-tempered scale.
The entire process of building scales is automatically recorded in the Comments area of the “scale” page, for instance “d_alembert_rousseau”:
D’Alembert-Rousseau temperament (Asselin 2000 p. 119)
Created meantone upward notes “do,sol,re,la,mi” fraction 3/2 adjusted -1/4 comma
Created meantone downward notes “do,fa,sib,mib,sol#” fraction 3/2 adjusted 1/12 comma
Equalized intervals over series “sol#,do#,fa#,si,mi” approx fraction 2/3 adjusted 2.2 cents to ratio = 0.668
It took us about 8 minutes to understand the procedure and another 8 minutes to tune the scale as per D’Alembert-Rousseau…
A comparison of temperaments applied to several pieces of Baroque music is available on page Comparing temperaments.
The whole set of tuning schemes currently implemented on Bol Processor is represented on this page : https://bolprocessor.org/misc/figs/list-scales.php
More than 12 grades
We will use a model of ancient Indian musicology to demonstrate divisions of more than 12 grades per octave. This model is an interpretation of the description of basic scales (grama) and their transpositions (murcchana) in Bharata Muni’s Natya Shastra, a treatise dating back to a period between 400 BCE and 200 CE — read page The two-vina experiment.

The grama-murcchana model and its application to western harmony are described on page Just intonation: a general framework. Its application to Hindustani music is presented on page Raga intonation.
E.J. Arnold (1982) had designed a device for demonstrating the transposition of scales in Bharata’s model. The actual division of the octave is 23 steps, yet this amounts to having 22 optional positions (shruti-s) given that the base note has only one option.
The result may be described as 11 pairs of note positions yielding 211 = 2048 possible chromatic scales. Among these, only 12 are “optimally consonant”, i.e. with only one “incorrect” major fifth (short by 1 syntonic comma = 22 cents). These 12 scales are the ones that may be used in harmonic or modal music to experience the best consonance.
Below is an image of the “grama” scale as displayed by the editor of BP3:

In this scale we use the Indian sargam conventional notation: sa, re, ga, ma , pa, dha, ni, translated as “C”, “D”, “E”, “F”, “G”, “A”, “B”. Note “re” (“D”), for instance, may be found at four positions: r1 and r2 are the two options for “D♭”, the first one (256/243) being called “Pythagorean” (derived from five descending fifths) and the second one (16/15) “harmonic” (derived from a descending fifth and a descending major third). Positions r2 and r3 are “D♮” (natural) with r3 harmonic (10/9) and r4 Pythagorean (9/8).

(manufactured in Miraj)
There are particular cases (visible on the wheel model) as m3 is almost superposed with p1 and m4 with p2, their difference being an inaudible schisma (32805 / 32768 = 1.00112 = 1.9 cents). We use m3p1 and m4p2 to designate these merged positions.
Intervals displayed in cents are the ones identified by western musicologists: the Pythagorean limma (256/243 = 90 cents), the syntonic comma (81/80 = 22 cents) and the minor semitone (25/24 = 70 cents). This reveals that a shruti as described by Bharata may be of 3 different sizes. However, in its application to Indian music, this model should be rendered “flexible” with a measure of the syntonic comma (pramāņa ṣruti) between 0 and 56.8 cents — read page The two-vina experiment.
Clicking the IMAGE link yields a circular graphic representation of the “grama” scale:

Let us play a diatonic scale following the grama-murcchana model, an occurrence of western just-intonation scales and the piano stretched-octave tuning, again with “C4” (or “sa_4”) as the block key. The grammar is named “-gr.tryShruti”:
S --> _tempo(2) _scale(grama, sa_4) sa_4 r4_4 g3_4 m1_4 p4_4 d3_4 n3_4 sa_5 _scale(just intonation, C4) C4 D4 E4 F4 G4 A4 B4 C5 _scale(piano, C4) do4 re4 mi4 fa4 sol4 la4 si4 do5
Differences are hardly noticeable for a simple reason: the first two ones are identical since this just intonation scale is a particular instance of grama-murcchana, whereas the piano scale is a fair approximation of the former ones. This is clear in the following Csound score:
Let us now listen to the 22 shrutis against a drone (“C” and “G” translated as sa and p4):
S --> scale(grama,sa_4) {9 Full_scale _ _ _ , Drone} - - tempo(3/4) {_retro Full_scale} _ _ _
Full_scale --> sa_4 r1_4 r2_4 r3_4 r4_4 g1_4 g2_4 g3_4 g4_4 m1_4 m2_4 m3p1_4 m4p2_4 p3_4 p4_4 d1_4 d2_4 d3_4 d4_4 n1_4 n2_4 n3_4 n4_4 sa_5
Drone --> _volume(30) Droneseq Droneseq Droneseq Droneseq Droneseq Droneseq Droneseq Droneseq
Droneseq --> {_legato(300) p4_3 sa_4 sa_4 sa_3}

Note the usage of the _retro performance tool to reverse the order of the Full_scale sequence. The _legato(300) instruction extends the duration of notes up to 3 times their current duration. This produces a Droneseq sound structure akin to that of the Indian tanpura.
In the sound rendering of this example, a 279 Hz sample waveform of a Miraj tanpura has been used to feed the Karplus-Strong algorithm.
Listening to this sequence makes it clear that treating a sequence of shrutis as a “scale” is iconoclastic to the aesthetics of Hindustani music: most of these notes sound out of tune when played in reference to a drone (the tanpura). As discussed on page The two-vina experiment, the presence of a drone makes it unlikely that mutual consonance in melodic intervals always prevails over consonance with the drone’s upper partials. If the grama-murcchana system is of any relevance to the performance of classical ragas — read page Raga intonation — at least the model should be rendered flexible to meet the proper intonation in melodic movements.
Comparing scales

A device for the comparison of scales is available on the Csound resource page. Click COMPARE TONAL SCALES and select the ones that need to be analysed.
Scales are compared 2 by 2, so that a set of n scales will yield n2/2 results displayed in tables. The following is a comparison of scales named Amin, Cmaj and equal_tempered. The first two ones are described on page Just intonation: a general framework.

All comparisons deal with 12-grade (chromatic) scales, measuring the sizes of perfect fifths — some of which may be wolf fifths as explained above. The average difference of fifths is done by summing the squares of differences between the sizes of fifths of identical grades (measured in cents):
\[D=\ \sqrt{\frac{\sum_{^{i=1}}^{12}\left(fa_i\ -\ fb_i\right)^2}{12}}\]
The distance between Amin and Cmaj is 8.9 cents and the distance between each of these scales and the equal-tempered one is close to 6 cents.
The second table is the result of a search for the smallest distance when transposing one of the scales by 1 to 11 semitones. Here we notice that Amin (see image) and Cmaj (see image) are practically equivalent — being harmonically related — as the difference goes down to 1.2 cents. The best-matching version of Cmaj is constructed by transposing Amin one fifth up (7 semitones), therefore moving ‘C’ to ‘G’. Read Creation of just-intonation scales for details of this procedure.
This device may be further developed to produce a classification of selected tonal scales highlighting similar/identical tuning schemes.
Another approach of tonal scale comparison is the measurement of matchings between a musical work and the whole set of documented tuning procedures: read page Tonal analysis of musical works.
The syntactic model

The following are guidelines for a correct and useful implementation of microtonal scales in BP3. We follow simple sequences listed in “-gr.tryOneScale”. This grammar is linked with “-cs.tryOneScale” hosting a unique scale just intonation with its notes labelled “Cj”, “Cj#”, “Dj” etc. In “-se.tryOneScale”, the Note convention has been set to 0 (English), the ‘C4’ key number to 60 and the Default block key to 60. All these parameters are important to reproduce the same effects.
Rule #1: If only 1 microtonal scale is loaded with the grammar, it is used by default in all productions.
Example: Let us play:
S --> C4 A4 G4
It produces the following Csound score:
i1 0.000 1.000 261.630 90.000 90.000 0.000 0.000 0.000 0.000 ; Cj4
i1 1.000 1.000 436.137 90.000 90.000 0.000 0.000 0.000 0.000 ; Aj4
i1 2.000 1.000 392.445 90.000 90.000 0.000 0.000 0.000 0.000 ; Gj4
The display of “Cj4” etc. makes it clear that just intonation has been used. This is further confirmed by ratio 436.137/261.630 = 1.666 = 5/3.
Why not use note labels “Cj4”, “Aj“ ‘ and “Gj4” in the grammar? This will only work if the scale is specified, for instance:
S --> _scale(just intonation, Cj4) Cj4 Aj4 Gj4
This will yield the same Csound score because the block key is “Cj4” rated to 261.630 Hz in the scale definition. Using “Aj4” as the block key would yield:
S --> _scale(just intonation, Aj4) Cj4 Aj4 Gj4
and a sightly different Csound score:
i1 0.000 1.000 263.952 90.000 90.000 0.000 0.000 0.000 0.000 ; Cj4
i1 1.000 1.000 440.007 90.000 90.000 0.000 0.000 0.000 0.000 ; Aj4
i1 2.000 1.000 395.928 90.000 90.000 0.000 0.000 0.000 0.000 ; Gj4
Here, “Aj4” has been set to 440 Hz which is the diapason frequency in “-se.tryOneScale”. Ratios are unchanged, for instance 440.007/263.952 = 5/3.
How can we play equal-tempered intervals using this grammar? This is achieved by specifying the default scale: _scale(0,0):
S --> _scale(0,0) C4 A4 G4
yielding the following Csound score:
i1 0.000 1.000 8.00 90.000 90.000 0.000 0.000 0.000 0.000 ; C4
i1 1.000 1.000 8.09 90.000 90.000 0.000 0.000 0.000 0.000 ; A4
i1 2.000 1.000 8.07 90.000 90.000 0.000 0.000 0.000 0.000 ; G4
Frequencies are not explicit because the default Csound score format uses the octave point pitch-class representation, for instance “A4” is the 9th pitch-class or the 8th octave (on a standard MIDI instrument). To make them explicit, just set the diapason to a tiny different value in “-se.tryOneScale”, for instance 440.0001 Hz. This will produce:
i1 0.000 1.000 261.626 90.000 90.000 0.000 0.000 0.000 0.000 ; C4
i1 1.000 1.000 440.000 90.000 90.000 0.000 0.000 0.000 0.000 ; A4
i1 2.000 1.000 391.996 90.000 90.000 0.000 0.000 0.000 0.000 ; G4
We could expect 261.630 Hz for the frequency of “C4” but the 261.626 Hz value differs due to rounding. The ratio of the difference is 261.630/261.626 = 1.000015 = 0.026 cents!
Rule #2: When parsing a sequence of notes, if a microtonal scale has been specified the parser first attempts to match the note against labels in the current microtonal scale. In case no matching exists, it will try to interpret it as per the Note convention specified in settings.
For instance:
S --> _scale(just intonation, Cj4) Cj4 Aj4 Gj4 D4 F4 E4

Notes in sequence “D4 F4 E4” will be translated to matching positions in the just intonation scale. The result is visible on the Csound score as well as on the graphic display.
This practice is only relevant to 12-grade tonal scales in which positions are equivalent — although with slightly differing frequency ratios. Since the matching is based on key numbers, for instance feeding the “grama” (23-grade) microtonal scale (see above) with “C4 D4 E4” would produce “sa_4 r2_4 r4_4″ in which r2_4 is close to “C#4” and r4_4 almost “D4”. This makes sense because the key sequence is 60-62-64. There is currently no generic way of mapping note positions in scales with different divisions. An additional difficulty would be scales in which the interval is different from 2/1.
We will show later that rule #2 provides a flexibility that makes it very easy to insert enharmonic corrections in a musical score by selecting one among 12 just-intonation chromatic scales — read page Just intonation: a general framework.
Rule #3: If the parser fails to identify a note in the current microtonal scale and against the note convention, it will try other microtonal scales previously loaded in the sequence.

This can be demonstrated in “-gr.tryScales”. On top of the grammar are listed the scales that will be sent to the console along with the grammar and instructions. Each scale becomes “active” in the grammar once a _scale() operator has declared it.
Let us try to produce:
S --> _scale(piano,dop4) fap3 _scale(just intonation,69) C4 rep4
Active scales are piano, then just intonation. There are no problems with note “fap3” belonging to the piano scale, nor with “C4” which is known in the English note convention. As predicted by rule #2, note “C4” will be translated to its equivalent “Cj4” and performed in just intonation.
Since the baseoctave of scale piano is 3 (see image above), the pitch of “fap3” will be close to that of “F4”.
What will happen to note “rep4”? If scale piano had not been activated, this note would be rejected as a syntax error. However, following rule #3, the parser finds it in the piano scale. This yields key number 74 since baseoctave = 3.

The note will be interpreted as key #74 in the just intonation scale, displayed as “Dj5”. This is visible in the Csound score below and on the graphic.
i1 0.000 1.000 349.538 90.000 90.000 0.000 0.000 0.000 0.000 ; fap3
i1 1.000 1.000 263.952 90.000 90.000 0.000 0.000 0.000 0.000 ; Cj4
i1 2.000 1.000 593.891 90.000 90.000 0.000 0.000 0.000 0.000 ; Dj5
Consequently, notes found in a sequence are always interpreted as belonging to the scale declared at the immediate left, even if their label belongs to another scale or to the note convention.
Therefore, it is not a good idea to mix notes belonging to different scales without declaring the scale prior to their occurrence. A “_scale()” declaration will best be placed in the beginning of each sequence, notably at the beginning of the right argument of a rule.
References
Arnold, E.J. A Mathematical model of the Shruti-Swara-Grama-Murcchana-Jati System. Journal of the Sangit Natak Akademi, New Delhi 1982.
Asselin, P.-Y. Musique et tempérament. Paris, 1985, republished in 2000: Jobert. Soon available in English.