Bernard Bel

Note interne, *Groupe Représentation et Traitement des Connaissances* (CNRS), Marseille 1988.

Skip to content
# Author: Bernard Bel

## A Mathematical Discussion of the Ancient Theory of Scales according to Natyashastra

## A Mathematical Model of the Shruti-Swara-Grama-Murcchana-Jati System

## Melodic types of Hindustan

## Musicology

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 outside the conventional one(s) …

Read More
A framework for constructing scales (tuning systems) referring to just intonation in both classical Indian and Western approaches …

Read More
A comprehensive interpretation of the experiment of the two vinas described in Chapter XXVIII.24 of the Natya Shastra …

Read More
A scan of Arnold, E.J. A Mathematical model of the Shruti-Swara-Grama-Murcchana-Jati System …

Read More
Bernard Bel Note interne, *Groupe Représentation et Traitement des Connaissances* (CNRS), Marseille 1988. Download this paper …

Read More
This article demonstrates the theoretical and practical construction of microtonal scales for the intonation of North Indian ragas …

Read More
A framework for tuning just-intonation scales via two series of fifths For more than twenty centuries, musicians, instrument makers and …

Read More
Images of tempered scales created by the Bol Processor The following are *Bol Processor + Csound* interpretations of J.-S. Bach’s …

Read More
Bernard Bel A contribution to **The Ratio Symposium**, 14-16 Dec. 1992, Den Haag (The Netherlands). Published in Barlow, Clarence (ed.) …

Read More
This paper deals with the scheduling of “sound-objects”, hereby meaning predefined sequences of elementary tasks in a sound processor, with each task mapped to a time-point …

Read More
Bol Processor grammars are characterisations of sequential events in terms of substring repetitions, homomorphisms, etc. Parsing techniques, stochastic production and recent developments of BP grammars are briefly described …

Read More
A linguistic model of tabla improvisation and evaluation derived from pattern languages and formal grammars has been implemented in the Bol Processor, a software system used in interactive fieldwork with expert musicians …

Read More
## The two-vina experiment

## The historical context

## The experiment

### First lowering

### Second lowering

### Third lowering

### Fourth lowering

## Algebraic interpretation

## Extensions of the model

## The relevance of circular representations

## Return to epistemology

## References

## Just intonation: a general framework

## Historical background

### The “Greek” approach

### The Indian approach

## Extending the Indian model to western harmony

### Tuning western instruments

### The *grama* framework

### Producing the 12 chromatic scales

### Enharmonic shift of the tonic

## Checking the tuning system

### Checking a chord sequence

### Checking note sequences

### Scale comparison

## Is this perfect?

## Overture

## References

## Microtonality

## A brief presentation

## The **scale()** operator in Bol Processor BP3 + Csound

## Looking at two scales

## Temperament

### Zarlino, theory

### Comparison

### Zarlino: a simulation of physical tuning

### More temperaments

## More than 12 grades

## Comparing scales

## The syntactic model

## References

## Continuous parameters in Csound scores

### Note

## Csound tuning in BP3

### Important…

### Changing middle C key number

## Misc. grammar controls

### _destru

A program for music composition and improvisation

Bernard Bel

Note interne, *Groupe Représentation et Traitement des Connaissances* (CNRS), Marseille 1988.

E. James Arnold

*Journal of the Sangit Natak Akademi*, New Delhi 1982. This paper is quoted in The Two-Vina Experiment.

N.D. Bose

*Jaico*, Bombay 1960. This paper is quoted in The Two-Vina Experiment.

Read More

Read More

Read More

A scan of Bose, N.D. Melodic Types of Hindustan. Jaico, Bombay 1960 …

Read More

Read More

Read More

Read More

Read More

The procedure for exporting just-intonation scales from murcchana-s of Ma-grama …

Read More

Read More

Read More

Read More

Read More

An interview with James Kippen by Antoine Bourgeau …

Read More

Read More

Entretien avec James Kippen, par Antoine Bourgeau …

Read More

Read More

Read More

Read More

Read More

The first six chapters of Natya Shastra, a Sanskrit treatise on music, dance and drama dating back to a period between 400 BCE and 200 CE, contain the premises of a scale theory which for long caught the attention of scholars in India and Western countries. Early interpretations by western musicologists followed the “discovery” of this text in 1794 by philologist William Jones. Hermann Helmholtz’s theory of “natural consonance” gave way to many comparative speculations based on phenomena which Indian authors had earlier observed as inherent to the “self-production” (*svayambhū*) of musical notes (Iyengar 2017 p. 8).

Suvarnalata Rao and Wim van der Meer (2009) published a detailed record of attempts to elucidate the ancient theory of musical scales in musicological literature, coming back to the notions of *ṣruti* and *swara* which changed over time up to present-day musical practice.

In the second part of the 20^{th} century, experimental work with frequency meters led to contradictory conclusions drawn from the analysis of small samples of music performance. It was only after 1981 that systematic experiments were conducted in India by the ISTAR team (E.J. Arnold, B. Bel, J. Bor and W. van der Meer) with an electronic programmable harmonium (the *Shruti Harmonium*) and later on a “microscope” for melodic music, the *Melodic Movement Analyser* (MMA) (Arnold & Bel 1983, Bel & Bor I985) feeding accurate pitch data to a computer to process hours of music selected from historical recordings.

After several years of experimental work, it had become clear that, even though the intonation of Indian classical music is far from a random process, it would be hazardous to assess an interpretation of ancient scale theory with the aid of today’s musical data. There at least three reasons for this:

- There are infinitely valid interpretations of the ancient theory, as we will show.
- The concept of raga, i.e. the basic principle of Indian classical music, appeared first in the literature circa 900 CE in Matanga’s
*Brihaddeshi*, and it underwent a gradual development until 13^{th}century, when Sharangadeva enlisted 264 ragas in his*Sangitratnakara*. - Drones were not in use at the time of
*Natya Shastra*; the influence of the drone on intonation is considerable, if not predominant, in contemporary music performance.

The ancient Indian theory of scales remains useful for its insight into early melodic classification (the *jāti* system) which later might have engendered the raga system. Therefore, it may be best envisaged as a *topological* description of tonal structures. Read Raga intonation for a more detailed account of theoretical and practical issues.

The topic of this page is an interpretation of the experiment of the two vinas described in Chapter XXVIII.24 of the *Natya Shastra*. An analysis of the underlying model has been published in A Mathematical Discussion of the Ancient Theory of Scales according to Natyashastra (Bel 1988) which the following presentation will render more comprehensive.

Bharata Muni, the author(s) of *Natya Shastra* might have heard about theories of musical scales attributed to “ancient Greeks”. At least, Indian scholars were in position to borrow these models and expand them considerably because of their genuine knowledge of calculus.

Readers of C.K. Raju — notably his outstanding work *Cultural Foundations of Mathematics* (2007) — are aware that Indian mathematicians/philosophers are not only famous for inventing positional notation which took six centuries to be adopted in Europe… They also laid out the foundations of calculus and infinitesimals, later exported by Jesuit priests from Kerala to Europe and borrowed/appropriated by European scholars (Raju 2007 pages 321-373).

The calculus first developed in India as a sophisticated technique to calculate precise trigonometric values needed for astronomical models. These values were precise to the 9

^{th}place after the decimal point; this precision was needed for the calendar, critical to monsoon-driven Indian agriculture […]. This calculation involved infinite series which were summed using a sophisticated philosophy of ratios of inexpressed numbers [today called rational functions…].Europeans, however, were primitive and backward in arithmetical calculations […] and barely able to do finite sums. The decimal system had been introduced in Europe by Simon Stevin only at the end of the 16

C. K. Raju (2013 p. 161- 162)^{th}c., while it was in use in India since Vedic times, thousands of years earlier.

This may be cited in contrast with the statements of western historians, among which:

The history of mathematics cannot with certainty be traced back to any school or period before that of the Greeks […] though all early races knew something of numeration […] and though the majority were also acquainted with the elements of land-surveying, yet the rules which they possessed […] were neither deduced from nor did they form part of any science.

W. W. Rouse Ball,A Short Account of the History of Mathematics. Dover, New York, 1960, p. 1–2.

Therefore, it may seem paradoxical, given such an intellectual baggage, to write an entire chapter on musical scales without a single number! In A Mathematical Discussion of the Ancient Theory of Scales according to Natyashastra I showed a minimal reason: Bharata’s description leads to an infinite set of solutions that should be formalized with algebra rather than a finite set of numbers.

The author(s) of *Natya Shastra* invite(s) the reader to take two *vina*-s (plucked stringed instruments) and tune them on the same scale.

A word of caution to clarify the context: this chapter of *Natya Shastra* may be read as a thought experiment rather than a process involving physical objects. There is no certitude that these two *vina*-s ever existed — and even that “Bharata Muni”, the author/experimenter, was a unique person. His/their approach is a validation (* pramāņa*) resorting to empirical proof, in other words driven by the physically manifest (

Constructing and manipulating *vina*-s in the manner indicated by the experimenter seems an insurmontable technological challenge. This has been a subject of discussion among a number of authors — read Iyengar (2017 pages 7-sq.) Leaving aside the possibility of a practical realization is not a denial of physical reality, as formal mathematics would systematically mandate. Calling it a “thought experiment” is a way of asserting the link with the physical model. In the same manner, using circular graphs to represent tuning schemes and algebra to describe relations between intervals are aids to understanding which do not reduce the model to specific, idealistic interpretations similar to speculations on integer numbers cherished by western scholars. These graphs aim at facilitating a computational design of instruments modeling these imagined instruments — read Raga intonation and Just intonation, a general framework.

Let us follow Bharata’s instructions and tune both instruments on a scale called “*Sa-grama*” about which the author declares:

The seven notes [svaras] are: Şaḍja [Sa], Ṛşbha [Ri], Gāndhāra [Ga], Madhyama [Ma], Pañcama [Pa], Dhaivata [Dha], and Nişāda [Ni].

It is tempting to identify this scale as the conventional western seven-grade scale *do, re, mi, fa, sol, la, si* (“C”, “D”, “E”, “F”, “A”, “B”) which some scholars have done despite the faulty interpretation of intervals.

Intervals are notated in *shruti*-s which may, for a start, be taken as an ordering device rather than a unit of measurement. The experiment will confirm that a four-*shruti* interval is larger than a three-*shruti*, a three-*shruti* larger than two-*shruti* and the latter larger than a single *shruti*. In different contexts the word “*shruti*” designates note positions instead of intervals between notes. This ambiguity is also a source of confusion.

The author writes:

Śrutis in the Şaḍja Grāma are shown as follows: three [in Ri], two [in Ga], four [in Ma], four [in Pa], three [in Dha], two [in Ni], and four [in Sa].

Bharata enlists 9-*shruti* (consonant) intervals: “Sa-Pa”, “Sa-Ma”, “Ma-Ni”, “Ni-Ga” and “Re-Dha”. In addition, he defines another scale named “*Ma-grama*” in which “Pa” is one *shruti* lower than “Pa” in the *Sa-grama*, so that “Sa-Pa” is no longer consonant whereas “Re-Pa” is consonant because it is made of 9 *shruti*-s.

Intervals of 9 or 13 *shruti*-s are declared “consonant” (*samvadi*). Leaving out the octave, the best consonance in a musical scale is the perfect fifth with a frequency ratio close to 3/2. When tuning stringed instruments, a ratio differing from 3/2 generates beats indicating that a string is *out of tune*.

If frequency ratios are expressed logarithmically with 1200 cents representing one octave, and further converted to angles with a full octave on a circle, the description of *Sa-grama* and *Ma-grama* scales may be summarized on a circular diagram (see picture).

Two cycles of fifths have been highlighted in red and green colors. Note that both the “Sa-Ma” and “Ma-Ni” intervals are perfect fifths, discarding the association of *Sa-grama* with the conventional western scale: the “Ni” should be mapped to “B flat”, not to “B”. Further, the “Ni-Ga” perfect fifth implies that “Ga” is also “E flat” rather than “E”. The *Sa-grama* and *Ma-grama* scales are therefore “D modes”. For this reason, “Ga” and “Ni” appear underlined on the diagrams.

Authors eager to identify *Sa-grama* and *Ma-grama* as a western scale claimed that when the text says that there are *“3 shruti-s in Re”* it should be understood between Re and Ga. Yet this interpretation is inconsistent with the second lowering of the moveable *vina* (see below).

We must avoid premature conclusions about intervals in these scales. The two cycles of fifths are unrelated except that the “distance” between the “Pa” of *Ma-grama* and that of *Sa-grama* is “one-*shruti*”:

The difference which occurs in Pañcama when it is raised or lowered by a Śruti and when consequential slackness or tenseness [of strings] occurs, will indicate a typical (pramāņa) Śruti. (XXVIII, 24)

In other words, the size of this * pramāņa ṣruti* is not specified. It would therefore be misleading to postulate its equivalence with the syntonic comma (frequency ratio 81/80). Doing so reduces Bharata’s model to “just intonation”, indeed with interesting properties in its application to western harmony (read page), but with a questionable relevance to the practice of Indian music. As claimed by Arnold (1983 p. 39):

The real phenomenon of intonation in Hindustani Classical Music as practised is much more amorphous and untidy than any geometry of course, as recent empirical studies by Levy (1982), and Arnold and Bel (1983) show.

The designation of the smallest interval as “* pramāņa ṣruti* ” is of major epistemic relevance and deserves a brief explanation. The semantics of “

An equivalent way of connecting the two cycles of fifths would be to define a 7-*shruti* interval, for instance “Ni-Re”. If the *pramāņa ṣruti* were a syntonic comma then this interval would be a harmonic major third with ratio 5/4. As mentioned in Just intonation, a general framework, the invention of the major third as a

In all writings referring to the ancient Indian theory of scales, I occasionally used “*pramāņa ṣruti*” and “syntonic comma” as equivalent terms. This is acceptable if one accepts that the syntonic comma is allowed to take values other than 81/80. Consequently, the “harmonic major third” should not automatically be assigned frequency ratio 5/4.

Picture above represents the two *vina*-s tuned identically on *Sa-grama*. Matching notes are marked by yellow spots. The inner part of the blue circle will be the movable *vina* in the following transposition processes, and the outer part the fixed *vina*.

Bharata writes:

The two Vīņās with beams (danḍa) and strings of similar measure, and with similar adjustment of the latter in the Şaḍja Grāma should be made [ready]. [Then] one of these should be tuned in the Madhyama Grāma by lowering Pañcama [by one Śruti]. The same (Vīņā) by adding one Śruti (lit. due to the adding of one Śruti) to Pañcama will be tuned in the Şaḍja Grāma.

In brief, this is a procedure for lowering all notes of the movable *vina* by one *pramāņa ṣruti*. First lower its “Pa” — e.g. make it consonant with “Re” of the fixed

The picture illustrates the fact that there are no more matching notes between the two *vina*-s.

This situation can be translated to algebra. Let “a”, “b”, “c” … “v” be the unknown sizes of *shruti*-s in the scale (see picture on the side). A metrics “translating” Bharata’s model will be necessary for checking it on sound structures produced by an electronic instrument — the computer. The scope of this translation remains valid as long as no extra assertion has been stated which is not rooted in the original model.

Using symbol “#>” to indicate that two notes are not matching, this first lowering may be summarized by the following set of inequations:

s + t + u + v > m a + b + c > m d + e > m f + g + h + i > m n + o + p > m q + r > m | Sa #> Ni Re #> Sa Ga #> Re Ma #> Ga Dha #> Pa Ni #> Dha |

The next step is again a lowering by one *shruti* with a different procedure.

Again due to the decrease of a Śruti in another [Vīņā], Gāndhāra and Nişāda will merge with Dhaivata and Ṛşbha respectively, when there is an interval of two Śrutis between them.

Note that it is no longer possible to rely on a lowered “Pa” to evaluate a *pramāņa ṣruti* for the lowering. The instruction is to lower the tuning of the movable vina until either “Re” and “Ga” or “Dha” and “Ni” are merged, which is claimed to be the same because of the final lowering of two

Now we get an equation reporting that the two-*shruti *intervals are equal in size:

q + r = d + e

and five more inequations indicating the non-matching of other notes:

f + g + h + i > d + e a + b + c > d + e s + t + u + v > d + e n + o + p > d + e j + k + l + m > d + e | Ma #> Ga Re #> Sa Sa #> Ni Dha #> Pa Pa #> Ma |

We should keep in mind that the author is describing a physical process, not an abstract “movement” by which the moveable wheel (or *vina*) would “jump in space” from its initial to final position. Therefore we pay attention to things happening and not happening during the tuning of the vina, or *rotation* of the wheel, looking at the trajectories of dots representing note positions (along the blue circle). Things *not happening* (non-matching notes) yield inequations required for making sense of the algebraic model.

This step of the experiment confirms that it is wrong to locate Sa at the position of Ni for the sake of identifying *Sa-grama* with the western scale. In this case, matching notes would no be Re-Ga and Dha-Ni, but Ga-Ma and Ni-Sa.

Bharata writes:

Again due to the decrease of a Śruti in another [Vīņā], Ṛşbha and Dhaivata will merge with Şaḍja and Pañcama respectively, when there is an interval of three Śrutis between them.

This leads to equation

n + o + p = a + b + c

and inequations:

s + t + u + v > a + b + c f + g + h + i > a + b + c j + k + l + m > a + b + c | Sa #> Ni Ma #> Ga Pa #> Ma |

The procedure:

Similarly the same [one] Śruti being again decreased, Pañcama, Madhyama and Şaḍja will merge with Madhyama, Gāndhāra and Nişāda respectively when there is an interval of four Śrutis between them.

This yields 2 equations:

j + k + l + m = f + g + h + i

s + t + u + v = f + g + h + i

After eliminating redundant equations and inequations, constraints are summarized as follows:

(S1) d + e > m

(S2) a + b + c > d + e

(S3) f + g + h + i > a + b + c

(S4) j + k + l + m = f + g + h + i

(S5) s + t + u + v = f + g + h + i

(S6) n + o + p = a + b + c

(S7) q + r = d + e

The three inequations illustrate the fact that numbers of *shruti*-s denote an ordering of the sizes of intervals between notes.

Still, we have 22 variables and only 4 equations. These variables can be “packed” to a set of 8 variables which represent the “macro-intervals”, i.e. the steps of the *grama*-s. In this approach, *shruti*-s are sort of “subatomic” particles which these “macro-intervals” are made of… Now we need only 4 auxiliary equations to determine the scale. These may be provided by acoustic information, with intervals measured in cents. First we express that the sum of the variables, the octave, is equal to 1200 cents:

(S8) (a + b + c) + (d + e) + (f + g + h + i) + (j + k + l) + m + (n + o + p) + (q + r) + (s + t + u + v) = 1200

Then we interpret all *samvadi* relationships as perfect fifths (ratio 3/2 = 701.9 cents):

(S9) (a + b + c) + (d + e) + (f + g + h + i) + (j + k + l) + m = 701.9 (Sa-Pa)

(S10) (j + k + l) + m + (n + o + p) + (q + r) + (s + t + u + v) = 701.9 (Ma-Sa)

(S11) (d + e) + (f + g + h + i) + (j + k + l) + m + (n + o + p) = 701.9 (Re-Dha)

(S12) (f + g + h + i) + (j + k + l) + m + (n + o + p) + (q + r) = 701.9 (Ga-Ni)

including the “Re-Pa” perfect fifth in *Ma-grama*:

(S13) m + (n + o + p) + (q + r) + (s + t + u + v) + (a + b + c) = 701.9

S1O, S11 and S12 can all be derived from S9. These equations may therefore be discarded. We still need one more equation to solve the system. At this stage there are many options associated with tuning procedures. As suggested above, setting the harmonic major third to ratio 5/4 (386.3 cents) would provide the missing equation. This amounts to setting variable “m” to 21.4 cents (syntonic comma). However, this major third can have any size up to the Pythagorean third (81/64 = 407.8 cents) for which we would get m = 0.

Beyond this range, the two-vina experiment is no longer valid, but it leaves a great amount of possibilities including the temperament of some intervals which musicians might achieve spontaneously in parallel melodic movements. A set of solutions is exposed in A Mathematical Discussion of the Ancient Theory of Scales according to Natyashastra and a few of them have been tried on the Bol Processor to check musical examples for which they might provide adequate scales — read Raga intonation.

In order to complete his system of scales, Bharata needed to add two new notes to the basic *grama*-s: *antara Gandhara* and *kakali Nishada*. The new “Ga” is defined as “G” raised by 2 *shruti*-s. Similarly, *kakali Ni* is “N” raised by 2 *shruti*-s.

In order to position “Ni” and “Ga” correctly we must investigate the behavior of the new scale in all transpositions (*murcchana*-s), including those starting with “Ga” and “Ni”, and infer equations corresponding to an optimal consonance of the scale. We end up with 11 equations for only 10 variables, which means that this perfection cannot be achieved. One constraint must be released.

An option is to release constraints on major thirds, fifths or octaves, leading to a form of temperament. For instance, stretching the octave by 3.7 cents generates perfect fifths (701.9 cents) and harmonic major thirds close to equal temperament (401 cents) with a comma of 0 cents. This tuning technique was advocated by Serge Cordier (Asselin 2000 p. 23; Wikipedia).

Another option is to come as close as possible to “just intonation” without modifying perfect fifths and octaves. This is possible if the comma (variable “m”) is allowed an arbitrary value between 0 and 56.8 cents. Limits are imposed by the inequations derived from the two-vina experiment.

These “just systems” are calculated as follows:

a + b + c = j + k + l = n + o + p = Maj - C

d + e = h + i = q + r = u + v = L + C

f + g = s + t = Maj - L - C

m = C

where L = 90.25 cents (limma = 256/243), Maj = 203.9 cents (major wholetone = 9/8)

and 0 < C < 56.8 (*pramāņa ṣruti* or syntonic comma)

This leads to the 53-grade scale named “grama” which we use as a framework for consonant chromatic scales eligible for pure intonation in western harmony when the syntonic comma is sized 81/80. Read Just intonation, a general framework:

In BP3, the just-intonation framework has been extended so that any value of the syntonic comma (or the harmonic major third) can be set on a given scale structure. This feature is demonstrated on page Raga intonation.

It is safe to classify the two-vina experiment as thought experiment because of the unlikelihood that it could be worked with mechanical instruments. Representing it on a circular graph (a moveable wheel inside a fixed crown) achieves the same goal without resorting to imaginary devices.

Circular representations belong to Indian traditions of various schools, among which the description of rhythmic cycles (*t āl*-s) used by drum players. These graphs are meant to outline the rich internal structure of musical constructions that cannot be reduced to “beat counting” (Kippen 2020).

For instance, the image above was used to describe the *ţhekkā* (cycle of quasi-onomatopoeic syllables representing the drum strokes) of *tāl Pañjābi* which reads as follows:

Unfortunately, early printing press technology may have rendered uneasy the publication and transmission of these aids to learning.

If contemporaries of Bharata ever used similar circular representations for reflecting on musical scales, we guess that archeological traces might not be identified properly as their drawings could be mistaken for *yantra*-s, astrological charts and the like!

Bharata’s experiment is a typical example of the preference for facts inferred from empirical observations over a proclaimed universal logic aimed at establishing “irrefragable demonstrations”.

Empirical proofs are universal,

notmetaphysical proofs; eliminating empirical proofs is contrary toallsystems of Indian philosophy. Thus elevating metaphysical proofs above empirical proofs, as formal mathematics does, is a demand to reject all Indian philosophy as inferior. Curiously, like Indian philosophy, present-day science too uses empirical means of proof, so this is also a demand to reject science as inferior (to Christian metaphysics).Logic is not universal either as Western philosophers have foolishly maintained: Buddhist [quasi truth-functional] and Jain [three-valued] logics are different from those currently used in formal mathematical proof. The theorems of mathematics would change if those logics were used. So, imposing a particular logic is a means of cultural hegemony. If logic is decided empirically, that would, of course, kill the philosophy of metaphysical proof. Further, it may result in quantum logic, similar to Buddhist logic […].

C. K. Raju (2013 p. 182-183)

The two-vina experiment can be likened to the (more recent) physical proof of the “Pythagorean theorem”. This theorem (Casey 1885 p. 43) was known in India and Mesopotamia long before the time of its legendary author (Buckert 1972 p. 429, 462). In the Indian text *Yuktibhāşā* (ca. 1530 CE), a figure of a right-angle triangle is drawn on a palm leaf with squares on its two sides and its hypothenuse. Then the figure is cut and rotated in a way highlighting that the areas are equal.

Clearly, the proof of the “Pythagorean theorem” is

C. K. Raju (2013 p. 167)veryeasy if one is either (a) allowed to make measurements, or, equivalently (b) allowed to move figures about in space.

This process takes place on several steps of *moving figures* in a way similar to *moving scales* (or figures representing scales) in the two-vina experiment. The 3 single-*shruti* tonal intervals may be likened to the areas of the 3 squares in *Yuktibhāşā*. The following remark would therefore apply to Bharata’s procedure:

The details of this rationale are not our immediate concern beyond observing that drawing a figure, carrying out measurements, cutting, and rotation are all empirical procedures. Hence, such a demonstration would today be rejected as invalid solely on the ground that it involves empirical procedures that

C. K. Raju (2007 p. 67)oughtnot to be any part of mathematical proof.

Bernard Bel — Dec. 2020

Arnold, E. J. A Mathematical model of the Shruti-Swara-Grama-Murcchana-Jati System. New Delhi, 1982: Journal of the Sangit Natak Akademi.

Arnold, E.J.; Bel, B. *A Scientific Study of North Indian Music*. Bombay, 1983: NCPA Quarterly Journal, vol. XII Nos. 2 *& *3.

Asselin, P.-Y. *Musique et tempérament*. Paris, 1985, republished in 2000: Jobert. *Soon available in English.*

Bel, B.; Bor, J. *Intonation of North Indian Classical Music: working with the MMA*. Video on Dailymotion. Bombay, 1984: National Center for the Performing Arts.

Bel, B.; Bor, J. *NCPA/ISTAR Research Collaboration*. Bombay, 1985: NCPA Quarterly Journal, vol. XIV, No. 1, p. 45-53.

Bel, B. A Mathematical Discussion of the Ancient Theory of Scales according to Natyashastra. Note interne. Marseille, 1988a : *Groupe Représentation et Traitement des Connaissances* (CNRS).

Bel, B. *Raga : approches conceptuelles et expérimentales*. Actes du colloque “Structures Musicales et Assistance Informatique”. Marseille, 1988b.

Bharata. *Natya Shastra*. There is no currently available English translation of the first six chapters of Bharata’s Natya Shastra. However, most of the information required for this interpretation has been reproduced and commented by Śārṅgadeva in his *Sangita Ratnakara* (13^{th} century CE), translated by Dr R. K. Shringy, vol.I. Banaras 1978: Motilal Banarsidass.

Bose, N. D. Melodic Types of Hindustan. Bombay, 1960: Jaico.

Burkert, W. *Lore and Science in Ancient Pythagoreanism*. Cambridge MA, 1972: Harvard University Press.

Casey, J. *The First Six Books of the Elements of Euclid, and Propositions I.-XXI. of Book VI*. London, 1885: Longmans. Free e-book, Project Gutenberg.

Iyengar, R. N. *Concept of Probability in Sanskrit Texts on Classical Music.* Bangalore, 2017. Invited Talk at ICPR Seminar on “Science & Technology in the Indic Tradition: Critical Perspectives and Current Relevance”, I. I. Sc.

Kippen, J. *Rhythmic Thought and Practice in the Indian Subcontinent*. In R. Hartenberger & R. McClelland (Eds.), *The Cambridge Companion to Rhythm* (Cambridge Companions to Music, p. 241-260). Cambridge, 2020: Cambridge University Press. doi:10.1017/9781108631730.020

Levy, M. *Intonation in North Indian Music*. New Delhi, 1982: Biblia Impex.

Raju, C. K. *Cultural foundations of mathematics : the nature of mathematical proof and the transmission of the calculus from India to Europe in the 16 ^{th} c. CE*. Delhi, 2007: Pearson Longman: Project of History of Indian Science, Philosophy and Culture : Centre for Studies in Civilizations.

Raju, C. K. *Euclid and Jesus: How and why the church changed mathematics and Christianity across two religious wars*. Penang (Malaysia), 2013: Multiversity, Citizens International.

Rao, S.; Van der Meer, W. *The Construction, Reconstruction, and Deconstruction of Shruti*. Hindustani music: thirteenth to twentieth centuries (J. Bor), Manohar, New Delhi 2010.

Shringy, R.K.; Sharma, P.L. *Sangita Ratnakara of Sarngadeva: text and translation*, vol. 1, 5: 7-9. Banaras, 1978: Motilal Banarsidass. Source in the Web Archive.

“Just intonation” (*intonation pure* in French) is a word employed by composers, musicians and musicologists to designate various aspects of composition, performance and instrument tuning. These point at the same goal of “playing/singing in tune” — whatever it means. Implementing a generic abstract model of just intonation in the Bol Processor is a challenge beyond our current competence… We address it in a pragmatic manner, looking at a few musical traditions following the same goal with the aid of reliable theoretical models.

A complete and consistent framework for constructing just-intonation scales — or “tuning systems” — was the *grama-murcchana* model elaborated in ancient India. This theory has been extensively commented and (mis)interpreted by Indian and Western scholars: read a detailed survey in Rao & van der Meer 2010. We will show that an arguably acceptable interpretation yields a framework of chromatic scales that can be extended to western classical harmony and easily handled by Bol Processor + Csound.

This page is a continuation of Microtonality but it can be read independently.

All examples shown on this page are available in the sample set bp3-ctests-main.zip shared on GitHub. Follow instructions on *Bol Processor ‘BP3’ and its PHP interface* to install BP3 and learn its basic operation. Download and install Csound from its distribution page.

Methods for tuning musical instruments have been documented for more than 2000 years in several parts of the World. For practical and personal reasons, we will focus on work in Europe and the Indian subcontinent.

Systems described as “just intonation” are attempts to set up a tuning in which all tonal intervals would be consonant. A large body of theoretical work on just intonation is available — check Wikipedia for links and abstracts.

Models are amenable to Hermann von Helmholtz’s notion of *consonance* dealing with the perception of the pure sine wave components of complex sounds containing multiple tones. According to the theory of harmony, frequencies of these upper partials are integer multiples of the fundamental frequency of the vibration. In mechanical musical instruments, this is close to reality when long strings are hit or plucked in a gentle way. However, this harmonicity is missing in many wind instruments, notably reed instruments such as the saxophone or the *shehnai* in India, and indeed in percussion instruments or bells which combine multiple modes of vibration.

If just intonation is invoked for tuning a musical instrument, it must therefore be analogous to a zither, a *swara mandal*, a harpsichord, a piano or a pipe organ, including electronic devices producing similar sounds.

Maybe because of their late “discovery” of calculus — actually “borrowed” from Indian, Persian and Arabic sources — Europeans cultivated a fascination for *numbers* strongly advocated by priests as an image of “God’s perfection”. We may recall Descarte’s claim that the length of a curve is *“beyond human understanding”* — because π cannot be written as an integer ratio…

In real life, musicians designed *procedures* to tune their instruments, listening to intervals and picking up the ones that made sense to their ears — read page The two-vina experiment. Following the development of music acoustics, attempts were done to interpret these procedures in terms of frequency ratios. However, this was a risky venture because the dream of perfection lead to the simplistic promotion of “perfect ratios”.

Seeking the kind of perfection embodied by numbers is the best way to produce tasteless music. While just intonation — intervals with no beats — is nowadays achievable on electronic instruments, it is based on a narrow concept of tonality. This can be verified by listening to ancient western music played with various types of temperament — read page Comparing temperaments — and indeed to Indian classical music — read page Raga intonation.

Models of vibrating strings attributed to “ancient Greeks” stipulate that frequency ratios 2/1 (the octave), 3/2 (the major fifth) and 5/4 (the major third) produce *consonant* intervals whereas other ratios carry a certain amount of *dissonance*.

The practice of polyphonic music on fixed-tuning instruments showed that this perfect consonance is never achieved with 12 grades in an octave — the conventional *chromatic scale*. In western classical harmony, it would demand a retuning of the instrument according to the musical genre, the musical piece and the harmonic context of every note sequence or chord.

Imperfect tonal intervals generate undesired beats because their frequency ratio cannot be reduced to simple 2, 3, 4, 5 fractions. A simple thought experiment mythically attributed to Pythagoras of Samos reveals that this is inherent to arithmetics and not a defect of instrument design. Imagine the tuning of ascending fifths (ratio 3/2) by successive steps on a harp with a shift of octaves to maintain the resulting note within the original octave. Frequency ratios would be 3/2, 9/4, 27/16, 81/64 etc. At this stage, the note seems to be located at a major third although its actual ratio (81/64 = 1.265) is higher than 5/4 (1.25). The 81/64 interval is named a *Pythagorean major third*, which may sound “out of tune” in a conventional harmonic context. The frequency ratio (81/80 = 1.0125) between the Pythagorean and harmonic major thirds is called a syntonic comma.

Whoever designed the so-called “Pythagorean tuning” went further in their intention to describe all musical notes via cycles of fifths. Moving further up, 243/128, 729/512… etc. effectively produces a full chromatic scale: C - G - D- A - E - B - F♯ - C♯ - G♯… etc. but, in addition to the harsh sounding of some of the resulting intervals, things turn bad if one hopes to terminate the cycle on the initial note. If the series started on “C” it does end on “C” (or “B#”), yet with a ratio 531441/524288 = 1.01364 slightly higher than 1. This gap is called the Pythagorean comma, conceptually distinct from the syntonic comma (1.0125) although their sizes are almost identical. This paradox is a matter of simple arithmetics: powers of 2 (octave intervals) never match powers of 3.

Needless to say, attributing this system to “ancient Greeks” is pure fantasy because (unlike Egyptians) they did not know the usage of fractions!

Despite the comma problem, tuning instruments by series of perfect fifths was common practice in Middle-Aged Europe, following the organum which consisted in singing/playing parallel fifths or fourths to enhance a melody. One of the oldest treatises on “Pythagorean tuning” was published by Henri Arnault de Zwolle circa 1450 (Asselin 2000 p. 139). With this tuning, major “Pythagorean” thirds sounded harsh, which explains that in those days the major third was rated a *dissonant* interval.

Due to these limitations, western fixed-pitch instruments using chromatic (12-grade) scales never achieve the pitch accuracy dictated by just intonation. For this reason, just intonation is depicted as “incomplete” in the literature (Asselin 2000 p. 66). Multiple divisions (more than 12 per octave) are required for producing all “pure” ratios. This has been unsuccessfully attempted on keyboard instruments although it remains possible on a computer.

The *grama-murcchana* model was described in *Natya Shastra*, a Sanskrit treatise on the performing arts compiled in India about twenty centuries ago. Chapter 28 contains a discussion of the “harmonic scale” based on a division of the octave in 22 *shruti*-s, whereas it enlists only seven *swaras* (notes) used by musicians: “Sa”, “Re”, “Ga”, “Ma”, “Pa”, “Dha”, “Ni”. These may be mapped to western conventional music notation “C”, “D”, “E”, “F”, “G”, “A”, “B” in English, or “do”, “re”, “mi”, “fa”, “sol”, “la”, “si” in Italian/Spanish/French.

This 7-*swara* scale may be extended to a 12-grade (chromatic) scale thanks to diesis and flat alterations respectively raising or lowering a note by a semitone. Altered notes in the Indian system are commonly named “komal Re”, “komal Ga”, “Ma tivra”, “komal Dha” and “komal Ni”. The word *“komal”* may be translated as *flat* and *“tivra”* as *diesis*.

The focus of 20^{th} century research in Indian musicology has been to “quantify” *shruti*-s in a systematic manner and assess the relevance of this quantification to the performance of classical raga.

A striking point in the ancient Indian theory of musical scales is that it does not rely on number ratios, be it frequencies or lengths of vibrating strings. This point has been overlooked by “colonial musicologists” due to their lack of insight into Indian mathematics and their fascination for a mystique of numbers inherited from Neopythagoreanism.

Bharata Muni, the author(s) of *Natya Shastra*, may have heard about “Pythagoras tuning”, a theory which they could expand considerably because of their advance in the usage of calculus. Despite this, the whole chapter on musical scales does not cite a single number. This paradox is discussed on page The Two-vina experiment. In *A Mathematical Discussion of the Ancient Theory of Scales according to Natyashastra* I showed a minimal reason: Bharata’s description leads to an infinite set of solutions that should be formalized with algebra rather than a finite set of integer ratios.

How (and why) should one divide the octave in 22 micro-intervals when only 5 to 12 notes are named in most Indo-European musical systems? A few innocent ethnomusicologists claimed that Bharata’s model must be a variant of the Arabic “quartertone system” or even a 22-grade tempered scale… If so, why not 24 *shruti*-s? Or any arbitrary number? The two-vina experiment yields *shruti*-s unequal in size. No sum of microtones measuring 54.5 cents in a 22-grade tempered scale would provide an interval close to 702 cents — the perfect fifth giving consonance (*samvadi*) to musical scales.

In the (thought?) experiment described in *Natya Shastra* (chapter 28), two *vina*-s — stringed instruments similar to zithers — are tuned identically. The author suggests to lower all the notes of one instrument by “one *shruti*” and he gives a list of notes that will match between the two instruments. The operation is repeated three more times until all matches have been made explicit. This yields a system of equations (and inequations) for the 22 unknown variables. Additional equations can be inferred from a preliminary statement that the octave and the major fifth are “consonant” (*samvadi*), thereby fixing ratios close to 2/1 and 3/2. (Read the detailed process on page The Two-vina Experiment and the maths in *A Mathematical Discussion of the Ancient Theory of Scales according to Natyashastra*.)

Still, one more equation is required which Bharata’s model does not provide. Interestingly, in *Natya Shastra* the major third is classified “assonant” (*anuvadi*). Setting its frequency ratio to 5/4 is therefore a reduction of this model. In fact, it is a discovery of European musicians in the early 16^{th} century — as fixed-pitch keyboard instruments had become popular (Asselin 2000 p. 139) — which many musicologists take for granted in their interpretation of the Indian model. *[…] thirds were considered interesting and dynamic consonances along with their inverses the sixths, but in medieval times they were considered dissonances unusable in a stable final sonority* (Wikipedia).

The reduction of Bharata’s model does not fit the flexibility of intonation schemes in Indian music — read page Raga intonation. Experimental work on musical practice is not “in tune” with this interpretation of the theory. The *shruti* system should be interpreted as a “flexible” framework in which the variable parameter is the syntonic comma, namely the difference between a Pythagorean major third and a harmonic major third. *Compliance with the two-vina experiment only implies that the comma takes its value between 0 and 56.8 cents* (Bel 1988a).

➡ Measurements in “cents” refer to a logarithmic scale. Given a frequency ratio ‘r’, its cent value is 1200 x log(r) / log(2). The octave (ratio 2/1) measures 1200 cents, and each semitone is approximately 100 cents.

The construction and assessment of raga scale types based on this flexible model is demonstrated on page Raga intonation.

An incentive to applying the Indian framework to western classical music is that both traditions have given a prior importance to the consonance of perfect fifths associated with a 3/2 frequency ratio. In addition, let us agree with fixing the harmonic major third to interval 5/4 (384 cents), thereby leading to a syntonic comma of 81/80 (close to 21.5 cents). The system of equations derived from the two-vina experiment is complete and it yields two additional sizes of *shruti*-s: the Pythagorean limma (256/243 = approx. 90 cents) and the minor semitone (25/24 = approx. 70 cents).

These intervals were well-known to western musicologists who tried to figure out just-intonation scales playable on (12-grade per octave) keyboard instruments. Gioseffo Zarlino (1517-1590) is a well-known contributor to this theoretical work. His “natural scale” was an arrangement of the three natural intervals yielding the following chromatic scale — named “just intonation” in “-cs.tryScales”:

➡ *This should not be confused with Zarlino’s meantone temperament (image), read pages Microtonality and Comparing temperaments.*

In 1974, E. James Arnold, inspired by French musicologist Jacques Dudon, designed a circular model for illustrating the transposition of scales (*murcchana*) in Bharata’s model. Below is the sequence of intervals (L, C, M…) over one octave as inferred from the two-vina experiment.

Positions R1, R2 etc. are labelled with abbreviations of names Sa, Re, Ga, Ma, Pa, Dha, Ni. For instance, Ga (“E” in English) may have four positions, G1 and G2 being enharmonic variants of *komal Ga* (“E flat” = “mi bemol”) while G3 and G4 are the harmonic and Pythagorean positions of *shuddha Ga* (“E”= “mi”) respectively.

Notes of the chromatic scale have been labeled using the Italian/Spanish/French convention “do”, “re”, “mi”, “fa”… rather than English to avoid confusion: “D” is associated with Dha (“A” in English, “la” in Italian/French) and not with the English “D” (“re” in Italian/French).

Frequency ratios are illustrated by pictograms telling how each position may be derived from the base note (Sa). For instance, the pictogram near N2 (“B flat” = “si bemol”) shows 2 ascending perfect fifths and 1 descending major third.

Cycles of perfect fiths have been marked with segments in red and green. The red series is generally named “Pythagorean” — containing G4 (81/84) — and the green one “harmonic” — containing G3 (5/4). The arrow in blue displays a harmonic major third going from S (“C” = “do”) to G3. Both cycles are identical, with harmonic and Pythagorean positions differing by 1 syntonic comma.

In theory, the harmonic series could also be constructed in a “Pythagorean manner”, extending cycles of perfect fifths. Thus, G3 (“E” = “mi”) would be at 8192/6561 (1.248) after 8 descending fifths instead of 5/4 (1.25). The difference is a schisma (ratio 1.001129), an interval beyond human perception. Therefore, it is more convenient to display simple ratios.

The framework implemented in Bol Processor deals with integer ratios allowing high accuracy. Nonetheless, it deliberately wipes out schisma differences. This is done by adjusting certain ratios, for instance replacing 2187/2048 with 16/15.

Note that there is no trace of schisma in the classical Indian theory of musical scales; there wouldn’t be even if Bharata’s contemporaries had constructed them via series of rational numbers because of their decision to disregard infinitesimals as “non-representable” entities (cf. Nāgārjuna’s *śūniyavāda* philosophy, Raju 2007 p. 400). In case 2187/2048 and further complex ratios of the same series were deemed unpractical, the Indian mathematician/physicist (following the *Āryabhaţīya*) would replace them all with “16/15 *āsanna* (near value)”… This is exemplary of Indian mathematics designed for *calculus* rather than *proof construction*. In the Western Platonicist approach, mathematics targeted “exact values” as a sign of perfection, which led its proponents to facing serious problems with “irrational” numbers and even the logic underlying formal proof-making procedures (Raju 2007 p. 387-389).

This diagram and the moveable *grama* wheel that will be next introduced could be built with any size of the syntonic comma in range 0 to 56.8 cents (Bel 1988a). The two-vina experiment implies that L = M + C. Thus, the syntonic comma is also the difference between a limma and a minor semitone. To build a framework of the flexible model, just allow all harmonic positions to move by the same amount in the direction of their Pythagorean enharmonic variants.

While major thirds would be 1 comma larger when opting for a Pythagorean interval (e.g. G4, ratio 81/64) instead of a harmonic one (G3, ratio 5/4), major fifths also differ by 1 comma but the Pythagorean fifth (P4, ratio 3/2) is larger than the harmonic one (P3, ratio 40/27). The latter has been named *wolf fifth* as its use in melodic phrases or chords is held to sound “out of tune”, with a negative/devilish magical conotation.

No position of this model requires more than 1 ascending or descending major third. This makes sense to instrument tuners who know that tuning perfect fifths by ear is an easy task that can be repeated on several steps — here, maximum 5 or 6 up and down. However, tuning a harmonic major third requires a little more attention. Therefore, imagining an accurate tuning procedure based on a succession of major thirds would be unrealistic — even though, indeed, this can be achieved with the help of electronic devices.

On top of the diagram (position “fa#”) we notice that none of the two cycles of fifths closes on itself because of the presence of a Pythagorean comma. The tiny difference (schisma, ratio 1.001129) between Pythagorean and syntonic commas is illustrated by two pairs of positions: P1/M3 and P2/M4.

Another particularity at the top of the picture is the apparent disruption of sequence L-C-M. However, remembering that L = M + C indicates that the regularity is restored by opting between P1/M3 and P2/M4.

Approximations have no implication on the sounding of musical intervals because no human ear would appreciate a schisma difference (2 cents). However, other differences need to remain explicit since integer ratios denote the tuning procedure by which the scale may be constructed. Thus, the replacement integer ratio may turn out more complex than the “schismatic” one, as is the case with R1, ratio 256/243 instead of 135/128 because the latter is built with a simple major third above D4 instead of belonging to the Pythagorean series.

The problem of tuning fixed-pitch instruments (harpsichord, pipe organ, pianoforte…) has been documented in great detail by organ/harpsichord player, builder and musicologist Pierre-Yves Asselin (Asselin 2000). In his practical approach, just intonation is a background model that can only be approximated on 12-grade scales via temperament — *compromising the pure intervals of just intonation to meet other requirements*. Techniques of temperament applicable to Bol Processor are discussed on pages Microtonality and Comparing temperaments.

The column at the centre of this picture, with notes inside ellipses, is a series of perfect fifths which Asselin named “Pythagorean”.

Series of fifths are infinite. Selecting seven of them (in the central column) creates a scale called the “global diatonic framework” (*milieu diatonique global*, see Asselin 2000 p. 59). In this example, frameworks are those of “C” and “G” (“do” and “sol” in French).

Extending series of perfect fifths beyond the sixth step creates complicated ratios that may be approximated (with a schisma difference) to the ones produced by harmonic major thirds (ratio 5/4). Positions on the right (major third upward, first order) are one syntonic comma lower than their equivalents in the central series, and positions on the left (major third downward, first order) one syntonic comma higher.

It is possible to create more columns on the right (“DO#-2”, “SOL#-2” etc.) for positions created by 2 successive jumps of a harmonic major third, and in the same way to the left (“DOb#+2”, “SOLb#+2” etc.) but these second-order series are only used for the construction of temperaments — read page Microtonality.

This model produces 3 to 4 positions for each note, a 41-grade scale that would 41 keys (or strings) per octave on a mechanical instrument! This is a reason for tempering intervals on mechanical instruments, which amounts to selecting the most appropriate 12 positions for a given musical repertoire.

This tuning scheme is displayed on scale “3_cycles_of_fifths” in the “-cs.tryTunings” Csound resource of Bol Processor.

Series of names have been entered along with the fraction of the starting position to produce cycles of perfect fifths in the scale. Following Asselin’s notation, the following series have been created (trace produced by the Bol Processor):

**From 4/3 up:**FA, DO, SOL, RE, LA, MI, SI, FA#, DO#, SOL#, RE#, LA#**From 4/3 down:**FA, SIb, MIb, LAb, REb, SOLb**From 320/243 up:**FA-1, DO-1, SOL-1, RE-1, LA-1, MI-1, SI-1, FA#-1, DO#-1, SOL#-1, RE#-1, LA#-1**From 320/243 down:**FA-1, SIb-1, MIb-1, LAb-1, REb-1, SOLb-1**From 27/20 up:**FA+1, DO+1, SOL+1, RE+1, LA+1, MI+1, SI+1, FA#+1, DO#+1, SOL#+1, RE#+1, LA#+1**From 27/20 down:**FA+1, SIb+1, MIb+1, LAb+1, REb+1, SOLb+1

This was more than sufficient to determine the 3 or 4 positions of each note, given that several ones may reach the same position at a schisma distance. For instance, “REb” is at the same position as “DO#-1”. The IMAGE link displays this scale with (simplified) frequency ratios:

Compared with the model advocated by Arnold (1974, see picture on top), this system accepts harmonic positions on both sides of Pythagorean positions, implying that Sa (“C” or “do”) may take three different positions just like all unaltered notes. In Indian music, Sa is unique because it is the base note of every classical performance of raga, fixed by the drone (tanpura) and tuned at the convenience of singers or instrument players. Nonetheless, we will see that transpositions (*murcchana*-s) of the basic Indian scale(s) produce some of these additional positions.

A tuning scheme based on three (or more) cycles of perfect fifths is a suitable grid for constructing basic chords in just intonation. For instance, a “C major” chord is made of its tonic “DO”, its dominant “SOL” a perfect fifth higher and “MI-1” at a harmonic major third above “DO”. The first two notes may belong to a Pythagorean series (blue marks on the graph) and the last one to a harmonic series (green marks on the graph). Minor chords are constructed in a similar way that will be made explicit later.

This does not entirely solve the problem of playing tonal music in just intonation. Sequences of chords must be properly aligned. For instance, should one take the same “E” in “C major” and in “E major”? The answer is “no” but the rule needs to be made explicit.

How is it possible to select the proper one among the 3^{7} * 4^{5} = 2 239 488 chromatic scales displayed on this graph?

In the approach followed by Pierre-Yves Asselin (2000) — inspired by the work of Conrad Letendre in Canada — rules have been derived from options validated by listeners and musicians. Conversely, the *grama* framework exposed below is a “top-down” approach — from a theoretical model to its assessment by practitioners.

Using Bharata’s model — read page The two-vina experiment — we can construct chromatic (12-grade) scales in which each tonal position (among 11) has two options: harmonic or Pythagorean. This is a reason for saying that the framework is based on 22* shruti*-s. In Indian musicological literature, the term *shruti* is ambiguous since it either designates a tonal position or an interval.

In Bol Processor BP3 this “grama” framework is edited as follows in “-cs.12_scales”:

We use lower-case labels for R1, R2 etc. and append a ‘_’ after labels to distinguish enharmonic positions from octave numbers. Thus, “g3_4” means G3 in the fourth octave.

Two options for each of the 11 notes yields a set of 2^{11} = 2048 chromatic scales. Among these, only 12 are “optimally consonant”, i.e. containing only one wolf fifth (smaller by 1 syntonic comma). These 12 scales are the ones used in harmonic or modal music to experience maximum consonance. The author(s) of *Naya Shastra* had this intention in mind when describing a basic 12-tone “optimal” scale named “*Ma-grama*”. This scale is named “Ma_grama” in Csound resource “-cs.12_scales”:

Clicking link IMAGE on the “Ma_grama” page yields a graphic representation of this scale:

On this image, perfect fifths are blue lines and the (unique) wolf fifth between C and G is a red line. Note positions marked in blue (“Db”, “Eb” etc.) are Pythagorean and harmonic positions (“D”, “E” etc.) appear in green. Normally, a “Pythagorean” position, on this framework, is one in which neither the numerator nor the denominator of the fraction is a multiple of 5. Multiples of 5 indicate jumps of harmonic major thirds (ratio 5/4 or 4/5). However, this simple rule is broken when complex ratios have been replaced with simple equivalents at a distance of a schisma. Therefore, the blue and green marks on Bol Processor images are mainly for facilitating the identification of a position: a note appearing near a blue marking might as well belong to the harmonic series with a more complex ratio bringing it near the Pythagorean position.

It will be important to remember that all notes of the *Ma-grama* scale are in their lowest enharmonic positions. Other scales will be created by raising a few notes by a comma.

This *Ma-grama* is the starting point for generating all “optimally consonant” chromatic scales. This is done by transpositions of perfect fifths (up or down). Visualizing transpositions becomes clear if the base scale is drawn on a circular wheel allowed to move inside the outer crown shown above. The following is Arnold’s complete model showing *Ma-Grama* in the basic position producing the “Ma01″ scale:

This positioning of the inner wheel on the outer wheel is called a “transposition” (*murcchana*).

Intervals are shown on the graph. For instance, R3 (“D” = “re”) is a perfect fifth to D3 (“A” = “la”).

The “Ma01″ scale produced by this M1 transposition produces the “A minor” chromatic scale with the following intervals:

C l Db c+m D c+l Eb c+m E c+l F c+m F# c+l G l Ab c+m A c+l Bb c+m B c+l C

- m = minor semitone = 70 cents
- l = limma = 90 cents
- c = comma = 22 cents

This construction of the “A minor” scale is compliant with the western scheme for producing just-intonation chords: the basic note “A” (ratio 5/3) is “LA-1” on the “3_cycles_of_fifths” scale), located in the “major third upward” series as well as its dominant “MI-1”, whereas “C” (ratio 1/1) belongs to the series termed “Pythagorean”.

At first view, the scale constructed by this M1 transposition also resembles a “C major” scale, yet with a different choice of R3 (harmonic “D” ratio 10/9) instead of R4 (Pythagorean “D” ratio 9/8). To produce the “C major” scale, “D” should be raised to its Pythagorean position, which amounts to R4 replacing R3 on Bharata’s model. This is done using an alternate basic scale named “Sa-Grama” in which P4 replaces P3.

P3 is named “*cyuta Pa*” meaning “Pa lowered by one *shruti*” — here a syntonic comma. The wheel representation suggests that other lowered positions may later be highlighted by the transposition process, namely *cyuta Ma* and *cyuta Sa*.

At the bottom of the “Ma01″ page on “-cs.12_scales”, all intervals of the chromatic scale are listed with significant intervals highlighted in color. The wolf fifth is colored in red. Remember that if the scale is optimally consonant only one cell will be colored in red.

A tuning scheme is suggested at the bottom of the “Ma01″ page. It is based on the (purely mechanical) assumption that perfect fifths will be tuned in priority within the limit of 6 steps. Then harmonic major thirds and minor sixths are highlighted, and finally Pythagorean thirds and minor sixths may also be taken into account.

We may use “Ma01″ as a 23-grade microtonal scale in Bol Processor productions because all notes relevant to the chromatic scale have been labelled. However it is more practical to extract a 12-grade scale with only labelled notes. This can be done on the “Ma01″ page. The image shows the exportation of “Cmaj” scale containing 12 grades and a raised position of D.

Using “Cmaj” for the name makes it easy to declare this scale in its specific harmonic context. In the same manner, a 12-grade “Amin” can be exported without raising “D”.

“D” (“re”) is therefore the *sensitive note* when switching between the “C major” scale and its relative “A minor”.

In all 12-grade exported scales it is easy to change the note convention — English, Italian/Spanish/French, Indian or key numbers. It is also possible to select diesis in replacement of flat and vice-versa, given that the machine recognizes both options.

A PowerPoint version of Arnold’s model can be downloaded here and used to check transpositions produced by Bol Processor BP3.

To create successive “optimally consonant” chromatic scales, the *Ma-grama* should be transposed by descending or ascending perfect fifths.

For instance, produce “Ma02″ by transposing “Ma01″ of a perfect fourth “C to F” (see picture). Nothing else needs to be done. All transpositions have been stored in Csound resource “-cs.12_scales”. Each of these scales can then be used to export a minor and a major chromatic scale. This procedure is explained in detail on page Creation of just-intonation scales.

An interesting point raised by James Arnold in our paper *L’intonation juste dans la théorie ancienne de l’Inde : les applications aux musiques modale et harmonique* (1985) is the comparison of minor and major scales of the same tonic, for instance moving from “C major” to “C minor”.

To get the “C minor” scale, we need to create “Ma04″ via four successive descending fifths (or ascending fourths). Be careful that writing “C to F” on the form will not always produce a perfect fourth transposition because the “F to C” interval might be a wolf fifth! This happens when moving from “Ma03″ to “Ma04″. In this case, select for instance “D to G”.

From “Ma04″ we export “Cmin”. Here comes a surprise:

Intervals are the ones predicted (see “A minor” above) but the positions of “G”, “F” and “C” have been lowered by a comma. This was expected for “G” because of the replacement of P4 with P3. The bizarre situation is that both “C” and “F” are located one comma lower than what seemed to be their lowest (or unique) position in the 22-*shruti* model. Authors of *Natya Shastra* had anticipated a similar process when inventing terms “*cyuta Ma*” and “*cyuta Sa*”…

This shift of the base note can be made visual by moving the inner wheel. After 4 transpositions, position M1 of the inner wheel will match position G1 of the outer wheel, yielding the following configuration:

This shift of the tonic was presented as a challenging finding in our paper (Arnold & Bel 1985). Jim Arnold had done experiments with Pierre-Yves Asselin playing Bach’s music on the *Shruti Harmonium* and both liked shifts of the tonic on minor chords.

Pierre-Yves himself mentions a one-comma lowering of “C” and “G” in the “C minor” chord. However, this was one among two options predicted by his theoretical model. He checked it playing the Cantor electronic organ at the University, reporting musicians rated this option as more *pungent* — *“déchirant”* — (Asselin 2000 p. 135-137).

The other option (red on the picture) was that each scale be “aligned” in reference to its base note “C” (“DO”). This alignment (one-comma raising) can be done clicking button “ALIGN SCALE” on scale pages wherever the basic note (“C”) is not at position 1/1. Let us listen to the “C major”/ “C minor” / “C major” sequence, first “non-aligned” then “aligned”:

Clearly, the “non-aligned” version is more *pungent* than the “aligned” one.

This choice is based on *perceptual experience*, namely “*pratyakṣa pramāṇa*” in Indian epistemology — read page The two-vina experiment. We follow an empirical approach rather than searching for an “axiomatic proof”. The question is not which of the two options *shall be true*, but which one produces music that *sounds* *correct*.

The construction of just intonation using the *grama-murcchana* procedure needs to be checked in typical chord sequences such as the “I-IV-II-V-I” series discussed by Pierre-Yves Asselin (2000 p. 131-135):

After trying five options suggested by his theoretical model, the author selected the one preferred by all musicians. They even spontaneously choose this intonation when singing without any specific instruction. In addition, this version is compliant with Zarlino’s “natural scale”.

In the preferred option, tonics “C”, “F” and “G” belong to the Pythagorean series of perfect fifths, except “D” in the “D minor” chord which is one comma lower than in “G major”.

On the picture, triangles whose summit points to the right are major chords, and the one pointing to the left is the “D minor” chord.

Asselin’s conclusion (2000 p. 137) is that *the minor mode is one syntonic comma lower than the major mode*. Conversely, the

This is in full agreement with the model constructed by *grama-murcchana*. Since minor chromatic scales are exported from transpositions of *Ma-grama* with all its grades in the lowest position, their base notes are also driven to the lowest positions. However this requires a scale “adjustment” in the cases of “Ma10″, “Ma11″ and “Ma12″ so that no position is created outside the basic Pythagorean/harmonic scheme of the Indian system. Looking at Asselin’s drawing (above), this means that no position would be picked up in the 2^{nd}-order series of fifths in the rightmost column involving two consecutive ascending major thirds resulting in a lowering of 2 syntonic commas. This process is further explained on page Creation of just-intonation scales.

Let us listen to the production of the “-gr.tryTunings” grammar:

S --> Temp - Just

Temp --> Cmaj Fmaj Dmin Gmaj Cmaj

Just --> _scale(Cmaj,0) Cmaj _scale(Fmaj,0) Fmaj _scale(Dmin,0) Dmin _scale(Gmaj,0) Gmaj _scale(Cmaj,0) Cmaj

Cmaj --> {C3,C4,E4,G4}

Fmaj --> {F3,C4,F4,A4}

Dmin --> {D3,D4,F4,A4}

Gmaj --> {G3,B3,D4,G4}

First we will hear the sequence of chords in equal-tempered intonation, then in just-intonation.

Identity of the last occurrence with Asselin’s favorite choice is marked by frequencies in the Csound score: “D4” in the third chord (D minor) is lower by one comma than “D4” in the fourth chord (G major), whereas all other notes (for instance “F4”) have the same frequencies in the four chords.

To summarize, **the tonic and dominant notes of every minor chord belongs to the “lower”**

Rules setting the relative positions of major and minor modes (see above) only deal with the three notes defining a major or minor chord. Transpositions (*murcchana*-s) of the *Ma-grama* produce basic notes in the same positions, but these are also chromatic (12-grade) scales. Therefore, *they also set up the enharmonic positions of all notes that would be played in this harmonic context*.

Do these comply with just intonation? In theory they do, because the 12 chromatic scales obtained by these transpositions are “optimally consonant”: each of them contains no more than a wolf fifth.

In 1980, James Arnold did experiments to check this theoretical model with my *Shruti Harmonium* producing programmed intervals with 1-cent accuracy. Pierre-Yves Asselin played classical pieces while Jim was manipulating switches on the instrument to select enharmonic variants.

Listen to three versions of an improvisation based on Mozart’s musical dice game. The first one is equal-tempered, the second one uses Serge Cordier’s equal-tempered scale with an extended octave (1204 cents, see Microtonality) and the third one several different scales to render just intonation. To this effect, variables pointing at scales based on the harmonic context have been inserted in the first grammar rules:

S --> _vel(80) Ajust Bjust

Ajust --> Cmaj A1 A2 Gmaj A3 Cmaj A4 Dmaj A5 Cmaj A6 Gmaj A7 A8 Cmaj A1 A2 Gmaj A3 Cmaj A4 Dmaj A5 Cmaj A6 Gmaj A7 A’8

Bjust --> Gmaj B1 Cmaj B2 Dmaj B3 Cmaj B4 Fmaj B5 B6 Gmaj B7 Cmaj B8 Gmaj B1 Cmaj B2 Dmaj B3 Cmaj B4 Fmaj B5 B6 Gmaj B7 Cmaj B8

Cmaj --> _scale(Cmaj,0)

Dmaj --> _scale(Dmaj,0)

Fmaj --> _scale(Fmaj,0)

Gmaj --> _scale(Gmaj,0)

… etc.

At the bottom of pages “-cs.12_scales” and “-cs.Mozart”, all scales are compared for their intervalic content. The comparison is based on fractions where these have been declared, or floating-point frequency ratios otherwise.

The comparison confirms that the “Amin” chromatic scale is identical to “Fmaj”.

Raising “D” in “Ma01″ created “Sa01″, the first transposition of the *Sa-grama* scale. From “Sa01″ we can produce “Sa02″ etc. by successive transpositions (one fourth up). But the comparator shows that “Sa02″ is identical to “Ma01″.

In a similar way, transpositions “Ma13″, “Ma14″ etc. are identical to “Ma01″, “Ma02″ etc. The series of chromatic scales is (as expected) circular because “Ma13″ returns to “Ma01″.

More details about frequencies, block keys etc. may be found on page Microtonality.

This whole page is dedicated to tonal systems defined in terms of integer ratios (i.e. rational numbers) measuring tonal intervals. There existed at least two strong incentives supporting the idea that every “pure” tonal interval should be worked as the ratio of two whole numbers, such as 2/1 for the octave, 3/2 for a “perfect” fifth, 5/4 for a “harmonic” major third etc.

Music history (in the West) dates back to ideas attributed to greek philosopher “Pythagoras” (read above) believing that *all things were made of [rational] numbers*. This approach stumbled on the impossibility of matching the octave to a succession of “perfect fifths”…

As we found out — read above and The Two-vina experiment — this approach was not followed in India despite the fact that Indian scientists were much more advanced than the Greeks with respect to calculus (Raju C.K., 2007).

Another incentive to the use of rational numbers was Hermann von Helmholtz’s notion of *consonance* (1877) which became popular after the period of Baroque music in Europe, following the initial claim of a “natural tonal system” by Jean-Philippe Rameau in his *Traité de l’harmonie réduite à ses principes naturels* (1722). The development of keyboard stringed instruments such as the pipe organ and the pianoforte had made it necessary to design a tuning system meeting the requirements of (approximately) tuneful harmony and transposition for the support of other instruments and human voices. This had made it logical to abandon a great variety of tuning systems — notably the ones based on temperament — and adopt equal temperament as the standard. At this stage, composers no longer explored the subtleties of melodic/harmonic tonal intervals; harmony involving groups of singers and/or orchestra paved the way to musical innovation.

When looking back to the Baroque period, many musicologists tend to believe that the tuning system advocated by J.S. Bach in *The Well-tempered Clavier* must have been equal temperament… This belief can be refuted by a systematic analysis of this corpus of preludes and fugues with an instrument using all tuning procedures en vogue during the Baroque period — read page The Well-tempered Clavier.

Composers and instrument designers did not tune “by numbers”, as tuning procedures were not documented on that model (read Asselin P-Y., 2000). They rather tuned “by ear” in order to achieve a perceived regularity of sets of intervals: temperament in general. This was indeed a breach with the “Pythagorean” mystique because these temperaments cannot be reduced to frequency intervals based on integer ratios.

For instance, *Zarlino’s meantone temperament* — read this page — is made of 12 fifths starting from “E♭” (“mi♭”) up to “G#” (“sol#”) diminished by 2/7 of a syntonic comma (ratio 81/80). The frequency ratio of each fifth is therefore

`\[\ \frac{3}{2}\left(\frac{80}{81}\right)^{\frac{2}{7}}=\ 1.5\ x\ 0.99645\dots\ =\ 1.4946\dots\ \left(or\ 695.81\dots\ cents\right)\]`

which cannot be reduced to an integer ratio. Likewise, the twelve intervals of the equal-tempered scale are expressed by irrational frequency ratios.

The goal of *just intonation* is to produce “optimally consonant” chords and note sequences, a legitimate approach when consonance is the touchstone of the highest achievement in art music. This was indeed the case of sacred music aiming at a “divine perfection” ensured by the absence of “wolf tones” and other oddities. However, from a broader viewpoint, music is also the field of both *expectation* and *surprise*. In an artistic process, this may imply deviations from “rules” — the same way poetry requires a breach of semantic and syntactic rules of a language…

Even when chords are perfectly consonant and compliant with rules of harmony (perceived by the composer), note sequences might deviate from their theoretical positions in order to create a certain degree or tension or to manage a better transition to the next chord.

When Greek-French composer Iannis Xenakis — well-known for his formalized approach of tonality — listened to Bach’s *First prelude for Well-Tempered Clavier* played in just intonation on the *Shruti Harmonium*, he told his preference for the equal-tempered version! This made sense for a composer whose music had been praised by Tom Service for its *“deep, primal rootedness in richer and older phenomena even than musical history: the physics and patterning of the natural world, of the stars, of gas molecules, and the proliferating possibilities of mathematical principles”* (Service T, 2013).

Bernard Bel — Dec. 2020 / Jan. 2021

Arnold, E.J.; Bel, B. *L’intonation juste dans la théorie ancienne de l’Inde : ses applications aux musiques modale et harmonique.* Revue de musicologie, JSTOR, 1985, 71^{e} (1-2), p.11-38.

Asselin, P.-Y. *Musique et tempérament*. Paris, 1985, republished in 2000: Jobert. *Soon available in English.*

Bel, B. A Mathematical Discussion of the Ancient Theory of Scales according to Natyashastra. Note interne, *Groupe Représentation et Traitement des Connaissances* (CNRS), March 1988a.

Bel, B. *Raga : approches conceptuelles et expérimentales*. Actes du colloque “Structures Musicales et Assistance Informatique”, Marseille 1988b.

Rao, S.; Van der Meer, W. *The Construction, Reconstruction, and Deconstruction of Shruti*. Hindustani music: thirteenth to twentieth centuries (J. Bor). New Delhi, 2010: Manohar.

Raju, C. K. *Cultural foundations of mathematics : the nature of mathematical proof and the transmission of the calculus from India to Europe in the 16 ^{th} c. CE*. Delhi, 2007: Pearson Longman: Project of History of Indian Science, Philosophy and Culture : Centre for Studies in Civilizations.

Service, T. *A guide to Iannis Xenakis’s music*. The Guardian, 23 April 2013.

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.

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 3^{d} harmonic of the lowest vibration is at the same frequency as the 2^{nd} 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).

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 9^{th} note in the 8^{th} 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.

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.

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 16^{th} and 17^{th} 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!

Let us try Zarlino’s meantone temperament (Asselin 2000 p. 85-87) which became popular in the 16^{th} and 17^{th} 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…

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”:

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.

1^{st} 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 *2 ^{nd}-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#”.

2^{nd} 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 5^{2}/3/2^{3}, the one expected in Zarlino’s meantone temperament (Asselin 2000 p. 194).

3^{d} 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.

4^{th} 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.

5^{th} 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 (3^{d} 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).

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 16

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 (16^{th}-17^{th} 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 18^{th} 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.

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

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 page Comparing temperaments.

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

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

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 2^{11} = 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).

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 *shruti*s 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.

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 n^{2}/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 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 9^{th} pitch-class or the 8^{th} 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.

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.*

The following are simple examples explaining the design of Csound scores containing instructions to control parameters that may vary continuously. We will use simple notes (no sound-object) and no Csound instruments file so that all scores may be easily converted to sound files using the “default.orc” orchestra file supplied with BP3.

Consider the following grammar with a metronome setting of 60 beats/mn:

S --> _pitchcont _pitchrange(200) C5 _pitchbend(0) D5 _ _pitchbend(120) _ _pitchbend(-150) _ _ _pitchbend(0) E5

The graphic display does not show pitchbend controls:

Instruction _pitchcont in the beginning instructs the interpreter to interpolate pitchbend values in the whole sequence. This process may be interrupted by _pitchstep.

Instruction _pitchrange(200) indicates that the pitch may vary between -200 and +200 units, respectively mapped to MIDI standard values 0 and +16383 (both logarithmic). This is the range required by “default.orc” in which intervals are measured in cents. There are 1200 cents in one octave. Thus, _pitchbend(100) would raise the following note by a semitone.

Note ‘C5’ is not assigned a pitchbend value. Default “0” value will be assigned. Notes ‘D5’ and ‘E5’ are preceded with _pitchbend(0) assigning a “0” value. All pitchbend variations are assigned during the prolongation of ‘D5’. How will it be taken care of?

The MIDI output is deceptive. Such pitchbend assignments are not taken into account in this format:

However, the Csound output has taken into account all parameters:

How does Csound process this phrase? Let us look at the Csound score:

t 0.000 60.000

i1 0.000 1.000 9.00 90.000 90.000 0.000 0.000 0.000 0.000 ; C5

f101 1.000 256 -7 0.000 102 120.000 51 -150.000 103 0.000

i1 1.000 5.000 9.02 90.000 90.000 0.000 0.000 0.000 101.000 ; D5

i1 6.000 1.000 9.04 90.000 90.000 0.000 0.000 0.000 0.000 ; E5

s

e

A table (*Function Table Statement*, read documentation) labeled f101 has been created by Bol Processor and inserted above ‘D5’ to specify variations of the pitchbend parameter. This table is called by the 10^{th} argument of line ‘D5’. Arguments 8 and 9 contain the start and end values of pitchbend according to “default.orc”. These are 0 for all three notes.

The second argument of the table is the duration of its validity, here 1.000 seconds. The third argument (256) is its size — always a power of 2. The fourth argument “-7” designates the GEN routine that Csound will use for its interpolation (read documentation). By default, **GEN07** (*linear interpolation*) is used.

Numbers highlighted in red indicate the values of pitchbend during the variation: 0, 120, -150, 0. Values in black indicate the time intervals between two values. Note that 102 + 51 + 103 = 256.

All continuous parameters are handled in this same way by Bol Processor when producing Csound scores. This includes standard MIDI controls (volume, pressure, modulation, panoramic, pitchbend) and any additional parameter defined in the Csound instruments file. See for example Sarasvati Vina.

There is a workaround for playing the same piece with correct pitchbend changes in MIDI. Change the rule to:

S --> _pitchcont _pitchrange(200) {C5 D5 _ _ _ _ E5, - _pitchbend(0) - _ _pitchbend(120) - _pitchbend(-150) - _ _pitchbend(0) -}

This is the same piece in a polymetric structure adding a line of silences ‘-‘ put at the right places to receive pitchbend modifications. Since pitchbend modifies all sounds on the current MIDI channel it will also modify ‘D5’ during its prolongation. The following is a MIDI rendering on *PianoTeq* — at a higher speed so that ‘D5’ remains audible:

This page deals with Bol Processor BP3 making use of an updated version of Csound orchestra file “default.orc”. Now, modifications of the diapason (‘A4’ frequency) in the Settings have an influence on the production of Csound scores.

In the revised Csound orchestra file, a few lines have been added to modify the value of icps (frequency of the oscillator) according to that of argument p4:

if (p4 < 15.0) then

icps = cpspch(p4)

else icps = p4

endif

By default, this instrument receives the pitch value (argument p4) in the *octave point pitch-class* format — read documentation. In this case, the frequency depends exclusively on the diapason set up in the Csound orchestra, or 440 Hz by default, meaning cpspch(8.09) = 440.

In order to “tune” the Csound instrument to the diapason chosen for the project in Bol Processor BP3, if the base frequency is not exactly 440 Hz then p4 will contain the actual frequency of the note (*cps* format) instead of its *octave point pitch-class* value. Orchestra file “default.orc” is able to decide which format has been used because (1) no note is ever sent beyond the 14^{th} octave and (2) frequencies are never lower than 15 Hz. Thus, the value of p4 automatically makes the decision in “default.orc”.

Let us try for example:

S --> A4 B4 C5

When the diapason is 440 Hz we get the standard 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 diapason 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 displays actual frequencies of notes, for instance ‘A4’ = 435 Hz. This tonal sequence will sound slightly lower than the preceding one.

If the diapason is radically different from 440 Hz, the names of notes will not differ. Only frequencies will be modified accordingly. See for instance the Csound score produced 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 examine changes of diapason when dealing with Csound objects. Take for instance object “a” in “-gr.tryCsoundObjects”. The Csound score of its prototype (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 format whereas instrument i3 uses the direct cps format. This score has been created with ‘A4’ = 440 Hz which explains why 643.5 Hz is labelled D#5. *The labeling of notes is of minor importance as it will be revised when creating the performance Csound score.*

When ‘A4’ = 440 Hz the Csound score of a performance of “a” reflects precisely 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 diapason is set to 500 Hz the Csound score of the performance 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

All pitches are now specified in the *cps* format. The pitches of notes F0 and F1 would be modified in the sound output. However, the pitch of instrument i3 would stay at 643.50 Hz as this had been set up in the sound-object’s prototype. Consequently, given the change of reference, the name of the note produced by i3 would now be ‘C#5’. This change is reflected in the pianorolls (see picture).

This automatic selection of the pitch format does not work when attempting to send a frequency lower than 15 Hz, as it would be the case for ‘F0’ in the preceding example if the diapason was set to 300 Hz. However this should normally never happen because 15 Hz is below the range of audible sounds.

At the opposite end, octaves beyond 14 are way beyond the musical range since ‘C15’ is already more than 535 KHz…

This might have an incidence on Csound scores being used for producing anything else than music, although in this case the use of *octave point pitch-class* format is very unlikely.

“Middle C”, or ‘C4’ in the English convention, designates the key at the middle of a piano keyboard. By convention, its MIDI key number is 60, but this value can be modified in the settings.

For instance, setting ‘C4’ to key #48 results in all notes one octave (12 semitones) lower on a MIDI device. However, this does not modify the Csound sound output. Playing “A4 B4 C5″ with ‘C4’ different from 60 produces the same sound output 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, changing ‘C4’ to a key number different from 60 also does not change note names nor their actual frequencies, but the *cps* pitch format is used. For instance, the performance of “a” yields the following 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

The following short examples illustrate the usage of specific controls of the inference mechanism in grammars of Bol Processor (BP2 and BP3).

This instruction is useful in pattern grammars containing repetition and pseudo-repetition markers. For instance, the following grammar creates a sequence of two occurrences of variable “X” which may further be derived as “abc” or “de”.

S --> (= X)(: X)

X --> abc

X --> de

In the first rule, (= ) is called a *master parenthesis* and (: ) a *slave parenthesis* — containing a copy of the former. This master-slave dependency is maintained throughout subsequent derivations.

The only eligible final derivations would be “abcabc” or “dede”. However, the final string would be displayed for instance “(= abc)(: abc)”. To obtain a usable string in which ‘a’, ‘b’, ‘c’ may be further instantiated as sound-objects, it is necessary to remove structural markers. The Bol Processor does it automatically once the final string has been created, i.e. there are no more candidate rules for further derivations. However, the user may want to display strings without their markers. Instruction **_destru** is used to this effect.

Let us consider for instance “-gr.tryDESTRU”:

-se.tryDESTRU

-ho.abc

// This grammar produces various patterns on alphabet …

RND

gram#1[1] <2-1> **S** --> (= (= X) **S** (:X)) (: (= X) S (:X))

gram#1[2] <2-1> X --> Y

gram#1[3] <2-1> X --> Y S Z

gram#1[4] <2-1> X --> Z

ORD

gram#2[1] LEFT S --> lambda [This is an erasing rule]

LIN**_destru**

gram#3[1] X X --> abca

gram#3[2] Z Y --> abc

gram#3[3] Y Z --> cba

gram#3[4] Y Y --> cbbc

gram#3[5] Z Z --> lambda [This is an erasing rule]

The first rule in subgrammar #1 creates a self-embedding pattern in which the start symbol S is created again recursively. This recursivity might produce unlimited strings. To avoid this, each rule in subgrammar #1 is assigned initial weight “2” decreased by “1” once the rule has been fired. Therefore, no rule may be used more than 2 times. Subgrammar #2 contains a single rule deleting the left-over “S”.

Subgrammar #3 destroys the structure by erasing all parentheses and master/slave markers, then it rewrites variables “X”, “Y”, “Z” as strings of terminal symbols. Tracing the production shows for instance that workstring

(=(= Z)(=(= Y)(: Y))(:(= Y)(: Y))(: Z))(:(= Z)(=(= Y)(: Y))(:(= Y)(: Y))(: Z))

is replaced with “Z Y Y Y Y Z Z Y Y Y Y ZZ Y Y Y Y Z Z Y Y Y Y Z”.

Rewriting is then done strictly from left to right due to the **LIN** instruction.

The following is a series of 10 items produced by this grammar:

abccbbccbaabccbbccba

cbacbacbacbacbacbacbacbacbacbacbacba

abccbbccbaabccbbccba

cbaabccbaabc

cbacbacbacbacbacbacbacbacbacbacbacba

abcabcabcabcabcabcabcabc

abcabcabcabcabcabcabcabc

cbbcabcabcabccbbcabcabcabccbbcabcabcabccbbcabcabcabc

cbacbacbacba

cbbccbbccbacbbccbbccbacbbccbbccbacbbccbbccba

Complex patterns are visible on the following sound rendering of the first item using “-mi.abc” sound-object prototypes.