The two-vina experiment

    

This arti­cle ana­lyzes the two-vina exper­i­ment as a thought exper­i­ment, explor­ing how ancient Indian schol­ars con­cep­tu­al­ized musi­cal inter­vals and scales with­out numer­i­cal val­ues. It dis­cuss­es the his­tor­i­cal con­text, con­trast­ing Indian math­e­mat­i­cal and philo­soph­i­cal tra­di­tions with Western per­spec­tives, and pro­pos­es an alge­bra­ic inter­pre­ta­tion of the exper­i­ment to under­stand its impli­ca­tions for tun­ing sys­tems and micro­tonal­i­ty. The arti­cle also high­lights the sig­nif­i­cance of cir­cu­lar rep­re­sen­ta­tions in Indian music and the epis­te­mo­log­i­cal pref­er­ence for empir­i­cal evi­dence in ancient Indian thought.

The first six chap­ters of Natya Shastra, a Sanskrit trea­tise on music, dance and dra­ma dat­ing from between 400 BCE and 200 CE, con­tain the premis­es of a scale the­o­ry that has long attract­ed the atten­tion of schol­ars in India and the West. Early inter­pre­ta­tions by Western musi­col­o­gists fol­lowed the "dis­cov­ery" of the text in 1794 by the philol­o­gist William Jones. Hermann Helmholtz’s the­o­ry of "nat­ur­al con­so­nance" gave way to many com­par­a­tive spec­u­la­tions based on phe­nom­e­na that Indian authors had ear­li­er observed as inher­ent in the "self-production" (svayamb­hū) of musi­cal notes (Iyengar 2017 p. 8).

Suvarnalata Rao and Wim van der Meer (2009) pub­lished a detailed account of attempts to elu­ci­date the ancient the­o­ry of musi­cal scales in the musi­co­log­i­cal lit­er­a­ture, return­ing to the notions of ṣru­ti and swara which have changed over time up to present-day musi­cal practice.

Accurate set­tings of Bel's Shruti Harmonium (1980)

In the sec­ond half of the 20th cen­tu­ry, exper­i­men­tal work with fre­quen­cy meters led to con­tra­dic­to­ry con­clu­sions from the analy­sis of small sam­ples of musi­cal per­for­mances. It was only after 1981 that sys­tem­at­ic exper­i­ments were car­ried out in India by the ISTAR team (E.J. Arnold, B. Bel, J. Bor and W. van der Meer) with an elec­tron­i­cal­ly pro­gram­ma­ble har­mo­ni­um (the Shruti Harmonium) and lat­er with a "micro­scope" for melod­ic music, the Melodic Movement Analyser (MMA) (Arnold & Bel 1983, Bel & Bor I985), which fed pre­cise pitch data into a com­put­er to process hours of music select­ed from his­tor­i­cal recordings.

After sev­er­al years of exper­i­men­tal work, it had become clear that although the into­na­tion of Indian clas­si­cal music is far from being a ran­dom process, it would be dan­ger­ous to judge an inter­pre­ta­tion of the ancient scale the­o­ry on the basis of today's musi­cal data. There are at least three rea­sons for this:

  1. There are an infi­nite num­ber of valid inter­pre­ta­tions of the ancient the­o­ry, as we will show.
  2. The con­cept of raga, the basic prin­ci­ple of Indian clas­si­cal music, first appeared in lit­er­a­ture around 900 CE in Matanga's Brihaddeshi and under­went grad­ual devel­op­ment until the 13th cen­tu­ry, when Sharangadeva list­ed 264 ragas in his Sangitratnakara.
  3. Drones were (prob­a­bly) not in use at the time of Natya Shastra; the influ­ence of the drone on into­na­tion is con­sid­er­able, if not dom­i­nant, in con­tem­po­rary music performance.

The ancient Indian the­o­ry of scales remains use­ful for its insight into ear­ly melod­ic clas­si­fi­ca­tion (the jāti sys­tem), which may lat­er have giv­en rise to the raga sys­tem. It is there­fore best thought of as a topo­log­i­cal descrip­tion of tonal struc­tures. Read Raga Intonation for a more detailed account of the­o­ret­i­cal and prac­ti­cal issues.

The sub­ject of this page is an inter­pre­ta­tion of the exper­i­ment of the two vinas described in Chapter XXVIII.24 of the Natya Shastra. An analy­sis of the under­ly­ing mod­el has been pub­lished in A Mathematical Discussion of the Ancient Theory of Scales accord­ing to Natyashastra (Bel 1988) which the fol­low­ing pre­sen­ta­tion will make more comprehensive.

The historical context

Bharata Muni, the author(s) of the Natya Shastra, may have heard of the the­o­ries of musi­cal scales attrib­uted to the "ancient Greeks". At any rate, Indian schol­ars were able to bor­row these mod­els and extend them con­sid­er­ably because of their real knowl­edge of arithmetic.

Readers of C.K. Raju — espe­cial­ly his excel­lent Cultural Foundations of Mathematics (2007) — know that Indian mathematicians/philosophers are not only famous for invent­ing posi­tion­al nota­tion which took six cen­turies to be adopt­ed in Europe… They also laid out the foun­da­tions of cal­cu­lus and infin­i­tes­i­mals, which were lat­er export­ed to Europe by Jesuit priests from Kerala and borrowed/appropriated by European schol­ars (Raju 2007 pages 321-373).

The cal­cu­lus first devel­oped in India as a sophis­ti­cat­ed tech­nique to cal­cu­late pre­cise trigono­met­ric val­ues need­ed for astro­nom­i­cal mod­els. These val­ues were pre­cise to the 9th place after the dec­i­mal point; this pre­ci­sion was need­ed for the cal­en­dar, crit­i­cal to monsoon-driven Indian agri­cul­ture […]. This cal­cu­la­tion involved infi­nite series which were summed using a sophis­ti­cat­ed phi­los­o­phy of ratios of inex­pressed num­bers [today called ratio­nal functions…].

Europeans, how­ev­er, were prim­i­tive and back­ward in arith­meti­cal cal­cu­la­tions […] and bare­ly able to do finite sums. The dec­i­mal sys­tem had been intro­duced in Europe by Simon Stevin only at the end of the 16th c., while it was in use in India since Vedic times, thou­sands of years earlier.

C. K. Raju (2013 p. 161- 162)

This may be cit­ed in con­trast with the state­ments of west­ern his­to­ri­ans, among which:

The his­to­ry of math­e­mat­ics can­not with cer­tain­ty be traced back to any school or peri­od before that of the Greeks […] though all ear­ly races knew some­thing of numer­a­tion […] and though the major­i­ty were also acquaint­ed with the ele­ments of land-surveying, yet the rules which they pos­sessed […] were nei­ther 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.

So, it may seem para­dox­i­cal, giv­en such an intel­lec­tu­al bag­gage, to write an entire chap­ter on musi­cal scales with­out a sin­gle num­ber! In A Mathematical Discussion of the Ancient Theory of Scales accord­ing to Natyashastra I showed a min­i­mal rea­son: Bharata's descrip­tion leads to an infi­nite set of solu­tions that should be for­malised with alge­bra rather than a set of numbers.

The experiment

The author(s) of Natya Shastra invite(s) the read­er to take two vina-s (plucked stringed instru­ments) and tune them on the same scale.

A word of cau­tion to clar­i­fy the con­text: this chap­ter of Natya Shastra can be read as a thought exper­i­ment rather than a process involv­ing phys­i­cal objects. There is no cer­tain­ty that these two vina-s ever exist­ed — and even that "Bharata Muni", the author/experimenter, was a unique per­son. His/their approach is one of val­i­da­tion (pramāņa) by empir­i­cal evi­dence, in oth­er words dri­ven by the phys­i­cal­ly man­i­fest (pratyakşa) rather than inferred from "axioms" con­sti­tu­tive of a the­o­ret­i­cal mod­el. This can be summed up as a "pref­er­ence for physics over metaphysics".

Constructing and manip­u­lat­ing vina-s in the man­ner indi­cat­ed by the exper­i­menter appears to be an insur­mount­able tech­no­log­i­cal chal­lenge. This has been dis­cussed by a num­ber of authors — see Iyengar (2017 pages 7-sq.) Leaving aside the pos­si­bil­i­ty of prac­ti­cal real­i­sa­tion is not a denial of phys­i­cal real­i­ty, as for­mal math­e­mat­ics would sys­tem­at­i­cal­ly dic­tate. Calling it a "thought exper­i­ment" is a way of assert­ing the con­nec­tion with the phys­i­cal mod­el. Similarly, the use of cir­cu­lar graphs to rep­re­sent tun­ing schemes and alge­bra to describe rela­tion­ships between inter­vals are aids to under­stand­ing that do not reduce the mod­el to spe­cif­ic, ide­al­is­tic inter­pre­ta­tions sim­i­lar to the spec­u­la­tions about inte­gers cher­ished by Western sci­en­tists. These graphs are intend­ed to facil­i­tate the com­pu­ta­tion­al design of instru­ments that mod­el these imag­ined instru­ments — see Raga into­na­tion and Just into­na­tion, a gen­er­al frame­work.

Let us fol­low Bharata's instruc­tions and tune both instru­ments to a scale called "Sa-grama" about which the author explains:

The sev­en 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 tempt­ing to iden­ti­fy this scale as the con­ven­tion­al west­ern seven-degree scale do, re, mi, fa, sol, la, si ("C", "D", "E", "F", "A", "B"), which some schol­ars have done despite the erro­neous inter­pre­ta­tion of the intervals.

Intervals are notat­ed in shru­ti-s, which can be thought of as an order­ing device rather than a unit of mea­sure­ment. Experiment will con­firm that a four-shru­ti inter­val is greater than a three-shru­ti, a three-shru­ti greater than a two-shru­ti and the lat­ter greater than a sin­gle shru­ti. In dif­fer­ent con­texts, the word "shru­ti" refers to note posi­tions rather than inter­vals between notes. This ambi­gu­i­ty is also a source of confusion.

The author writes:

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

Bharata uses 9-shru­ti (con­so­nant) inter­vals: "Sa-Pa", "Sa-Ma", "Ma-Ni", "Ni-Ga" and "Re-Dha". He also defines anoth­er scale called "Ma-grama" in which "Pa" is one shru­ti low­er than "Pa" in the Sa-grama, so that "Sa-Pa" is no longer con­so­nant where­as "Re-Pa" is con­so­nant because it is made up of 9 shru­ti-s.

Intervals of 9 or 13 shru­ti-s are declared "con­so­nant" (sam­va­di). Ignoring the octave, the best con­so­nance in a musi­cal scale is the per­fect fifth with a fre­quen­cy ratio close to 3/2. When tun­ing stringed instru­ments, a ratio oth­er than 3/2 will pro­duce beats indi­cat­ing that a string is out of tune.

Sa-grama and Ma-grama accord­ing to Natya Shastra. Red and green seg­ments indi­cate the two chains of per­fect fifths. Underlined note names denote 'flat' positions.

If the fre­quen­cy ratios are expressed log­a­rith­mi­cal­ly with 1200 cents rep­re­sent­ing an octave, and fur­ther con­vert­ed to angles with a full octave on a cir­cle, the descrip­tion of the Sa-grama and Ma-grama scales can be sum­marised on a cir­cu­lar dia­gram (see figure).

Two cycles of fifths are high­light­ed in red and green col­ors. Note that both the "Sa-Ma" and "Ma-Ni" inter­vals are per­fect fifths, which dis­cards the asso­ci­a­tion of Sa-grama with the con­ven­tion­al west­ern scale: the "Ni" should be mapped to "B flat", not to "B". Furthermore, the per­fect fifth "Ni-Ga" implies that "Ga" is also "E flat" rather than "E". The Sa-grama and Ma-grama scales are there­fore "D modes". This is why "Ga" and "Ni" are under­lined in the diagrams.

Authors eager to iden­ti­fy Sa-grama and Ma-grama as a west­ern scale have claimed that when the text says that there are "3 shruti-s in Re" it should be under­stood as between Re and Ga. However, this inter­pre­ta­tion is incon­sis­tent with the sec­ond low­er­ing of the mov­able vina (see below).

We must avoid jump­ing to con­clu­sions about the inter­vals in these scales. The two cycles of fifths are unre­lat­ed, except that the "dis­tance" between the "Pa" of Ma-grama and that of Sa-grama is "one shru­ti":

The dif­fer­ence which occurs in Pañcama when it is raised or low­ered by a Śruti and when con­se­quen­tial slack­ness or tense­ness [of strings] occurs, will indi­cate a typ­i­cal (pramāņa) Śruti. (XXVIII, 24)

In oth­er words, the size of this pramāņa ṣru­ti is not spec­i­fied. It would there­fore be mis­lead­ing to pos­tu­late its equiv­a­lence to the syn­ton­ic com­ma (fre­quen­cy ratio 81/80). To do so reduces Bharata's mod­el to "just into­na­tion", indeed with inter­est­ing prop­er­ties in its appli­ca­tion to west­ern har­mo­ny (see page), but with a ques­tion­able rel­e­vance to the prac­tice of Indian music. As stat­ed by Arnold (1983 p. 39):

The real phe­nom­e­non of into­na­tion in Hindustani Classical Music as prac­tised is much more amor­phous and untidy than any geom­e­try of course, as recent empir­i­cal stud­ies by Levy (1982), and Arnold and Bel (1983) show.

The des­ig­na­tion of the small­est inter­val as "pramāņa ṣru­ti" is of great epis­temic impor­tance and deserves a brief expla­na­tion. The seman­tics of "slack­ness or ten­sion" clear­ly belong to "pratyakṣa pramāṇa", the means of acquir­ing knowl­edge through per­cep­tu­al expe­ri­ence. More pre­cise­ly, "pramāṇa" (प्रमाण) refers to "valid per­cep­tion, mea­sure and struc­ture" (Wisdom Library), a notion of evi­dence shared by all tra­di­tion­al Indian schools of phi­los­o­phy (Raju 2007 page 63). We will return to this notion in the conclusion.

An equiv­a­lent way of con­nect­ing the two cycles of fifths would be to define a 7-shru­ti inter­val, for exam­ple "Ni-Re". If the pramāņa ṣru­ti were a syn­ton­ic com­ma then this inter­val would be a har­mon­ic major third with a ratioof 5/4. As men­tioned in Just into­na­tion, a gen­er­al frame­work, the inven­tion of the major third as a con­so­nant inter­val dates back to the ear­ly 16th cen­tu­ry in Europe. In Natya Shastra this 7-shru­ti inter­val was clas­si­fied as "asso­nant" (anu­va­di).

In all writ­ings refer­ring to the ancient Indian the­o­ry of scales, I have occa­sion­al­ly used "pramāņa ṣru­ti" and "syn­ton­ic com­ma" as equiv­a­lent terms. This is accept­able if one accepts that the syn­ton­ic com­ma can take val­ues oth­er than 81/80. Consequently, the "har­mon­ic major third" should not auto­mat­i­cal­ly be assigned a fre­quen­cy ratio of 5/4.

The pic­ture above shows the two vina-s tuned iden­ti­cal­ly on Sa-grama. Matching notes are marked with yel­low dots. The inner part of the blue cir­cle will be the mov­ing vina in the fol­low­ing trans­po­si­tions, and the out­er part the fixed vina.

First lowering

Bharata writes:

The two Vīņās with beams (danḍa) and strings of sim­i­lar mea­sure, and with sim­i­lar adjust­ment of the lat­ter in the Şaḍja Grāma should be made [ready]. [Then] one of these should be tuned in the Madhyama Grāma by low­er­ing 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 short, this is a pro­ce­dure for low­er­ing all the notes of the mov­able vina by one pramāņa ṣru­ti. First low­er its "Pa" — e.g. make it con­so­nant with the "Re" of the fixed vina — to obtain Ma-grama on the mov­able vina. Then read­just its entire scale to obtain Sa-grama. Note that low­er­ing "Re" and "Dha" means revalu­ing the size of a pramāņa ṣru­ti while main­tain­ing the 'Re-Dha' con­so­nant inter­val. The result is as follows:

The two vinas after a low­er­ing of pramāņa ṣru­ti

The pic­ture illus­trates the fact that there is no longer a match between the two vina-s.

Interpreting shruti-s as vari­ables in some metrics

This sit­u­a­tion can be trans­lat­ed into alge­bra. Let "a", "b", "c" … "v" be the unknown sizes of the shru­ti-s in the scale (see pic­ture on the side). A met­ric that "trans­lates" Bharata's mod­el will be nec­es­sary to test it on sound struc­tures pro­duced by an elec­tron­ic instru­ment — the com­put­er. The scope of this trans­la­tion remains valid as long as no addi­tion­al asser­tion is made that is not root­ed in the orig­i­nal model.

Using the sym­bol "#>" to indi­cate that two notes do not match, this first low­er­ing can be sum­marised by the fol­low­ing set of inequalities:

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

Second lowering

The next step is anoth­er low­er­ing by one shru­ti using a dif­fer­ent procedure.

Again due to the decrease of a Śruti in anoth­er [Vīņā], Gāndhāra and Nişāda will merge with Dhaivata and Ṛşbha respec­tive­ly, when there is an inter­val of two Śrutis between them.

Note that it is no longer pos­si­ble to rely on a low­ered "Pa" to eval­u­ate a pramāņa ṣru­ti for the low­er­ing. The instruc­tion is to low­er the tun­ing of the mov­able vina until either "Re" and "Ga" or "Dha" and "Ni" merge, which is claimed to be the same because of the final low­er­ing of two shru­ti-s (from the ini­tial state):

The two vina-s after the sec­ond low­er­ing (2 shru­ti-s)

Now we have an equa­tion which tells us that the two-shru­ti inter­vals are equal in size:

q + r = d + e

and five more inequa­tions indi­cat­ing the non-matching of oth­er 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 bear in mind that the author is describ­ing a phys­i­cal process, not an abstract "move­ment" by which the mov­ing wheel (or vina) would "jump" in space from its ini­tial to final posi­tion. Therefore, we pay atten­tion to what hap­pens and what does not hap­pen dur­ing the tun­ing of the vina or the rota­tion of the wheel by look­ing at the tra­jec­to­ries of the dots rep­re­sent­ing the note posi­tions (along the blue cir­cle). Things that do not hap­pen (mis­matched notes) give rise to inequa­tions that are nec­es­sary to make sense of the alge­bra­ic model.

This step of the exper­i­ment con­firms that it is wrong to place Sa in the posi­tion of Ni in order to iden­ti­fy Sa-grama with the Western scale. In this case the cor­re­spond­ing notes would not be Re-Ga and Dha-Ni, but Ga-Ma and Ni-Sa.

Third lowering

Bharata writes:

Again due to the decrease of a Śruti in anoth­er [Vīņā], Ṛşbha and Dhaivata will merge with Şaḍja and Pañcama respec­tive­ly, when there is an inter­val of three Śrutis between them.

The two vinas after the third low­er­ing (3 shruti-s)

This leads to equation

n + o + p = a + b + c

and inequa­tions:

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

Fourth lowering

The pro­ce­dure:

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

The two vinas after the fourth low­er­ing (4 shruti-s)

This yields 2 equations:

j + k + l + m = f + g + h + i
s + t + u + v = f + g + h + i

Algebraic interpretation

After elim­i­nat­ing redun­dant equa­tions and inequa­tions, the con­straints are sum­marised 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 inequa­tions illus­trate the fact that the num­bers of shru­ti-s denote an order­ing of the sizes of the inter­vals between notes.

We still have 22 vari­ables and only 4 equa­tions. These vari­ables can be "packed" into a set of 8 vari­ables rep­re­sent­ing the "macro-intervals", i.e. the steps of the gra­ma-s. In this approach the shru­ti-s are a kind of "sub­atom­ic" par­ti­cles of which these "macro-intervals" are made… Now we need only 4 aux­il­iary equa­tions to deter­mine the scale. These can be pro­vid­ed by acoustic infor­ma­tion where the inter­vals are count­ed in cents. First we express that the sum of the vari­ables, the octave, is equal to 1200 cents. (A larg­er val­ue, e.g. 1204, could be used to devise extend­ed octaves).

(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 inter­pret all sam­va­di ratios as per­fect 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)

includ­ing the "Re-Pa" per­fect fifth in Ma-grama:

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

S10, S11 and S12 can all be derived from S9. So these equa­tions can be dis­card­ed. We still need one more equa­tion to solve the sys­tem. At this stage there are many options in terms of tun­ing pro­ce­dures. As sug­gest­ed above, set­ting the har­mon­ic major third to the ratio 5/4 (386.3 cents) would pro­vide the miss­ing equa­tion. This is equiv­a­lent to set­ting the vari­able "m" to 21.4 cents (syn­ton­ic com­ma). However, this major third can be 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 exper­i­ment is no longer valid, but it leaves a large num­ber of pos­si­bil­i­ties, includ­ing the tem­pera­ment of some inter­vals, which musi­cians might spon­ta­neous­ly achieve in par­al­lel melod­ic move­ments. A num­ber of solu­tions are pre­sent­ed in A Mathematical Discussion of the Ancient Theory of Scales accord­ing to Natyashastra, and some of these have been tried on the Bol Processor to check musi­cal exam­ples for which they might pro­vide ade­quate scales — see Raga into­na­tion.

Extensions of the model

To com­plete his sys­tem of scales, Bharata need­ed to add two new notes to the basic gra­ma-s: antara Gandhara and kakali Nishada. The new "Ga" is defined as "G" raised by 2 shru­ti-s. Similarly, kakali Ni is "N" raised by 2 shru­ti-s.

In order to posi­tion "Ni" and "Ga" cor­rect­ly we must study the behav­iour of the new scale in all trans­po­si­tions (mur­ccha­na-s), includ­ing those begin­ning with "Ga" and "Ni", and derive equa­tions cor­re­spond­ing to an opti­mal con­so­nance of the scale. We end up with 11 equa­tions for only 10 vari­ables, which means that this per­fec­tion can­not be achieved. One con­straint must be released.

One option is to release the con­straints on major thirds, fifths or octaves, result­ing in a form of tem­pera­ment. For exam­ple, stretch­ing the octave by 3.7 cents pro­duces per­fect fifths (701.9 cents) and har­mon­ic major thirds close to equal tem­pera­ment (401 cents) with a com­ma of 0 cents. This tun­ing tech­nique was advo­cat­ed by Serge Cordier (Asselin 2000 p. 23; Wikipedia).

An equal-tempered scale with octave stretched at 1204 cents. (Image cre­at­ed by Bol Processor BP3)

Another option is to get as close as pos­si­ble to "just into­na­tion" with­out chang­ing per­fect fifths and octaves. This is pos­si­ble by allow­ing the com­ma (vari­able "m") to take any val­ue between 0 and 56.8 cents. Limits are imposed by the inequa­tions derived from the two-vina experiment.

These "just sys­tems" are cal­cu­lat­ed 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 (lim­ma = 256/243), Maj = 203.9 cents (major who­le­tone = 9/8)
and 0 < C < 56.8 (pramāņa ṣru­ti or syn­ton­ic comma)

This leads to the 53-degree scale called "grama" which we use as a frame­work for con­so­nant chro­mat­ic scales suit­able for pure into­na­tion in west­ern har­mo­ny when the syn­ton­ic com­ma is sized 81/80. Read Just into­na­tion, a gen­er­al frame­work:

The "gra­ma" scale used for just into­na­tion, with a syn­ton­ic com­ma of 81/80. Pythagorean cycle of fifths in red, har­mon­ic cycle of fifths in green.

In BP3, the just-intonation frame­work has been extend­ed so that any val­ue of the syn­ton­ic com­ma (or the har­mon­ic major third) can be set on a giv­en scale struc­ture. This fea­ture is demon­strat­ed on the Raga into­na­tion page.

The relevance of circular representations


Circular rep­re­sen­ta­tion of tāl Pañjābi, catuśra­jāti
[16 counts] from a Gujarati text in Devanagari script
(J. Kippen, pers. communication)

It is safe to clas­si­fy the two-vina exper­i­ment as a thought exper­i­ment, since it is unlike­ly that it could be car­ried out with mechan­i­cal instru­ments. Representing it on a cir­cu­lar graph (a mov­able wheel inside a fixed crown) achieves the same goal with­out resort­ing to imag­i­nary devices.

Circular rep­re­sen­ta­tions belong to Indian tra­di­tions of var­i­ous schools, includ­ing the descrip­tion of rhyth­mic cycles (tāl-s) used by drum­mers. These dia­grams are meant to out­line the rich inter­nal struc­ture of musi­cal con­struc­tions that can­not be reduced to "beat count­ing" (Kippen 2020).

For exam­ple, the image on the side was used to describe the ţhekkā (cycle of quasi-onomatopoeic syl­la­bles rep­re­sent­ing the beats of the drum) of tāl Pañjābi which reads as follows:

Unfortunately, ear­ly print­ing tech­nol­o­gy may have made the pub­li­ca­tion and trans­mis­sion of these learn­ing aids difficult.

If Bharata's con­tem­po­raries ever used sim­i­lar cir­cu­lar rep­re­sen­ta­tions to reflect on musi­cal scales, we sus­pect that archae­o­log­i­cal traces might not be prop­er­ly iden­ti­fied, as their draw­ings might be mis­tak­en for yantra-s, astro­log­i­cal charts and the like!

Return to epistemology

Bharata's exper­i­ment is a typ­i­cal exam­ple of the pref­er­ence for facts derived from empir­i­cal obser­va­tion over a pro­claimed uni­ver­sal log­ic aimed at estab­lish­ing "irrefutable proofs".

Empirical proofs are uni­ver­sal, not meta­phys­i­cal proofs; elim­i­nat­ing empir­i­cal proofs is con­trary to all sys­tems of Indian phi­los­o­phy. Thus ele­vat­ing meta­phys­i­cal proofs above empir­i­cal proofs, as for­mal math­e­mat­ics does, is a demand to reject all Indian phi­los­o­phy as infe­ri­or. Curiously, like Indian phi­los­o­phy, present-day sci­ence too uses empir­i­cal means of proof, so this is also a demand to reject sci­ence as infe­ri­or (to Christian metaphysics).

Logic is not uni­ver­sal either as Western philoso­phers have fool­ish­ly main­tained: Buddhist [qua­si truth-functional] and Jain [three-valued] log­ics are dif­fer­ent from those cur­rent­ly used in for­mal math­e­mat­i­cal proof. The the­o­rems of math­e­mat­ics would change if those log­ics were used. So, impos­ing a par­tic­u­lar log­ic is a means of cul­tur­al hege­mo­ny. If log­ic is decid­ed empir­i­cal­ly, that would, of course, kill the phi­los­o­phy of meta­phys­i­cal proof. Further, it may result in quan­tum log­ic, sim­i­lar to Buddhist logic […].

C. K. Raju (2013 p. 182-183)
Yuktibhāşā's proof of the "Pythagorean" the­o­rem.
Source: C. K. Raju (2007 p. 67)

The two-vina exper­i­ment can be com­pared to the (more recent) phys­i­cal proof of the "Pythagorean the­o­rem". This the­o­rem (Casey 1885 p. 43) was known in India and Mesopotamia long before the time of its leg­endary author (Buckert 1972 p. 429, 462). In the Indian text Yuktibhāşā (c. 1530 CE), a fig­ure of a right-angled tri­an­gle with squares on either side and its hypothenuse is drawn on a palm leaf. The fig­ure is then cut and rotat­ed to show that the areas are equal.

Obviously, the proof of the "Pythagorean Theorem" is very easy if you are either (a) allowed to take mea­sure­ments or, equiv­a­lent­ly, (b) allowed to move fig­ures around in space.

C. K. Raju (2013 p. 167)

This process takes place in sev­er­al stages of mov­ing fig­ures, sim­i­lar to the mov­ing scales (or fig­ures rep­re­sent­ing scales) in the two-vina exper­i­ment. The 3 single-shru­ti tone inter­vals can be com­pared to the areas of the 3 squares in Yuktibhāşā. The fol­low­ing com­ment would there­fore apply to Bharata's procedure:

The details of this ratio­nale are not our imme­di­ate con­cern beyond observ­ing that draw­ing a fig­ure, car­ry­ing out mea­sure­ments, cut­ting, and rota­tion are all empir­i­cal pro­ce­dures. Hence, such a demon­stra­tion would today be reject­ed as invalid sole­ly on the ground that it involves empir­i­cal pro­ce­dures that ought not to be any part of math­e­mat­i­cal proof.

C. K. Raju (2007 p. 67)

Bernard Bel — Dec. 2020

References

Arnold, E. J. A Mathematical mod­el 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 tem­péra­ment. Paris, 1985, repub­lished in 2000: Jobert. Soon avail­able in English.

Bel, B.; Bor, J. Intonation of North Indian Classical Music: work­ing 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 accord­ing to Natyashastra. Note interne. Marseille, 1988a : Groupe Représentation et Traitement des Connaissances (CNRS).

Bel, B. Raga : approches con­ceptuelles et expéri­men­tales. Actes du col­loque "Structures Musicales et Assistance Informatique". Marseille, 1988b.

Bharata. Natya Shastra. There is no cur­rent­ly avail­able English trans­la­tion of the first six chap­ters of Bharata’s Natya Shastra. However, most of the infor­ma­tion required for this inter­pre­ta­tion has been repro­duced and com­ment­ed by Śārṅgadeva in his Sangita Ratnakara (13th cen­tu­ry CE), trans­lat­ed 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. Euclid and Jesus: How and why the church changed math­e­mat­ics and Christianity across two reli­gious wars. Penang (Malaysia), 2013: Multiversity, Citizens International.

Raju, C. K. Cultural foun­da­tions of math­e­mat­ics : the nature of math­e­mat­i­cal proof and the trans­mis­sion of the cal­cu­lus from India to Europe in the 16th c. CE. Delhi, 2007: Pearson Longman – Project of History of Indian Science, Philosophy and Culture: Centre for Studies in Civilizations.

Rao, S.; Van der Meer, W. The Construction, Reconstruction, and Deconstruction of Shruti. Hindustani music: thir­teenth to twen­ti­eth cen­turies (J. Bor). New Delhi, 2010: Manohar.

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

Just intonation: a general framework

This arti­cle dis­cuss­es the intri­cate con­cept of just into­na­tion in music, explor­ing its his­tor­i­cal inter­pre­ta­tions and prac­ti­cal appli­ca­tions with­in the Bol Processor. It con­trasts the "Greek" or Pythagorean approach, which empha­sizes inte­ger ratios and per­fect fifths, with the ancient Indian grama-murcchana mod­el, notable for its flex­i­ble, ear-based tun­ing sys­tem and avoid­ance of numer­i­cal ratios in its orig­i­nal for­mu­la­tion. The text explains how this Indian frame­work can be extend­ed to Western har­mo­ny, cre­at­ing opti­mal­ly con­so­nant 12-tone scales with sub­tle dif­fer­ences in enhar­mon­ic posi­tions. Ultimately, the author sug­gests that while math­e­mat­i­cal pre­ci­sion can define just into­na­tion, artis­tic and per­cep­tu­al expe­ri­ence often guides its most effec­tive imple­men­ta­tion, acknowl­edg­ing that "per­fec­tion" might not always be the pri­ma­ry musi­cal goal.

Just into­na­tion (into­na­tion pure in French) is a word used by com­posers, musi­cians and musi­col­o­gists to describe var­i­ous aspects of com­po­si­tion, per­for­mance and instru­ment tun­ing. They all point to the same goal of "playing/singing in tune" — what­ev­er that means. Implementing a gener­ic abstract mod­el of just into­na­tion in the Bol Processor is a chal­lenge beyond our cur­rent com­pe­tence… We approach it prag­mat­i­cal­ly by look­ing at some musi­cal tra­di­tions that pur­sue the same goal with the help of reli­able the­o­ret­i­cal models.

A com­plete and con­sis­tent frame­work for the con­struc­tion of just-intonation scales - or "tun­ing sys­tems" - was the grama-murcchana mod­el elab­o­rat­ed in ancient India. This the­o­ry has been exten­sive­ly com­ment­ed on and (mis)interpreted by Indian and Western schol­ars: for a detailed review see Rao & van der Meer 2010. We will show that an arguably accept­able inter­pre­ta­tion yields a frame­work of chro­mat­ic scales that can be extend­ed to Western clas­si­cal har­mo­ny and eas­i­ly han­dled by the Bol Processor — either pro­duc­ing Csound scores or real-time MIDI micro­tonal­i­ty.

This page is a con­tin­u­a­tion of Microtonality but can be read independently.

All exam­ples shown on this page are avail­able in the sam­ple set bp3-ctests-main.zip shared on GitHub. Follow instruc­tions on Bol Processor ‘BP3’ and its PHP inter­face to install BP3 and learn its basic operation.

Historical background

Methods of tun­ing musi­cal instru­ments have been doc­u­ment­ed in var­i­ous parts of the world for over 2000 years. For prac­ti­cal and per­son­al rea­sons we will con­cen­trate on work in Europe and the Indian subcontinent.

Systems described as "just into­na­tion" are attempts to cre­ate a tun­ing in which all tonal inter­vals are con­so­nant. There is a large body of the­o­ret­i­cal work on just into­na­tion - see Wikipedia for links and abstracts.

Models are amenable to Hermann von Helmholtz's notion of con­so­nance which deals with the per­cep­tion of the pure sinu­soidal com­po­nents of com­plex sounds con­tain­ing mul­ti­ple tones. According to the the­o­ry of con­so­nance, the fre­quen­cies of these upper par­tials are inte­ger mul­ti­ples of the fun­da­men­tal fre­quen­cy of the vibra­tion. In mechan­i­cal musi­cal instru­ments, this is close to real­i­ty when long strings are gen­tly struck or plucked. However, this har­mo­ny is lack­ing in many wind instru­ments, espe­cial­ly reed instru­ments such as the sax­o­phone or the Indian shehnai, and even less in per­cus­sion instru­ments or bells which com­bine sev­er­al modes of vibration.

Therefore, if just into­na­tion is invoked to tune a musi­cal instru­ment, it must be anal­o­gous to a zither, a swara man­dal, a harp­si­chord, a piano or a pipe organ, includ­ing elec­tron­ic devices that pro­duce sim­i­lar sounds.

Perhaps because of their late "dis­cov­ery" of cal­cu­lus — actu­al­ly "bor­rowed" from Indian, Persian and Arabic sources — Europeans cul­ti­vat­ed a fas­ci­na­tion with num­bers strong­ly advo­cat­ed by the Church as an image of "God's per­fec­tion". We may recall Descarte's claim that the length of a curve is "beyond human under­stand­ing" because π can­not be writ­ten as an inte­ger ratio…

In the 17th cen­tu­ry, the German math­e­mati­cian Leibniz set forth the the­o­ry of "sub­con­scious eval­u­a­tion", defin­ing music as "the plea­sure of the soul that counts with­out know­ing it". This was fol­lowed by the French musi­cal the­o­rist Jean-Philippe Rameau affirm­ing that melody aris­es from har­mo­ny, mak­ing it pos­si­ble "to per­ceive the rela­tion­ships between num­bers, as they arise through­out the uni­verse".

Regardless of these spec­u­la­tions, musi­cians in real life had devel­oped pro­ce­dures for tun­ing their instru­ments by lis­ten­ing to inter­vals and select­ing the ones that sound­ed right to them — see The two-vina exper­i­ment page.

After the devel­op­ment of musi­cal acoustics, attempts were made to describe tun­ing schemes in terms of fre­quen­cy ratios. This was a risky ven­ture, how­ev­er, because the dream of per­fec­tion led to the sim­plis­tic pro­mo­tion of "per­fect ratios". Seeking the kind of per­fec­tion embod­ied in num­bers is the best way to pro­duce bland music.

Although just into­na­tion — inter­vals with­out beats — is now pos­si­ble on elec­tron­ic instru­ments, it is based on a nar­row con­cept of tonal­i­ty. This can be ver­i­fied by lis­ten­ing to ancient Western music per­formed using dif­fer­ent ear-based tem­pera­ments — see page Comparing tem­pera­ments — and even to Indian clas­si­cal music — see page Raga into­na­tion.

The “Greek” approach

Greek women play­ing ancient Harp, Cithara and Lyre musi­cal instru­ments (source)

Models of vibrat­ing strings attrib­uted to the "ancient Greeks" sug­gest that fre­quen­cy ratios of 2/1 (the octave), 3/2 (the major fifth) and 5/4 (the major third) pro­duce con­so­nant inter­vals, while oth­er ratios pro­duce a cer­tain degree of dis­so­nance.

The prac­tice of poly­phon­ic music on fixed-tuned instru­ments has shown that this per­fect con­so­nance is nev­er achieved with 12 notes in an octave — the con­ven­tion­al chro­mat­ic scale. In Western clas­si­cal har­mo­ny, it would require retun­ing the instru­ment accord­ing to the musi­cal genre, the piece of music and the har­mon­ic con­text of each melod­ic phrase or chord.

Imperfect tonal inter­vals pro­duce unwant­ed beats because their fre­quen­cy ratio can­not be reduced to sim­ple 2, 3, 4, 5 frac­tions. A sim­ple thought exper­i­ment, myth­i­cal­ly attrib­uted to Pythagoras of Samos, shows that this is inher­ent in arith­metic and not a defect in instru­ment design. Imagine the tun­ing of ascend­ing fifths (ratio 3/2) by suc­ces­sive steps on a harp with octave shifts to keep the result­ing note with­in the orig­i­nal octave. The fre­quen­cy ratios would be 3/2, 9/4, 27/16, 81/64 and so on. At this stage, the note appears to be a major third although its actu­al ratio (81/64 = 1.265) is high­er than 5/4 (1.25). The 81/64 inter­val is called the Pythagorean major third, which may sound "out of tune" in a con­ven­tion­al har­mon­ic con­text. The fre­quen­cy ratio (81/80 = 1.0125) between the Pythagorean and har­mon­ic major thirds is called the syn­ton­ic com­ma.

Whoever devised the so-called "Pythagorean tun­ing" went fur­ther in their inten­tion to describe all musi­cal notes by cycles of fifths. Going fur­ther up, 243/128, 729/512… etc. effec­tive­ly pro­duces a full chro­mat­ic scale: C - G - D - A - E - B - F♯ - C♯ - G♯… etc. But in addi­tion to the harsh sound of some of the result­ing inter­vals, things get bad if one hopes to end the cycle on the ini­tial note. If the series start­ed on 'C', it will end on 'C' (or 'B#'), but with a ratio of 531441/524288 = 1.01364, slight­ly high­er than 1. This gap is called the Pythagorean com­ma, which is con­cep­tu­al­ly dif­fer­ent from the syn­ton­ic com­ma (1.0125), although their sizes are almost iden­ti­cal. This para­dox is a mat­ter of sim­ple arith­metic: pow­ers of 2 (octave inter­vals) nev­er match pow­ers of 3.

The attri­bu­tion of this sys­tem to the "ancient Greeks" is, of course, pure fan­ta­sy, since they (unlike the Egyptians) didn't have any use for fractions!

A 19-key per octave (from "A" to "a") key­board designed by Gioseffo Zarlino (1517-1590) (source)

Despite the com­ma prob­lem, tun­ing instru­ments by series of per­fect fifths was com­mon prac­tice in medieval Europe, fol­low­ing the organum which con­sist­ed of singing/playing par­al­lel fifths or fourths to enhance a melody. One of the old­est trea­tis­es on "Pythagorean tun­ing" was pub­lished around 1450 by Henri Arnault de Zwolle (Asselin 2000 p. 139). In this tun­ing, major "Pythagorean" thirds sound­ed harsh, which explains why the major third was con­sid­ered a dis­so­nant inter­val at the time.

Because of these lim­i­ta­tions, Western fixed-pitch instru­ments using chro­mat­ic (12-tone) scales nev­er achieve the pitch accu­ra­cy dic­tat­ed by just into­na­tion. For this rea­son, just into­na­tion is described in the lit­er­a­ture as "incom­plete" (Asselin 2000 p. 66). Multiple divi­sions (more than 12 per octave) are required to pro­duce all "pure" ratios. This has been unsuc­cess­ful­ly attempt­ed on key­board instru­ments, although it remains pos­si­ble on a computer.

The Indian approach

Bharata Muni's "Natya Shastra"

The grama-murcchana mod­el was described in the Natya Shastra, a Sanskrit trea­tise on the per­form­ing arts writ­ten in India some twen­ty cen­turies ago. Chapter 28 con­tains a dis­cus­sion of the "har­mon­ic scale", which is based on a divi­sion of the octave into 22 shru­ti-s, while only sev­en swara-s (notes) are used by musi­cians: "Sa", "Re", "Ga", "Ma", "Pa", "Dha", "Ni". These can be mapped onto con­ven­tion­al Western music nota­tion "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 can be extend­ed to a 12-degree (chro­mat­ic) scale by means of diesis and flat alter­ations, which raise or low­er a note by a semi­tone. Altered notes in the Indian sys­tem are com­mon­ly called "komal Re", "komal Ga", "Ma tivra", "komal Dha" and "komal Ni". The word "komal" can be trans­lat­ed as "flat" and "tivra" as "diesis".

The focus of 20th cen­tu­ry research in Indian musi­col­o­gy has been to 'quan­ti­fy' shruti-s in a sys­tem­at­ic way and to assess the rel­e­vance of this quan­tifi­ca­tion to the per­for­mance of clas­si­cal raga.

Presentation of the S52 in November 1980 dur­ing the Sigma fes­ti­val in Bordeaux. In the pres­ence of Alain Daniélou, André Kudelski and Claude Cellier. Source: Semantic Daniélou

A strik­ing point in the ancient Indian the­o­ry of musi­cal scales is that it does not rely on numer­i­cal ratios, be they fre­quen­cies or lengths of vibrat­ing strings. This point was over­looked by "colo­nial musi­col­o­gists" because of their lack of insight into Indian math­e­mat­ics and their fas­ci­na­tion with a mys­ti­cism of num­bers inher­it­ed from Neopythagoreanism.

In the mid-20th cen­tu­ry, the French musi­col­o­gist Alain Daniélou described "the Indian scale" as a set of 53 inter­vals per octave based on inte­ger fre­quen­cy ratios of 2, 3, and 5. His demon­stra­tion of raga phras­es played on the S52 elec­tron­ic key­board instru­ment, built by Kudelski to this spec­i­fi­ca­tion, was a painful expe­ri­ence for a musi­cal­ly trained audi­ence — I attend­ed it in Paris in 1980…

As report­ed by Jonathan Barlow (per­son­al com­mu­ni­ca­tion, 3/9/2013, links my own):

The ustads in India from way back con­sid­ered that they fol­lowed Pythagoras, but ear­ly on they made the dis­cov­ery that try­ing to tune by num­bers was a los­ing game, and Ibn Sina (Avicenna) (980-1037 AD), who was their great philoso­pher of aes­thet­ics, said in plain terms that it was wis­er to rely on the ears of the experts. Ahobala tried to do the num­bers thing (and Kamilkhani) but they are rel­e­gat­ed to a foot­note of 17th C musicology.

Bharata Muni, the author(s) of the Natya Shastra, may have heard of "Pythagorean tun­ing", a the­o­ry that Indian sci­en­tists could have expand­ed con­sid­er­ably, giv­en their exper­tise in the use of cal­cu­lus. Despite this, not a sin­gle num­ber is quot­ed in the entire chap­ter on musi­cal scales. This para­dox is dis­cussed on my page The Two-vina exper­i­ment. In A Mathematical Discussion of the Ancient Theory of Scales accord­ing to Natyashastra, I showed a min­i­mal rea­son: Bharata's descrip­tion leads to an infi­nite set of solu­tions, which should be for­malised with some alge­bra, rather than a set of inte­ger ratios.

How (and why) should the octave be divid­ed into 22 (or 23) micro-intervals when most Indo-European musi­cal sys­tems only name 5 to 12 notes? Some naive eth­no­mu­si­col­o­gists have claimed that Bharata's mod­el must be a vari­ant of a pre­sumed Arabic "quar­ter­tone sys­tem", or even a tem­pered scale with 22 inter­vals… If so, why not 24 shruti-s? Or any arbi­trary number?

The two-vina exper­i­ment pro­duces shruti-s of unequal sizes for a sim­ple rea­son: No sum of micro­tones of 54.5 cents (1200 / 22) in a 22-degree equal tem­pered scale would pro­duce an inter­val close to 702 cents — the per­fect fifth that gives con­so­nance (sam­va­di) to musi­cal scales. (Read below for the def­i­n­i­tion of the cent as a log­a­rith­mic unit.)

In the (thought?) exper­i­ment described in Bharata's Natya Shastra (chap­ter 28), two vina-s — stringed instru­ments sim­i­lar to zithers — are tuned iden­ti­cal­ly. The author sug­gests low­er­ing all the notes of one instru­ment by "one shru­ti" and they give a list of notes that will match between the two instru­ments. The process is repeat­ed three more times until all the match­es have been made explic­it. This gives a sys­tem of equa­tions (and inequa­tions) for the 22 unknown variables.

Additional equa­tions can be derived from a pre­lim­i­nary state­ment that the octave and the major fifth are "con­so­nant" (sam­va­di), thus fix­ing fre­quen­cy ratios close to 2/1 and 3/2. (Read the detailed pro­ce­dure on my page The Two-vina Experiment and the math­e­mat­ics in A Mathematical Discussion of the Ancient Theory of Scales accord­ing to Natyashastra.)

However, a new equa­tion is need­ed, which Bharata's mod­el does not pro­vide. Interestingly, in Natya Shastra the major third is clas­si­fied as "asso­nant" (anu­va­di). Setting its fre­quen­cy ratio to 5/4 (har­mon­ic major third) is there­fore a reduc­tion of this mod­el. In fact, the har­mon­ic major third is a dis­cov­ery of European musi­cians in the ear­ly 16th cen­tu­ry, when fixed-pitch key­board instru­ments had become pop­u­lar (Asselin 2000 p. 139). Nonetheless, many musi­col­o­gists take it for grant­ed in their inter­pre­ta­tion of the Indian mod­el. […] thirds were con­sid­ered inter­est­ing and dynam­ic con­so­nances along with their inverse, sixths, but in medieval times they were con­sid­ered dis­so­nances unus­able in a sta­ble final sonor­i­ty (Wikipedia).

The reduc­tion of Bharata's mod­el to a Pythagorean/harmonic tun­ing scheme, as pro­posed by E. James Arnold (1985), does not fit with the flex­i­bil­i­ty of into­na­tion schemes in Indian music — see page Raga into­na­tion. Experimental work on musi­cal prac­tice is not "in tune" with this inter­pre­ta­tion of the ancient shru­ti sys­tem. In fact, it should be inter­pret­ed as a "flex­i­ble" frame­work in which the vari­able para­me­ter is the syn­ton­ic com­ma, name­ly the dif­fer­ence between a Pythagorean major third and a har­mon­ic major third. Adherence to the two-vina exper­i­ment only implies that the com­ma takes its val­ue any­where between 0 and 56.8 cents (Bel 1988a).

Building tona­grams on the Apple II from tonal data col­lect­ed by Bel's MMA (1982)

➡ Measurements in cents refer to a log­a­rith­mic scale. Given a fre­quen­cy ratio 'r', its cent val­ue is 1200 x log(r) / log(2). The octave (ratio 2/1) is 1200 cents, and each semi­tone (in equal tem­pera­ment) is 100 cents.

The con­struc­tion and eval­u­a­tion of raga scale types based on this flex­i­ble mod­el is explained on my page Raga into­na­tion.

Extending the Indian model to Western harmony

One incen­tive for apply­ing the Indian frame­work to Western clas­si­cal music is that both tra­di­tions have giv­en pri­or­i­ty to the con­so­nance of per­fect fifths asso­ci­at­ed with a 3/2 fre­quen­cy ratio. In line with the Western approach, let us define the har­mon­ic major third as an inter­val of 5/4 (384 cents). This results in a syn­ton­ic com­ma of 81/80 (close to 21.5 cents). The sys­tem of equa­tions derived from the two-vina exper­i­ment is com­plete, and it yields two addi­tion­al sizes of shru­ti-s: the Pythagorean lim­ma (256/243 = about 90 cents) and the minor semi­tone (25/24 = about 70 cents).

These inter­vals were known to Western musi­col­o­gists who were try­ing to find just into­na­tion scales that could be played on key­board instru­ments (12 degrees per octave). Gioseffo Zarlino (1517-1590) is a well-known con­trib­u­tor to this the­o­ret­i­cal work. His "nat­ur­al scale" was an arrange­ment of the three nat­ur­al inter­vals yield­ing the fol­low­ing chro­mat­ic scale — named "just intonation" in "-to.tryScales":

A "just into­na­tion" chro­mat­ic scale derived from Zarlino's mod­el of "nat­ur­al scale"
(Image cre­at­ed by Bol Processor)

This should not be con­fused with Zarlino's mean­tone tem­pera­ment (image), read pages Microtonality and Comparing tem­pera­ments.

In 1974, E. James Arnold, inspired by the French musi­col­o­gist Jacques Dudon, designed a cir­cu­lar mod­el to illus­trate the trans­po­si­tion of scales (mur­ccha­na) in Bharata's mod­el. Below is the sequence of inter­vals (L, C, M…) over an octave as derived from the two-vina exper­i­ment.

The out­er crown of Arnold's mod­el for his inter­pre­ta­tion of the grama-murcchana sys­tem. The Pythagorean series of per­fect fifths is drawn in red and the har­mon­ic series of per­fect fifths is drawn in green. The dot­ted blue line is a har­mon­ic major third.

Positions R1, R2 etc. are labelled with abbre­vi­a­tions of names Sa, Re, Ga, Ma, Pa, Dha, Ni. For exam­ple, Ga ("E" in English) can have four posi­tions, G1 and G2 being enhar­mon­ic vari­ants of komal Ga ("E flat" = "mi bémol"), while G3 and G4 are the har­mon­ic and Pythagorean posi­tions of shud­dha Ga ("E"= "mi") respectively.

The notes of the chro­mat­ic scale have been labelled using the Italian/Spanish/French con­ven­tion "do", "re", "mi", "fa"… rather than the English con­ven­tion to avoid con­fu­sion: "D" is asso­ci­at­ed with Dha ("A" in English, "la" in Italian/French) and not with the English "D" ("re" in Italian/French).

Frequency ratios are illus­trat­ed by pic­tograms show­ing how each posi­tion can be derived from the base note (Sa). For exam­ple, the pic­togram near N2 ("B flat" = "si bémol") shows 2 ascend­ing per­fect fifths and 1 descend­ing major third.

Cycles of per­fect fifths have been marked with red and green seg­ments. The red series is gen­er­al­ly called "Pythagorean" — con­tain­ing G4 (81/84) — and the green one "har­mon­ic" — con­tain­ing G3 (5/4). The blue arrow shows a har­mon­ic major third going from S ("C" = "do") to G3. Both cycles are iden­ti­cal, with the har­mon­ic and Pythagorean posi­tions dif­fer­ing by 1 syn­ton­ic comma.

Theoretically, the har­mon­ic series could also be con­struct­ed in a "Pythagorean" way, by extend­ing the cycles of per­fect fifths. Thus, after 8 descend­ing fifths, G3 ("E" = "mi") would be 8192/6561 (1.248) instead of 5/4 (1.25). The dif­fer­ence is a schis­ma (ratio 1.001129), an inter­val beyond human per­cep­tion. It is there­fore more con­ve­nient to show sim­ple ratios.

The frame­work imple­ment­ed in Bol Processor deals with inte­ger ratios, which allows for high accu­ra­cy. Nevertheless, it delib­er­ate­ly eras­es schis­ma dif­fer­ences. This is the result of approx­i­mat­ing cer­tain ratios, e.g. replac­ing 2187/2048 with 16/15.

Note that there is no trace of schis­ma in the clas­si­cal Indian the­o­ry of musi­cal scales; there wouldn't be even if Bharata's con­tem­po­raries had con­struct­ed them via series of ratio­nal num­bers, because of their deci­sion to dis­re­gard infin­i­tes­i­mals as "non-representable" enti­ties (cf. Nāgārjuna's śūniyavā­da phi­los­o­phy, Raju 2007 p. 400). If 2187/2048 and oth­er com­plex ratios of the same series were deemed imprac­ti­cal, the Indian mathematician/physicist (fol­low­ing the Āryabhaţīya) would replace them all with "16/15 āsan­na (near val­ue)"… This is an exam­ple of Indian math­e­mat­ics designed for cal­cu­la­tion rather than proof con­struc­tion. In the Western Platonic approach, math­e­mat­ics aimed at "exact val­ues" as a sign of per­fec­tion, which led its pro­po­nents to face seri­ous prob­lems with "irra­tional" num­bers and even with the log­ic under­ly­ing for­mal proof pro­ce­dures (Raju 2007 p. 387-389).

This dia­gram, and the mov­ing gra­ma wheel that will be intro­duced next, could be built with any size of the syn­ton­ic com­ma in the range 0 to 56.8 cents (Bel 1988a). The two-vina exper­i­ment implies that L = M + C. Thus, the syn­ton­ic com­ma is also the dif­fer­ence between a lim­ma and a minor semi­tone. To build a frame­work for the flex­i­ble mod­el, sim­ply allow all har­mon­ic posi­tions to move by the same amount in the direc­tion of their Pythagorean enhar­mon­ic variants.

While major thirds would be 1 com­ma larg­er if a Pythagorean inter­val (e.g. G4, ratio 81/64) were cho­sen instead of a har­mon­ic one (G3, ratio 5/4), major fifths also dif­fer by 1 com­ma, but the Pythagorean fifth (P4, ratio 3/2) is larg­er than the har­mon­ic one (P3, ratio 40/27). The lat­ter has been called the wolf fifth because its use in melod­ic phras­es or chords is said to sound "out of tune", with a negative/evil mag­i­cal connotation.

No posi­tion on this mod­el requires more than 1 ascend­ing or descend­ing major third. This makes sense to instru­ment tuners who know that tun­ing per­fect fifths by ear is an easy task that can be repeat­ed in sev­er­al steps — here a max­i­mum of 5 or 6 up and down. Tuning a har­mon­ic major third, how­ev­er, requires a lit­tle more atten­tion. It would there­fore be unre­al­is­tic to imag­ine a pre­cise tun­ing pro­ce­dure based on a sequence of major thirds — although this can be achieved with the aid of elec­tron­ic devices.

At the top of the pic­ture (posi­tion "fa#") we notice that nei­ther of the two cycles of fifths clos­es on itself due to the pres­ence of a Pythagorean com­ma. The tiny dif­fer­ence (schis­ma, ratio 1.001129) between Pythagorean and syn­ton­ic com­mas is illus­trat­ed by two pairs of posi­tions: P1/M3 and P2/M4.

Another pecu­liar­i­ty at the top of the pic­ture is the appar­ent dis­rup­tion of the sequence L-C-M. However, remem­ber­ing that L = M + C, the reg­u­lar­i­ty is restored by choos­ing between P1/M3 and P2/M4.

Approximations have no effect on the sound of musi­cal inter­vals, since no human ear would appre­ci­ate a schis­ma dif­fer­ence (2 cents). However, oth­er dif­fer­ences must remain explic­it, since inte­ger ratios indi­cate the tun­ing pro­ce­dure by which the scale can be con­struct­ed. Thus the replace­ment inte­ger ratio may be more com­plex than the "schis­mat­ic" one, as in the case of R1, ratio 256/243 instead of 135/128, because the lat­ter is built with a sim­ple major third above D4 instead of belong­ing to the Pythagorean series.

Tuning Western instruments

The prob­lem of tun­ing fixed pitch instru­ments (harp­si­chord, pipe organ, pianoforte…) has been well doc­u­ment­ed by the organ/harpsichord play­er, builder and musi­col­o­gist Pierre-Yves Asselin (2000). In his prac­ti­cal approach, just into­na­tion is a back­ground mod­el that can only be approx­i­mat­ed on 12-degree scales by tem­pera­mentcom­pro­mis­ing the pure inter­vals of just into­na­tion to meet oth­er require­ments. Temperament tech­niques applied to the Bol Processor are dis­cussed on the Microtonality and Comparing tem­pera­ments pages.

Source: Pierre-Yves Asselin (2000 p. 61)

The col­umn at the cen­tre of this pic­ture, with notes with­in ellipses, is a series of per­fect fifths which Asselin called "Pythagorean".

Series of fifths are infi­nite. Selecting sev­en of them (in the mid­dle col­umn) cre­ates a scale called the "glob­al dia­ton­ic frame­work" (milieu dia­tonique glob­al, see Asselin 2000 p. 59). In this exam­ple, the frame­works are those of "C" and "G" ("do" and "sol" in French).

Extending series of per­fect fifths beyond the sixth step pro­duces com­pli­cat­ed ratios that can be approx­i­mat­ed (with a schis­ma dif­fer­ence) to those pro­duced by har­mon­ic major thirds (ratio 5/4). Positions on the right (major third up, first order) are one syn­ton­ic com­ma low­er than their equiv­a­lents in the mid­dle series, and posi­tions on the left (major third down, first order) are one syn­ton­ic com­ma higher.

It is pos­si­ble to cre­ate more columns on the right ("DO#-2", "SOL#-2" etc.) for posi­tions cre­at­ed by 2 suc­ces­sive jumps of a har­mon­ic major third, and in the same way on the left ("DOb#+2", "SOLb#+2" etc.), but these second-order series are only used for the con­struc­tion of tem­pera­ments — see page Microtonality.

This mod­el pro­duces 3 to 4 posi­tions for each note, a 41-degree scale, which would require 41 keys (or strings) per octave on a mechan­i­cal instru­ment! This is one rea­son for the tem­per­ing of inter­vals on mechan­i­cal instru­ments, which amounts to select­ing the most appro­pri­ate 12 posi­tions for a giv­en musi­cal repertoire.

This tun­ing scheme is dis­played on scale "3_cycles_of_fifths" in the "-to.tryTunings" tonal­i­ty resource of Bol Processor.

Series of names have been entered, togeth­er with the frac­tion of the start­ing posi­tion, to pro­duce cycles of per­fect fifths in the scale. Following Asselin's nota­tion, the fol­low­ing series have been cre­at­ed (trace gen­er­at­ed by the Bol Processor):

  1. From 4/3 up: FA, DO, SOL, RE, LA, MI, SI, FA#, DO#, SOL#, RE#, LA#
  2. From 4/3 down: FA, SIb, MIb, LAb, REb, SOLb
  3. 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
  4. From 320/243 down: FA-1, SIb-1, MIb-1, LAb-1, REb-1, SOLb-1
  5. 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
  6. From 27/20 down: FA+1, SIb+1, MIb+1, LAb+1, REb+1, SOLb+1

This was more than enough to deter­mine the 3 or 4 posi­tions of each note, since sev­er­al notes can reach the same posi­tion at a schis­ma dis­tance. For exam­ple, "REb" is in the same posi­tion as "DO#-1". The IMAGE link shows this scale with (sim­pli­fied) fre­quen­cy relationships:

The "3_cycles_of_fifths" scale: a graph­i­cal rep­re­sen­ta­tion of three series of per­fect fifths used to per­form Western music in "just into­na­tion" accord­ing to Asselin (2000).
(Image cre­at­ed by Bol Processor)

Compared to the mod­el advo­cat­ed by Arnold (1974, see fig­ure above), this sys­tem accepts har­mon­ic posi­tions on either side of the Pythagorean posi­tions, which means that Sa ("C" or "do"), like all unal­tered notes, can take three dif­fer­ent posi­tions. In Indian music, Sa is unique because it is the fun­da­men­tal note of every clas­si­cal per­for­mance of a raga, fixed by the drone (tan­pu­ra) and tuned to suit the singer or instru­men­tal­ist. However, we will see that trans­po­si­tions (mur­ccha­na-s) of the basic Indian scale(s) pro­duce some of these addi­tion­al positions.

A tun­ing scheme based on three (or more) cycles of per­fect fifths is a good grid for con­struct­ing basic chords in just into­na­tion. For exam­ple, a "C major" chord is made up of its ton­ic "DO", its dom­i­nant "SOL" a per­fect fifth high­er, and "MI-1" a major har­mon­ic third above "DO". The first two notes can belong to a Pythagorean series (blue marks on the graph) and the last one to a har­mon­ic series (green marks on the graph). Minor chords are con­struct­ed in a sim­i­lar way, which will be explained later.

This does not com­plete­ly solve the prob­lem of play­ing tonal music with just into­na­tion. Sequences of chords must be cor­rect­ly aligned. For exam­ple, should one use the same "E" in "C major" and in "E major"? The answer is "no", but the rule must be made explicit.

How is it pos­si­ble to choose the right one among the 37 * 45 = 2 239 488 chro­mat­ic scales shown in this graph?

In the approach of Pierre-Yves Asselin (2000) — inspired by the work of Conrad Letendre in Canada — rules were derived from options val­i­dat­ed by lis­ten­ers and musi­cians. Conversely, the gra­ma frame­work exposed below is a "top-down" approach — from a the­o­ret­i­cal mod­el to its eval­u­a­tion by practitioners.

The grama framework

Using Bharata's mod­el — see page The two-vina exper­i­ment — we can con­struct chro­mat­ic (12-degree) scales in which each tonal posi­tion (out of 11) has two options: har­mon­ic or Pythagorean. This is one rea­son to say that the frame­work is based on 22 shru­ti-s. In Indian musi­co­log­i­cal lit­er­a­ture, the term shru­ti is ambigu­ous, as it can mean either a tonal posi­tion or an interval.

In Bol Processor BP3 this "gra­ma" frame­work is edit­ed as fol­lows in "-to.12_scales":

The 22-shruti frame­work as per Bharata's mod­el with a syn­ton­ic com­ma of 22 cents (see full image)

We use lower-case labels for R1, R2 etc. and append a '_' after labels to dis­tin­guish enhar­mon­ic posi­tions from octave num­bers. So, "g3_4" means G3 in the fourth octave.

Two options for each of the 11 notes yields a set of 211 = 2048 chro­mat­ic scales. Of these, only 12 are "opti­mal­ly con­so­nant", i.e. they con­tain only one wolf fifth (small­er by 1 syn­ton­ic com­ma). These 12 scales are the ones used in har­mon­ic or modal music to expe­ri­ence max­i­mum con­so­nance. The author(s) of Naya Shastra had this inten­tion in mind when they described a basic 12-tone "opti­mal" scale called "Ma-grama". This scale is called "Ma_grama" in tonal­i­ty resource "-to.12_scales":

The "Ma-grama" basic chro­mat­ic scale built on the 22-shruti frame­work (see full image)

Click on the IMAGE link on the "Ma_grama" page to obtain a graph­i­cal rep­re­sen­ta­tion of this scale:

The Ma-grama chro­mat­ic scale, Bol Processor graph­ic display

In this pic­ture the per­fect fifths are blue lines and the (unique) wolf fifth between C and G is a red line. Note that posi­tions marked in blue ("Db", "Eb" etc.) are Pythagorean and har­mon­ic posi­tions ("D", "E" etc.) appear in green. Normally, a "Pythagorean" posi­tion on this frame­work is one where nei­ther the numer­a­tor nor the denom­i­na­tor of the frac­tion is a mul­ti­ple of 5. Multiples of 5 indi­cate jumps of har­mon­ic major thirds (ratio 5/4 or 4/5). This sim­ple rule is bro­ken, how­ev­er, when com­plex ratios are replaced by sim­ple equiv­a­lents at a dis­tance of one schis­ma. Therefore, the blue and green mark­ings on the Bol proces­sor images are main­ly used to facil­i­tate the iden­ti­fi­ca­tion of a posi­tion: a note appear­ing near a blue mark­ing could as well belong to the har­mon­ic series with a more com­plex ratio, bring­ing it close to the Pythagorean position.

It will be impor­tant to remem­ber that all the notes of the Ma-grama scale are in their low­est enhar­mon­ic posi­tions. Other scales are cre­at­ed by rais­ing a few notes by a comma.

This Ma-grama is the start­ing point for the gen­er­a­tion of all "opti­mal­ly con­so­nant" chro­mat­ic scales. This is done by trans­pos­ing per­fect fifths (upwards or down­wards). The visu­al­i­sa­tion of trans­po­si­tions becomes clear when the basic scale is drawn on a cir­cu­lar wheel which is allowed to move with­in the out­er crown shown above. The fol­low­ing is Arnold's com­plete mod­el, show­ing the Ma-Grama in the basic posi­tion, pro­duc­ing the "Ma01" scale:

The fixed (out­er) and mov­able (inner) shru­ti wheels in posi­tion for the "M1" trans­po­si­tion of Ma-grama, which pro­duces the "Ma01" scale

This posi­tion­ing of the inner wheel on top of the out­er wheel is called a "trans­po­si­tion" (mur­ccha­na).

Intervals are shown on the graph. For exam­ple, R3 ("D" = "re") is a per­fect fifth to D3 ("A" = "la").

The "Ma01" scale pro­duced by this M1 trans­po­si­tion pro­duces the "A minor" chro­mat­ic scale with the fol­low­ing intervals:

CDb c+m D c+l Eb c+m E c+l F c+m F# c+l GAb c+m A c+l Bb c+m B c+l C

  • m = minor semi­tone = 70 cents
  • l = lim­ma = 90 cents
  • c = com­ma = 22 cents
The "A minor" chro­mat­ic scale pro­duced by the M1 trans­po­si­tion of Ma-grama (i.e. "Ma01")

This con­struc­tion of the "A minor" scale cor­re­sponds to the Western scheme for the pro­duc­tion of just into­nat­ed chords: the fun­da­men­tal "A" (ratio 5/3) is "LA-1" on the "3_cycles_of_fifths" scale, which is in the "major third upwards" series as well as its dom­i­nant "MI-1", while "C" (ratio 1/1) belongs to the "Pythagorean" series.

At first sight, the scale con­struct­ed by this M1 trans­po­si­tion also resem­bles a "C major" scale, but with a dif­fer­ent choice of R3 (har­mon­ic "D" ratio 10/9) instead of R4 (Pythagorean "D" ratio 9/8). To pro­duce the "C major" scale, "D" should be raised to its Pythagorean posi­tion, which amounts to R4 replac­ing R3 on Bharata's mod­el. This is done by using an alter­na­tive root scale called "Sa-Grama" in which P4 replaces P3.

P3 is called "cyu­ta Pa" mean­ing "Pa low­ered by one shru­ti" — here a syn­ton­ic com­ma. The wheel rep­re­sen­ta­tion sug­gests that oth­er low­ered posi­tions may lat­er be high­light­ed by the trans­po­si­tion process, name­ly cyu­ta Ma and cyu­ta Sa.

At the bot­tom of the "Ma01" page on "-to.12_scales", all the inter­vals of the chro­mat­ic scale are list­ed, with the sig­nif­i­cant inter­vals high­light­ed in colour. The wolf fifth is coloured red. Note that when the scale is opti­mal­ly con­so­nant, only one cell is coloured red.

Harmonic struc­ture of the "Ma01" trans­po­si­tion of Ma-grama, as dis­played by the Bol Processor
Ma01 tun­ing scheme, dis­played by the Bol Processor

A tun­ing scheme is sug­gest­ed at the bot­tom of page "Ma01". It is based on the (pure­ly mechan­i­cal) assump­tion that per­fect fifths are tuned first with­in the lim­it of 6 steps. Then har­mon­ic major thirds and minor sixths are high­light­ed, and final­ly Pythagorean thirds and minor sixths can also be tak­en into account.

Exporting a major chro­mat­ic scale with the sen­si­tive note raised by 1 comma

We can use "Ma01" as a 23-degree micro­ton­al scale in Bol Processor pro­duc­tions because all the notes rel­e­vant to the chro­mat­ic scale have been labelled. However it is more prac­ti­cal to extract a 12-degree scale with only labelled notes. This can be done on the "Ma01" page. The image shows the expor­tat of the "Cmaj" scale with 12 degrees and a raised posi­tion of D.

Using "Cmaj" for the name makes it easy to declare this scale in its spe­cif­ic har­mon­ic con­text. In the same way, a 12-degree "Amin" can be export­ed with­out rais­ing the "D".

"D" ("re") is there­fore the sen­si­tive note when switch­ing between the "C major" scale and its rel­a­tive "A minor".

In all 12-degree export­ed scales it is easy to change the note con­ven­tion — English, Italian/Spanish/French, Indian or key num­bers. It is also pos­si­ble to select diesis in replace­ment of flat and vice ver­sa, as the machine recog­nis­es both options.

Producing the 12 chromatic scales

A PowerPoint ver­sion of Arnold's mod­el can be down­loaded here and used to check the trans­po­si­tions pro­duced by the Bol Processor BP3.

Creating "Ma02" as a trans­po­si­tion of "Ma01"

To cre­ate suc­ces­sive "opti­mal­ly con­so­nant" chro­mat­ic scales, the Ma-grama should be trans­posed by descend­ing or ascend­ing per­fect fifths.

For exam­ple, cre­ate "Ma02" by trans­pos­ing "Ma01" from a per­fect fourth "C to F" (see pic­ture). Nothing else needs to be done. All the trans­po­si­tions are stored in tonal­i­ty resource "-to.12_scales". Each of these scales can then be used to export a minor and a major chro­mat­ic scale. This pro­ce­dure is explained in detail on the page Creation of just-intonation scales.

Enharmonic shift of the tonic

An inter­est­ing point raised by James Arnold in our paper L'intonation juste dans la théorie anci­enne de l'Inde : les appli­ca­tions aux musiques modale et har­monique (1985) is the com­par­i­son of minor and major scales of the same ton­ic, for exam­ple mov­ing from "C major" to "C minor".

To get the "C minor" scale, we need to cre­ate "Ma04" by using four suc­ces­sive descend­ing fifths (or ascend­ing fourths). Note that writ­ing "C to F" on the form does not always pro­duce a per­fect fourth trans­po­si­tion because the "F to C" inter­val may be a wolf fifth! This hap­pens when going from "Ma03" to "Ma04". In this case, select, for exam­ple, "D to G".

From "Ma04" we export "Cmin". Here comes a surprise:

(See full image)
The "C minor" scale derived from the "Ma04" trans­po­si­tion of Ma-grama

The inter­vals are those pre­dict­ed (see "A minor" above), but the posi­tions of "G", "F" and "C" have been low­ered by one com­ma. This was expect­ed for "G" because of the replace­ment of P4 by P3. The bizarre sit­u­a­tion is that both 'C' and 'F' are one com­ma low­er than what seemed to be their low­est (or only) posi­tion in the 22-shruti mod­el. The authors of Natya Shastra had antic­i­pat­ed a sim­i­lar process when they invent­ed the terms "cyu­ta Ma" and "cyu­ta Sa"

This shift­ing of the base note can be seen by mov­ing the inner wheel. After 4 trans­po­si­tions, the posi­tion M1 of the inner wheel will cor­re­spond to the posi­tion G1 of the out­er wheel, giv­ing the fol­low­ing configuration:

The "Ma04" trans­po­si­tion of Ma-grama show­ing low­ered C, F and G

This shift of the ton­ic was pre­sent­ed as a chal­leng­ing find­ing in our paper (Arnold & Bel 1985). Jim Arnold had done exper­i­ments with Pierre-Yves Asselin play­ing Bach's music on the Shruti Harmonium and both liked the shift of the ton­ic on minor chords.

Two options for tun­ing a "C minor" chord. Source: Asselin (2000)

Pierre-Yves him­self men­tions a one-comma low­er­ing of "C" and "G" in the "C minor" chord. However, this was one of two options pre­dict­ed by his the­o­ret­i­cal mod­el. He test­ed it by play­ing the Cantor elec­tron­ic organ at the University, and reports that musi­cians found this option to be more pun­gent"déchi­rant" — (Asselin 2000 p. 135-137).

The oth­er option (red on the pic­ture) was that each scale be "aligned" in ref­er­ence to its base note "C" ("DO"). This align­ment (one-comma rais­ing) can be done click­ing but­ton "ALIGN SCALE" on scale pages wher­ev­er the basic note ("C") is not at posi­tion 1/1. Let us lis­ten to the "C major"/ "C minor" / "C major" sequence, first "non-aligned" then "aligned":

"C major"/ "C minor" / "C major" sequence, first non-aligned then aligned

Clearly, the "non-aligned" ver­sion is more pun­gent than the "aligned" one.

This choice is based on per­cep­tu­al expe­ri­ence, or "pratyakṣa pramāṇa" in Indian epis­te­mol­o­gy — see The two-vina exper­i­ment. We take an empir­i­cal approach rather than seek­ing an "axiomat­ic proof". The ques­tion is not which of the two options is true, but which one pro­duces music that sounds right.

Checking the tuning system

Checking a chord sequence

The con­struc­tion of just into­na­tion using the grama-murcchana pro­ce­dure needs to be checked in typ­i­cal chord sequences such as the "I-IV-II-V-I" series dis­cussed by Pierre-Yves Asselin (2000 p. 131-135):

After try­ing out five options sug­gest­ed by his the­o­ret­i­cal mod­el, the author chose the one pre­ferred by all the musi­cians. This is the into­na­tion they spon­ta­neous­ly choose when singing, with­out any spe­cial instruc­tion. This ver­sion also cor­re­sponds to Zarlino's "nat­ur­al scale".

The best option for a just-intonation ren­der­ing of the
"I-IV-II-V-I" har­mon­ic series (Asselin 2000 p. 134)

In the pre­ferred option, the ton­ics "C", "F" and "G" belong to the Pythagorean series of per­fect fifths, except "D" in the "D minor" chord which is one com­ma low­er than in "G major".

In the pic­ture, the tri­an­gles with the top point­ing to the right are major chords, and the one point­ing to the left is the "D minor" chord.

Asselin (2000 p. 137) con­cludes that the minor mode is one syn­ton­ic com­ma low­er than the major mode. Conversely, the major mode should be one syn­ton­ic com­ma high­er than the minor mode.

This is ful­ly con­sis­tent with the mod­el con­struct­ed by grama-murcchana. Since minor chro­mat­ic scales are export­ed from trans­po­si­tions of Ma-grama with all its degrees in the low­est posi­tion, their base notes are also dri­ven to the low­est posi­tions. However this requires a scale "adjust­ment" in the cas­es of "Ma10", "Ma11" and "Ma12" so that no posi­tion is cre­at­ed out­side the basic Pythagorean/harmonic scheme of the Indian sys­tem. Looking at Asselin's draw­ing (above), this means that no posi­tion would be picked up in the 2nd-order series of fifths in the right­most col­umn with two suc­ces­sive ascend­ing major thirds result­ing in a low­er­ing of 2 syn­ton­ic com­mas. This process is explained in more detail on the page Creation of just-intonation scales.

Let us lis­ten to the pro­duc­tion of the "-gr.tryTunings" gram­mar:

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 hear the sequence of chords in equal tem­pera­ment, then in just intonation.

The "I-IV-II-V-I" har­mon­ic series in equal-tempered and just-intonation

The iden­ti­ty of the last occur­rence with Asselin's favourite choice is marked by fre­quen­cies in the C-sound score: "D4" in the third chord (D minor) is one com­ma low­er than "D4" in the fourth chord (G major), while all oth­er notes (e.g. "F4") have the same fre­quen­cies in the four chords.

; I - Cmaj
i1 6.000 1.000 130.815 90.000 90.000 0.000 0.000 0.000 0.000 ; C3
i1 6.000 1.000 261.630 90.000 90.000 0.000 0.000 0.000 0.000 ; C4
i1 6.000 1.000 327.038 90.000 90.000 0.000 0.000 0.000 0.000 ; E4
i1 6.000 1.000 392.445 90.000 90.000 0.000 0.000 0.000 0.000 ; G4

; IV - Fmaj
i1 7.000 1.000 174.420 90.000 90.000 0.000 0.000 0.000 0.000 ; F3
i1 7.000 1.000 261.630 90.000 90.000 0.000 0.000 0.000 0.000 ; C4
i1 7.000 1.000 348.840 90.000 90.000 0.000 0.000 0.000 0.000 ; F4
i1 7.000 1.000 436.050 90.000 90.000 0.000 0.000 0.000 0.000 ; A4

; II - Dmin
i1 8.000 1.000 145.350 90.000 90.000 0.000 0.000 0.000 0.000 ; D3
i1 8.000 1.000 290.700 90.000 90.000 0.000 0.000 0.000 0.000 ; D4
i1 8.000 1.000 348.840 90.000 90.000 0.000 0.000 0.000 0.000 ; F4
i1 8.000 1.000 436.050 90.000 90.000 0.000 0.000 0.000 0.000 ; A4

; V - Gmaj
i1 9.000 1.000 196.222 90.000 90.000 0.000 0.000 0.000 0.000 ; G3
i1 9.000 1.000 245.278 90.000 90.000 0.000 0.000 0.000 0.000 ; B3
i1 9.000 1.000 294.334 90.000 90.000 0.000 0.000 0.000 0.000 ; D4
i1 9.000 1.000 392.445 90.000 90.000 0.000 0.000 0.000 0.000 ; G4

; I - Cmaj
i1 10.000 1.000 130.815 90.000 90.000 0.000 0.000 0.000 0.000 ; C3
i1 10.000 1.000 261.630 90.000 90.000 0.000 0.000 0.000 0.000 ; C4
i1 10.000 1.000 327.038 90.000 90.000 0.000 0.000 0.000 0.000 ; E4
i1 10.000 1.000 392.445 90.000 90.000 0.000 0.000 0.000 0.000 ; G4
s

To sum­marise, the ton­ic and dom­i­nant of each minor chord belong to the "low­er" har­mon­ic series of per­fect fifths appear­ing in the right-hand col­umn of Asselin's draw­ing repro­duced above. Conversely, the ton­ic and dom­i­nant of each major chord belong to the "Pythagorean" series of per­fect fifths in the mid­dle column.

Checking note sequences

Switches for (pro­gram­ma­ble) enhar­mon­ic adjust­ments on Bel's Shruti Harmonium (1980)

The rules for deter­min­ing the rel­a­tive posi­tions of major and minor modes (see above) deal only with the three notes that define a major or minor chord. Transpositions (murcchana-s) of the Ma-grama pro­duce basic notes in the same posi­tions, but these are also chro­mat­ic (12-degree) scales. Therefore, they also estab­lish the enhar­mon­ic posi­tions of all the notes that would be played in that har­mon­ic context.

Do these com­ply with just into­na­tion? In the­o­ry, yes, because the 12 chro­mat­ic scales obtained by these trans­po­si­tions are "opti­mal­ly con­so­nant": each of them con­tains no more than a wolf fifth.

In 1980, James Arnold con­duct­ed exper­i­ments to ver­i­fy this the­o­ret­i­cal mod­el using my Shruti har­mo­ni­um, which pro­duced pro­grammed inter­vals to an accu­ra­cy of 1 cent. Pierre-Yves Asselin played clas­si­cal pieces while Jim manip­u­lat­ed switch­es on the instru­ment to select enhar­mon­ic variants.

Listen to three ver­sions of an impro­vi­sa­tion based on Mozart's musi­cal dice game. The first one is equal-tempered, the sec­ond one uses Serge Cordier's equal-tempered scale with an extend­ed octave (1204 cents, see Microtonality) and the third uses sev­er­al dif­fer­ent scales to repro­duce a just into­na­tion. To this end, vari­ables point­ing to scales based on the har­mon­ic con­text have been insert­ed in the first gram­mar 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.

An exam­ple of Mozart's musi­cal dice game, equal-tempered
The same exam­ple, equal-tempered scale with octave stretched at 1204 cents
The same exam­ple in just intonation

Scale comparison

At the bot­tom of the pages "-to.12_scales" and "-to.Mozart", all scales are com­pared for their inter­val­ic con­tent. The com­par­i­son is based on frac­tions where these have been declared, or on floating-point fre­quen­cy ratios otherwise.

The com­par­i­son con­firms that the "Amin" chro­mat­ic scale is iden­ti­cal to "Fmaj".

By rais­ing "D" in "Ma01" we have cre­at­ed "Sa01", the first trans­po­si­tion of the Sa-grama scale. From "Sa01" we can make "Sa02" etc. by suc­ces­sive trans­po­si­tions (one fourth upwards). But the com­para­tor shows that "Sa02" is iden­ti­cal to "Ma01".

Similarly, the trans­po­si­tions "Ma13", "Ma14" etc. are iden­ti­cal to "Ma01", "Ma02" etc. The series of chro­mat­ic scales is (as expect­ed) cir­cu­lar, since "Ma13" returns to "Ma01".

Comparison of scales stored in "-to.12_scales"

For more details on fre­quen­cies, block keys, etc., see the Microtonality page.

Is this perfect?

This entire page is devot­ed to tonal sys­tems defined in terms of whole-numbered ratios (i.e. ratio­nal num­bers) mea­sur­ing tonal inter­vals. There were at least two strong incen­tives for the idea that any "pure" tonal inter­val should be treat­ed as a ratio of two whole num­bers, such as 2/1 for the octave, 3/2 for a "per­fect" fifth, 5/4 for a "har­mon­ic" major third, etc.

The his­to­ry of music (in the West) goes back to ideas attrib­uted to the Greek philoso­pher "Pythagoras" (see above) , who believed that all things were made of [ratio­nal] num­bers. This approach stum­bled upon the impos­si­bil­i­ty of mak­ing the octave cor­re­spond to a series of "per­fect fifths"…

As we found out — read above and The Two-vina exper­i­ment — this approach was not fol­lowed in India despite the fact that Indian sci­en­tists were sig­nif­i­cant­ly more advanced than the Greeks in the field of cal­cu­lus (Raju C.K., 2007).

Another incen­tive to the use of ratio­nal num­bers was Hermann von Helmholtz's notion of con­so­nance (1877) which became pop­u­lar after the peri­od of Baroque music in Europe, fol­low­ing the ini­tial claim of a "nat­ur­al tonal sys­tem" by Jean-Philippe Rameau in his Traité de l'harmonie réduite à ses principes naturels (1722). The devel­op­ment of key­board stringed instru­ments such as the pipe organ and the pianoforte had made it nec­es­sary to devel­op a tun­ing sys­tem that met the require­ments of (approx­i­mate­ly) tune­ful har­mo­ny and trans­po­si­tion to sup­port oth­er instru­ments and the human voice. It was there­fore log­i­cal to aban­don a wide vari­ety of tun­ing sys­tems, espe­cial­ly those based on tem­pera­ment, and to adopt equal tem­pera­ment as the stan­dard. By this time, com­posers were no longer explor­ing the sub­tleties of melodic/harmonic inter­vals; har­mo­ny involv­ing groups of singers and/or orches­tra paved the way for musi­cal innovation.

Looking back to the Baroque peri­od, many musi­col­o­gists tend to believe that the tun­ing sys­tem advo­cat­ed by J.S. Bach in The Well-tempered Clavier must have been equal tem­pera­ment… This belief can be dis­proved by a sys­tem­at­ic analy­sis of this cor­pus of pre­ludes and fugues on an instru­ment using all the tun­ing sys­tems en vogue dur­ing the Baroque peri­od — read the page The Well-tempered Clavier.

Composers and instru­ment mak­ers did not tune "by num­bers", as tun­ing pro­ce­dures were not doc­u­ment­ed (see Asselin P-Y., 2000). Rather, they tuned "by ear" in order to achieve a per­ceived reg­u­lar­i­ty of sets of inter­vals: the tem­pera­ment in gen­er­al. This was indeed a break with the "Pythagorean" mys­tique, because these tem­pera­ments can­not be reduced to fre­quen­cy inter­vals based on inte­ger ratios.

For instance, Zarlino’s mean­tone tem­pera­ment — read this page — is made of 12 fifths start­ing from “E♭” (“mi♭”) up to “G#” (“sol#”) dimin­ished by 2/7 of a syn­ton­ic com­ma (ratio 81/80). The fre­quen­cy 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 can­not be reduced to an inte­ger ratio. In the same way, the twelve inter­vals of the equal tem­pera­ment scale are expressed in terms of irra­tional fre­quen­cy ratios.

Overture

The goal of just into­na­tion is to pro­duce "opti­mal­ly con­so­nant" chords and sequences of notes, a legit­i­mate approach when con­so­nance is the touch­stone of the high­est achieve­ment in art music. This was indeed the case in sacred music, which aimed for a "divine per­fec­tion" guar­an­teed by the absence of "wolf tones" and oth­er odd­i­ties. In a broad­er sense, how­ev­er, music is also the field of expec­ta­tion and sur­prise. In an artis­tic process, this can mean depart­ing from "rules" — just as poet­ry requires break­ing the seman­tic and syn­tac­tic rules of a language…

Even when chords are per­fect­ly con­so­nant and con­form to the rules of har­mo­ny (as per­ceived by the com­pos­er), note sequences may devi­ate from their the­o­ret­i­cal posi­tions in order to cre­ate a cer­tain degree of ten­sion or to make a bet­ter tran­si­tion to the next chord.

When the Greek-French com­pos­er Iannis Xenakis - known for his for­malised approach to tonal­i­ty - heard Bach's First Prelude for Well-Tempered Clavier played on the Shruti Harmonium in just into­na­tion, he declared his pref­er­ence for the equal-tempered ver­sion! This made sense for a com­pos­er whose music had been praised by Tom Service for its "deep, pri­mal root­ed­ness in rich­er and old­er phe­nom­e­na even than musi­cal his­to­ry: the physics and pat­tern­ing of the nat­ur­al world, of the stars, of gas mol­e­cules, and the pro­lif­er­at­ing pos­si­bil­i­ties of math­e­mat­i­cal prin­ci­ples" (Service T, 2013).

Bernard Bel — Dec. 2020 / Jan. 2021

References

Arnold, E.J. L’intonation juste dans la théorie anci­enne de l’Inde : ses appli­ca­tions aux musiques modale et har­monique. Revue de musi­colo­gie, JSTOR, 1985, 71e (1-2), p.11-38.
👉  Download an English translation

Asselin, P.-Y. Musique et tem­péra­ment. Paris, 1985, repub­lished in 2000: Jobert. Soon avail­able in English.

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

Bel, B. Raga : approches con­ceptuelles et expéri­men­tales. Actes du col­loque "Structures Musicales et Assistance Informatique", Marseille 1988b.
👉  Download an English translation

Rao, S.; Van der Meer, W. The Construction, Reconstruction, and Deconstruction of Shruti. Hindustani music: thir­teenth to twen­ti­eth cen­turies (J. Bor). New Delhi, 2010: Manohar.

Raju, C. K. Cultural foun­da­tions of math­e­mat­ics : the nature of math­e­mat­i­cal proof and the trans­mis­sion of the cal­cu­lus from India to Europe in the 16th 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

This arti­cle focus­es on the Bol Processor as a tool for cre­at­ing and manip­u­lat­ing musi­cal scales beyond the stan­dard twelve-tone equal tem­pera­ment. It details how the soft­ware han­dles real-time MIDI and Csound for micro­ton­al tun­ing, explain­ing con­cepts like just into­na­tion and var­i­ous his­tor­i­cal tem­pera­ments such as Zarlino's and BACH tem­pera­ment. The arti­cle also dis­cuss­es the imple­men­ta­tion of scales with more than 12 degrees, ref­er­enc­ing ancient Indian musicology’s grama-murcchana mod­el and demon­strat­ing how to com­pare dif­fer­ent tun­ings. Ultimately, the doc­u­ment show­cas­es the software's flex­i­bil­i­ty in manip­u­lat­ing scales, and its util­i­ty for both musi­cal com­po­si­tion and musi­co­log­i­cal research.

A just-intonation tun­ing scheme (pre­sum­ably) used in Western har­mo­ny
(Image cre­at­ed by Bol Processor)

Microtonality is a top­ic addressed by many musi­cal sys­tems that deal with tonal inter­vals: the use of micro­tones — inter­vals small­er than a semi­tone, also called "microin­t­er­vals". It can also be extend­ed to include any music that uses inter­vals not found in the com­mon Western tun­ing of twelve equal inter­vals per octave. In oth­er words, a micro­tone can be thought of as a note that falls between the keys of a piano tuned to equal tem­pera­ment (Wikipedia).

All exam­ples shown on this page are avail­able in the sam­ple set bp3-ctests-main.zip, which is shared via GitHub. Follow the instruc­tions on page Bol Processor ‘BP3’ and its PHP inter­face to install BP3 and learn its basic operation.

👉  From ver­sion 3.0.6 (August 2024) BP3 is able to han­dle micro­tonal­i­ty in real-time MIDI as well as in Csound. — read the Check MIDI micro­tonal­i­ty page for prac­ti­cal details.

A brief presentation

On elec­tron­ic instru­ments such as the Bol Processor, micro­tonal­i­ty is a mat­ter of "micro­ton­al tun­ing", here mean­ing the con­struc­tion of musi­cal scales alien to the con­ven­tion­al one(s).

Equal tem­pera­ment is an intu­itive mod­el that divides the octave (fre­quen­cy ratio 2/1) into 12 "equal" inter­vals called semi­tones. Each semi­tone has a fre­quen­cy ratio of 2 1/12 = 1.059. Tonal inter­vals are gen­er­al­ly expressed on a log­a­rith­mic scale, which gives the ratio 2/1 a val­ue of 1200 cents. Each semi­tone is there­fore worth 100 cents in a con­ven­tion­al scale system.

An equal tem­pered scale is use­ful for mak­ing a piece of music sound the same when trans­posed to anoth­er key. However, its inter­vals do not cor­re­spond to the (pre­sum­ably) "nat­ur­al" inter­vals con­struct­ed from whole-number fre­quen­cy ratios using the num­bers 3, 4, 5. These sim­ple ratios give the impres­sion of con­so­nance because the fre­quen­cies of the upper par­tials (har­mon­ics) can coin­cide: if two strings vibrate at a fre­quen­cy ratio of 3/2 (a "per­fect fifth"), the 3rd har­mon­ic of the low­est vibra­tion is at the same fre­quen­cy as the 2nd har­mon­ic of the high­er vibration.

In an equal tem­pered scale, the har­mon­ic major third (C-E) of 400 cents has a ratio of 1.26 instead of 1.25 (5/4). The major fifth (C - G) also sounds slight­ly "out of tune" with a ratio of 1.498 instead of 1.5 (3/2). These mis­match­es can pro­duce beats that are con­sid­ered unpleas­ant in har­mon­ic contexts.

When tun­ing stringed instru­ments (such as the piano), octaves can be stretched a lit­tle to com­pen­sate for a slight inhar­monic­i­ty of the upper par­tials pro­duced by vibrat­ing strings (in high­er octaves), as advo­cat­ed by Serge Cordier. A val­ue of 1204 cents sounds fair, with the added advan­tage of mak­ing fifths sound "per­fect" in a 3/2 ratio. With this set­ting, the fre­quen­cy ratio of the stretched octaves is 2(1204/1200) = 2.0046. This effect can be repro­duced in elec­tron­ic instru­ments such as dig­i­tal pianos that imi­tate mechan­i­cal ones. We will see how it can be imple­ment­ed in the Bol Processor BP3.

Cembalo Cromatico (University of the Arts Bremen). A 19-key-per-octave instru­ment with electro­mechan­i­cal commands.

Musicologists agree that equal tem­pera­ment was nev­er exact­ly achieved on clas­si­cal instru­ments such as pipe organs and harp­si­chords. Rather, instru­ment tuners have devel­oped rules for repro­duc­ing the most pleas­ing inter­vals in par­tic­u­lar musi­cal con­texts. In oth­er words, a mechan­i­cal instru­ment should be tuned accord­ing to a style and reper­toire of music. Pierre-Yves Asselin (2000) has pub­lished a detailed com­pi­la­tion of tun­ing tech­niques used by European musi­cians and instru­ment mak­ers over the past cen­turies — lis­ten to exam­ples on the page Comparing tem­pera­ments. The same flex­i­bil­i­ty can be achieved with sounds pro­duced by "algo­rithms".

Outside of Western clas­si­cal music, a wide vari­ety of tonal sys­tems delib­er­ate­ly reject 12-tone-per-octave tonal­i­ty. Arabic-Andalusian music is often described as a "quar­ter­tone" sys­tem, which divides the octave into 24 inter­vals. Equal tem­pered scales of 7 degrees have been iden­ti­fied on var­i­ous tra­di­tion­al African instru­ments. The grama-murcchana the­o­ret­i­cal mod­el of tonal music in India claims the use of 22 shru­ti-s, pre­sum­ably microin­t­er­vals of unequal size (see below).

Many uncon­ven­tion­al sys­tems have been invent­ed and applied to con­tem­po­rary music, often depart­ing from octave-repeating scales. See for, exam­ple, the Bohlen-Pierce scale, which is based on a 3/1 inter­val (a "tri­tave") divid­ed into 13 grades/notes — see the MIDI micro­tonal­i­ty page. All these scales can be imple­ment­ed in the Bol Processor.

The scale() operator in Bol Processor BP3

We'll be dis­cussing the use of scales in the con­text of Csound, although the same is pos­si­ble in the real-time MIDI and MIDI file envi­ron­ment — read this page. When using MIDI, the machine recog­nis­es that MIDI micro­tonal­i­ty mode is required as soon as it sees a "scale()" oper­a­tor. If a tonal resource (a "-to" file) is spec­i­fied in the gram­mar or data, all scales list­ed in the resource will be accessible.

For geeks: Csound scores are flex­i­ble in the way they rep­re­sent tonal posi­tions. A com­mon con­ven­tion is the octave point pitch class. For exam­ple, the note "A4" would be assigned the tonal posi­tion "8.09", mean­ing that it is the 9th note in the 8th octave (in the English con­ven­tion). This val­ue pro­duces a note at the dia­pa­son fre­quen­cy (usu­al­ly 440 Hz) on a Csound instru­ment.
It is also pos­si­ble to spec­i­fy the note posi­tion by its fre­quen­cy in cycles per sec­ond (cps mode). This allows a high lev­el of accu­ra­cy as fre­quen­cies are expressed in float­ing point for­mat. For exam­ple, "A4" is equiv­a­lent to "440.0". Accuracy bet­ter than 1‰ is not notice­able.
As explained on page Csound tun­ing in BP3, it is pos­si­ble to send notes in both the octave point pitch class and cps for­mats to the same Csound instru­ment.
In fact, micro­ton­al scores will only use cps. The cps mode is also used by BP3 when­ev­er the dia­pa­son fre­quen­cy is not exact­ly 440 Hz. To make all fre­quen­cies vis­i­ble on Csound scores, for exam­ple, set the dia­pa­son to "400.01"…

Let us take a sim­ple exam­ple to demon­strate the use of mul­ti­ple scales. The gram­mar is:

-se.tryScales
-cs.tryScales
-to.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 into­na­tion,C4) C4 E4 A4 {8,{C4,E4,G4,C5}} {8,{C4,Eb4,G4,C5}}

In this gram­mar, the same sequence is repeat­ed three times in dif­fer­ent tunings:

  • _scale(0,0) is the default tun­ing = 12-degree equal-tempered
  • _scale(piano, C4) refers to the "piano" scale
  • _scale(just intonation, C4) refers to a (so-called) "just-intonation" scale

Note "C4" appear­ing in these oper­a­tors is the block key, here mean­ing the key that must cor­re­spond to its equal tem­pera­ment val­ue in the tun­ing set by the scale.

It may be nec­es­sary to lis­ten sev­er­al times to notice sub­tle differences:

A musi­cal sequence repeat­ed 3 times in equal-tempered, stretched octave ("piano") and "just intonation"

The sound is pro­duced by the Csound instru­ment "new-vina.orc" designed by Srikumar Karaikudi Subramanian to imi­tate the Sarasvati vina, a long-stringed instru­ment played in South India — lis­ten to his demo: Sarasvati vina. This type of instru­ment is capa­ble of high­light­ing the finest tonal subtleties.

Beats are audi­ble in the equal-tempered ver­sion, but slight­ly less so in the piano ver­sion, and almost absent in the just-intonation ren­der­ing. Looking at the Csound score makes it easy to check the­o­ret­i­cal models:

f1 0 256 1 "vina-wave-table.aiff" 0 4 0

t 0.000 60.000
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.04 90.000 90.000 0.000 0.000 0.000 0.000 ; E4
i1 2.000 1.000 8.09 90.000 90.000 0.000 0.000 0.000 0.000 ; A4
i1 3.000 8.000 8.00 90.000 90.000 0.000 0.000 0.000 0.000 ; C4
i1 3.000 8.000 8.04 90.000 90.000 0.000 0.000 0.000 0.000 ; E4
i1 3.000 8.000 8.07 90.000 90.000 0.000 0.000 0.000 0.000 ; G4
i1 3.000 8.000 9.00 90.000 90.000 0.000 0.000 0.000 0.000 ; C5
i1 11.000 8.000 8.00 90.000 90.000 0.000 0.000 0.000 0.000 ; C4
i1 11.000 8.000 8.03 90.000 90.000 0.000 0.000 0.000 0.000 ; Eb4
i1 11.000 8.000 8.07 90.000 90.000 0.000 0.000 0.000 0.000 ; G4
i1 11.000 8.000 9.00 90.000 90.000 0.000 0.000 0.000 0.000 ; C5

i1 20.000 1.000 261.630 90.000 90.000 0.000 0.000 0.000 0.000 ; dop3
i1 21.000 1.000 329.915 90.000 90.000 0.000 0.000 0.000 0.000 ; mip3
i1 22.000 1.000 440.585 90.000 90.000 0.000 0.000 0.000 0.000 ; lap3
i1 23.000 8.000 261.630 90.000 90.000 0.000 0.000 0.000 0.000 ; dop3
i1 23.000 8.000 329.915 90.000 90.000 0.000 0.000 0.000 0.000 ; mip3
i1 23.000 8.000 392.445 90.000 90.000 0.000 0.000 0.000 0.000 ; solp3
i1 23.000 8.000 524.463 90.000 90.000 0.000 0.000 0.000 0.000 ; dop4
i1 31.000 8.000 261.630 90.000 90.000 0.000 0.000 0.000 0.000 ; dop3
i1 31.000 8.000 311.340 90.000 90.000 0.000 0.000 0.000 0.000 ; mibp3
i1 31.000 8.000 392.445 90.000 90.000 0.000 0.000 0.000 0.000 ; solp3
i1 31.000 8.000 524.463 90.000 90.000 0.000 0.000 0.000 0.000 ; dop4

i1 40.000 1.000 261.630 90.000 90.000 0.000 0.000 0.000 0.000 ; Cj4
i1 41.000 1.000 327.038 90.000 90.000 0.000 0.000 0.000 0.000 ; Ej4
i1 42.000 1.000 436.137 90.000 90.000 0.000 0.000 0.000 0.000 ; Aj4
i1 43.000 8.000 261.630 90.000 90.000 0.000 0.000 0.000 0.000 ; Cj4
i1 43.000 8.000 327.038 90.000 90.000 0.000 0.000 0.000 0.000 ; Ej4
i1 43.000 8.000 392.445 90.000 90.000 0.000 0.000 0.000 0.000 ; Gj4
i1 43.000 8.000 523.260 90.000 90.000 0.000 0.000 0.000 0.000 ; Cj5
i1 51.000 8.000 261.630 90.000 90.000 0.000 0.000 0.000 0.000 ; Cj4
i1 51.000 8.000 313.956 90.000 90.000 0.000 0.000 0.000 0.000 ; Dj#4
i1 51.000 8.000 392.445 90.000 90.000 0.000 0.000 0.000 0.000 ; Gj4
i1 51.000 8.000 523.260 90.000 90.000 0.000 0.000 0.000 0.000 ; Cj5
s

In the Csound score, note names have been auto­mat­i­cal­ly replaced with their trans­la­tions in the def­i­n­i­tions of scales piano and just into­na­tion (see below). For exam­ple, in the piano scale of this exam­ple, 'C4', 'D4', 'E4'… have been replaced by 'do3', 're3', 'mi3' with an addi­tion­al 'p' mark­er: 'dop3', 'rep3', 'mip3'…
In the same way, just into­na­tion notes are labelled 'Cj4', 'Dj4', 'Ej4' etc. This renam­ing is option­al since all these scales are made up of 12 degrees with iden­ti­cal key posi­tions, but it is used here to make the Csound score more explicit.

The use of "C4" as a block key means that it is always played at a fre­quen­cy of 261.630 Hz. Consequently, "A4" is at 440 Hz in the first occur­rence and a lit­tle high­er in the piano ver­sion due to the octave stretch­ing with a ratio of 524.463 / 261.630 = 2.0046, which is 1204 cents.

Finally, we notice that, as pre­dict­ed by the mod­el, the per­fect major fifth (C - G) pro­duces the same posi­tions (392.445 Hz) in the piano and just into­na­tion scales.

In real­i­ty, the "just into­na­tion" frag­ment in this exam­ple would be out of tune if we fol­low the frame­work of tonal­i­ty pro­posed by Asselin (2000) and con­firmed by an exten­sion of the ancient grama-murcchana sys­tem in India. In the last "C minor" chord {C4, Eb4, G4, C5}, the notes "C4", "C5" and "G4" should be low­ered by a syn­ton­ic com­ma. This means that play­ing "just into­na­tion" in Western har­mo­ny requires more than a sin­gle just-intonation scale: each har­mon­ic con­text requires its own spe­cif­ic tun­ing, which indeed can­not be achieved on key­board instru­ments. A method for con­struct­ing just-intonation scales and using them in Bol Processor music is giv­en on the Just into­na­tion: a gen­er­al frame­work page.

Looking at two scales

From the gram­mar page "-gr.tryScales" we can fol­low the tonal resource file "-to.tryScales" which con­tains scale def­i­n­i­tions. Csound instru­ment def­i­n­i­tions are con­tained in "-cs.tryScales", along with the instruction

f1 0 256 1 "vina-wave-table.aiff" 0 4 0

telling the Csound instru­ment to use the "vina" wave­form. From August 2024, tonal resources and Csound instru­ments are stored in sep­a­rate files, as micro­tonal­i­ty is no longer reserved for Csound.

The fol­low­ing is a rep­re­sen­ta­tion of the piano scale (Cordier's equal temperament):

The "piano" scale: 12-tone equal-tempered with an octave stretch­ing of 4 cents (see full image).
Note but­tons for export/import of SCALA and KBM files.

All the inter­vals were set in a sin­gle click, after enter­ing "1204" as the size of the octave in cents, which set the last ratio to 2.004 (approx­i­mate­ly 501/250). The "INTERPOLATE" but­ton was then clicked to cal­cu­late the inter­me­di­ate ratios.

The scale is dis­played as a cir­cu­lar graph by click­ing on the "IMAGE" link:

The "piano" scale pro­posed by Serge Cordier. Note that the size of the whole cir­cle is 1204 cents, not 1200!

The dis­play con­firms that the posi­tion of "G" ("solp") is in the ratio 3/2 or 702 cents. However, the tonal dis­tance between "G" ("solp") and "D" ("rep") is slight­ly small­er (699 cents), which means that this scale is not a pure cycle of fifths, as the lat­ter would have end­ed after 12 steps with an octave extend­ed by a Pythagorean com­ma (scale "twelve_fifths" in "-to.tryScales"):

Cycle of 12 per­fect fifths end­ing with the "last C" one Pythagorean com­ma high­er (approx­i­mate­ly 81/80 = 22 cents)

The basekey is the key used to pro­duce base­freq. Here base­freq is set to 261.630 Hz for key #60 which is usu­al­ly the "mid­dle C" on a piano key­board. The base­freq para­me­ter has an effect on the pitch which is fur­ther adjust­ed by the val­ue of the dia­pa­son entered in "-se.tryScales". If the dia­pa­son is set to 430 Hz, the fre­quen­cy of "C4" would be 261.630 x 430 / 440 = 255.68 Hz.

The baseoc­tave para­me­ter is not stored in the Csound func­tion table, but it is required by the Bol Processor to name notes cor­rect­ly. This scale uses the Italian/French note con­ven­tion, where key #60 is called "do3" instead of "C4". Therefore baseoc­tave = 3.

Temperament

At the bot­tom of the "Scale" page is a form for con­struct­ing scales in musi­cal tem­pera­ment. The scope of this pro­ce­dure is wider than usu­al because the inter­face per­mits the mod­i­fi­ca­tion of any series of inter­vals, not just fifths and fourths.

Bol Processor pro­ce­dures for the pro­duc­tion of tem­pered scales (and all scales in gen­er­al) can be used both to visualise/hear inter­vals and chords derived from a the­o­ret­i­cal descrip­tion of the scale, and to check that a pro­ce­dure for tun­ing a mechan­i­cal instru­ment con­forms to its the­o­ret­i­cal descrip­tion. Below is an exam­ple of both approach­es applied to Zarlino's mean­tone tem­pera­ment (tem­péra­ment méso­tonique).

The long his­to­ry of the tem­pera­ment in European music is cov­ered in Pierre-Yves Asselin's dis­ser­ta­tion and pub­li­ca­tion (2000, p. 139-150). During the 16th and 17th cen­turies, European musi­cians tend­ed to pre­fer "pure" major thirds (fre­quen­cy ratio 5/4) at the cost of com­pro­mis­ing the size of the fifths. This was called the "pure third mean­tone tem­pera­ment" (tem­péra­ment méso­tonique à tierces majeures pures) which was gen­er­al­ly achieved by reduc­ing the size of cer­tain fifths by a frac­tion of the syn­ton­ic com­ma (Asselin 2000 p. 76). After this peri­od, there was anoth­er fash­ion of using per­fect fifths (fre­quen­cy ratio 3/2) and com­pro­mis­ing the size of major thirds in the same way. Both meth­ods — and many more — are imple­ment­ed in the Bol Processor. Algorithmic tun­ing is indeed eas­i­er to achieve than tun­ing a mechan­i­cal instrument!

Zarlino, theory

Let us try Zarlino's mean­tone tem­pera­ment (Asselin 2000 p. 85-87) which was pop­u­lar in the 16th and 17th cen­turies. It con­sists of 12 fifths start­ing from "E♭" ("mi♭") up to "G#" ("sol#") dimin­ished by 2/7 of a syn­ton­ic com­ma — that is 6 cents.

This should not be con­fused with Zarlino's "nat­ur­al scale", an instance of just into­na­tion.

Theoretically, this takes two steps from the pre­vi­ous­ly known posi­tion "C".

First, we enter the start­ing note "do" and the sequence of fifths "do, sol, re, sol#," spec­i­fy­ing a ratio of 3:2 with a -2/7 com­ma mod­i­fi­ca­tion (see picture).

Then we do the same with fourths (descend­ing fifths) start­ing from "do" ("C") down to "mi♭" ("E♭").

The result is dis­played by click­ing on the IMAGE link:

Zarlino's mean­tone tem­pera­ment (source Asselin 2000 p. 85)

In this tem­pera­ment, the har­mon­ic major thirds (green con­nec­tions on the graph) are equal and slight­ly small­er (384 cents) than the "pure" ones (ratio 5/4 or 386 cents). Semitones between unal­tered and altered notes are equal (71 cents). All major tones are equal (192 cents) except "do#-mi♭" and "sol#-sib" (242 cents).

Noticeable dis­so­nances are found in the "sol#-mi♭" fifth (746 cents, i.e. an extra 2 + 1/7 com­mas = 44 cents) and major thirds such as "sol#-do", "do#-fa", "fa#-sib" and "si-mi♭" which are larg­er (433 cents) than Pythagorean major thirds (408 cents). Obviously, these inter­vals are not intend­ed to be used in the musi­cal reper­toire to which this tun­ing is applied…

Zarlino mean­tone tem­pera­ment, table of inter­vals (in cents)

Comparison

A layper­son might won­der whether small tonal adjust­ments — often less than a quar­ter of a semi­tone (i.e. 25 cents) — have any notice­able effect on musi­cal works using these tun­ing sys­tems. Comparative exper­i­ments are easy with the Bol Processor.

For exam­ple, let us play one (of a bil­lion vari­a­tions) of Mozart's musi­cal dice game, with tun­ing options select­ed by acti­vat­ing a first rule in "-gr.Mozart":

// gram#1[1] S --> _vel(80)_tempo(3/4) _scale(0,0) A B // Equal tem­pera­ment
// gram#1[2] S --> _vel(80) _tempo(3/4) _scale(piano,0) A B // Equal tem­pera­ment (Cordier)
// gram#1[3] S --> _vel(80) _tempo(3/4) _scale(Zarlino_temp,0) A B // Zarlino's tem­pera­ment
// gram#1[4] S --> _vel(80) _tempo(3/4) Ajust Bjust // Just intonation

Musical pro­duc­tions are list­ed below. The ran­dom seed has been set to 998 (in "-se.Mozart") as this vari­a­tion con­tains a greater num­ber of chords, and the per­for­mance has been slowed down by "_tempo(3/4)".

It is impor­tant to remem­ber that of these options, only the first three ones (tem­pera­ments) are acces­si­ble on fixed-pitch MIDI instru­ments with 12-degree key­boards. The last one (just into­na­tion) requires a "retun­ing" of each har­mon­ic con­tent, which is pos­si­ble if the instru­ment accepts pitch­ben­der cor­rec­tions — see page MIDI micro­tonal­i­ty.

The first option (equal tem­pera­ment) is the default tun­ing of most elec­tron­ic instruments:

Equal tem­pera­ment on Mozart's dice game

The sec­ond option is an equal tem­pera­ment with octaves stretched by 4 cents, as advo­cat­ed by Serge Cordier (see above):

Equal tem­pera­ment with stretched octaves (Cordier)

The third option is Zarlino's temperament:

Zarlino's tem­pera­ment

The last option is "just intonation":

Just into­na­tion

Zarlino: a simulation of physical tuning

The tun­ing of mechan­i­cal instru­ments (such as a harp­si­chords) requires dif­fer­ent pro­ce­dures from the pro­gram­ming of "tem­pered" scales on the Bol proces­sor. However, by using the com­put­er, it is pos­si­ble to quick­ly ver­i­fy that the mechan­i­cal pro­ce­dure would pro­duce the expect­ed result. Let us demon­strate this using Zarlino's temperament.

On the com­put­er we had pro­grammed a series of 7 ascend­ing fifths dimin­ished by a 2/7 com­ma from "do" to "do#". This is impos­si­ble to achieve "by ear" on a mechan­i­cal instru­ment. Pierre-Yves Asselin (2000 p. 86) revealed the method shown below.

First step

From "do", tune two suc­ces­sive major thirds. This results in a "sol#" which is posi­tioned at a fre­quen­cy ratio of 25/16 (773 cents) above "do".

This "sol#" is actu­al­ly "SOL#+2" of the 2nd order har­mon­ic fifths down series in Asselin's tun­ing frame­work (2000 p. 62) — see page Just into­na­tion: a gen­er­al frame­work. It is not exact­ly the one expect­ed on Zarlino's mean­tone tem­pera­ment, although it is close. It is labelled "sol2#".

Second step

From "sol2#" tune down a per­fect fifth, result­ing in "do#".

Be care­ful to pro­gram a per­fect fifth, which is spec­i­fied on the form as "add 0/1 com­ma". There is also a form for cre­at­ing series of per­fect fifths which can be used for this step.

The result­ing "do#" (ratio 1.04166) is exact­ly 52/3/23, as expect­ed in Zarlino's mean­tone tem­pera­ment (Asselin 2000 p. 194).

Third step

Tune 7 equal fifths between "do" and "do#". Equalising fifths is a typ­i­cal pro­ce­dure for tun­ing mechan­i­cal instru­ments. Notes "sol", "re", "la", "mi", "si", "fa#" will be cre­at­ed. Here we spec­i­fy that all inter­vals need to be close to the frac­tion 3/2, even though they will end up as fifths dimin­ished by a 2/7 com­ma since we clicked the EQUALIZE INTERVALS button.

The miss­ing notes "sol", "re", "la", "si", "fa#" are cre­at­ed. For the exist­ing note "mi", the machine checks that its cur­rent posi­tion is close to the one pre­dict­ed by the approx­i­mate fraction.

The graph shows that the cal­cu­lat­ed posi­tion of "mi" (ratio 1.248) is slight­ly dif­fer­ent from its pre­vi­ous posi­tion (1.25), but this dif­fer­ence is neg­li­gi­ble. We keep both posi­tions on the graph, know­ing that only one will occur in a phys­i­cal tuning.

Fourth step

Now tune down 3 fifths from "do" to "mi♭", dimin­ished by a 2/7 com­ma. This can be done by repro­duc­ing "by ear" inter­vals cre­at­ed in the pre­vi­ous step. Another method is to tune "mi♭" a har­mon­ic major third below "sol" as shown on the form.

Fifth step

Once "mi♭" has been tuned we can tune three equal fifths (in fact dimin­ished by 2/7 com­ma) between "mi♭" and "do". Again we use the "equal­ize inter­vals" pro­ce­dure. At this stage, the posi­tions of "si♭" and "fa" are created.

The result is shown in the graph below:

Zarlino's mean­tone tem­pera­ment designed as a sim­u­la­tion of phys­i­cal tuning

On this graph, the ratio 1.563 for "sol#" is close (with­in 7 cents) to 1.557 of Zarlino's tem­pera­ment. On a mechan­i­cal instru­ment, since "mi" tuned by equal­is­ing fifths (3d step) was at posi­tion 1.248, adjust­ing the "mi-sol#" major third to a 5/4 ratio would set "sol#" at a bet­ter ratio (1.56).

More temperaments

All the tem­pera­ments list­ed in Asselin's the­sis can be eas­i­ly pro­grammed on the Bol Processor. Take, for exam­ple, a clas­si­cal mean­tone tun­ing (Asselin 2000 p. 76), pop­u­lar in the 16th and 17th cen­turies, also known as Chaumont (Asselin 2000 p. 109). Its aim is to pro­duce "pure thirds" (ratio 5/4). It con­sists of a series of fifths from "mi♭" ("E♭") to "sol#" ("G#") dimin­ished by a 1/4 com­ma. The prob­lem is that the tun­ing scheme — unlike Zarlino's mean­tone — does not start from "do" ("C"). There are two solutions.

The first solu­tion is to divide the series of fifths into two parts: first cre­ate the series "do, sol, re, la, mi, si, fa#, do#, sol#" of ascend­ing fifths, then the series "do, fa, si♭, mi♭" of descend­ing fifths.

In the sec­ond solu­tion, we direct­ly cre­ate the series "mi♭, si♭, fa, do, sol, re, la, mi, si, fa#, do#, sol#" of ascend­ing fifths, giv­ing the graph shown below.

Classical / Chaumont mean­tone tun­ing posi­tioned on mi♭

This tun­ing is cor­rect but it can­not be used by the Bol Processor con­sole because of the shift of the ref­er­ence. Complicated pro­ce­dures would be required to set the dia­pa­son (A4 fre­quen­cy) to the desired stan­dard and to assign the cor­rect key num­bers to the notes of the scale.

Fortunately, this prob­lem is solved in a sin­gle click by reset­ting the base of the scale to note "do", which amounts to a rota­tion of the graph.

We take this oppor­tu­ni­ty to replace the Italian/French note con­ven­tion with the English note convention.

The result is the clas­sic mean­tone scale tun­ing which is notable for its large num­ber of har­mon­ic major thirds (cir­ca 5/4, green lines):

The same meth­ods can be used to imple­ment anoth­er mean­tone tem­pera­ment pop­u­lar at the same time (16th-17th cen­tu­ry) which aims to enhance pure minor thirds (Asselin 2000 p. 83). It can also be described as a series of ascend­ing fifths from "mi♭" to "sol#" with a dif­fer­ent adjust­ment: the fifths are dimin­ished by 1/3 comma.

In this tun­ing, the minor thirds are sized 316 cents (har­mon­ic minor third, fre­quen­cy ratio 6/5) with the excep­tion of "A#-C#", "D#-F#" and "F-G#" which are all 352 cents:

Pure minor-third mean­tone temperament
Source: Asselin (2000 p. 101)

The BACH tem­pera­ment designed by Johann Peter Kellner for the music of the 18th cen­tu­ry (Asselin 2000 p. 101-103) con­tains two vari­eties of fifths (see tun­ing scheme). It is there­fore not a "mean­tone" temperament.

It can be pro­grammed in 3 steps:

  1. A series of descend­ing fifths from "do-sol-re-la-mi", dimin­ished by 1/5 comma;
  2. A series of ascend­ing per­fect fifths from "do" to "sol♭";
  3. An ascend­ing per­fect fifth from "mi" to "si".

The last inter­val is a remain­ing fifth "si-sol♭" ("B-G♭") dimin­ished by exact­ly 1/5 com­ma (i.e. 697 cents).

The result is close to Werkmeister III (1691) (Asselin 2000 p. 94), with all posi­tions close to the Pythagorean/harmonic series used for just into­na­tion.

BACH tem­pera­ment designed by Johann Peter Kellner (18th century)
Werckmeister IV tem­pera­ment
Source: Asselin (2000 p. 96)

The pro­ce­dures for tun­ing tem­pera­ments with the Bol Processor some­times dif­fer from those used for phys­i­cal instru­ments. Examples are Werckmeister IV (Asselin 2000 p. 96) and Werckmeister V (p. 99). To tune Werckmeister IV on an instru­ment (see pic­ture), we start by tun­ing the sequence G C F Bb Eb Ab Db Gb B E as per­fect descend­ing fifths. Then inter­po­late three fifths (dimin­ished by 1/3 com­ma) between G and E. Then retune G so that G D becomes a per­fect fifth, which reduces C G by 1/3 com­ma. The same is done on E so that A E becomes a per­fect fifth and E B is dimin­ished by 1/3 com­ma. Similar adjust­ments are made to retune Bb, and final­ly Ab and Db to obtain the inter­vals shown on the picture.

On the Bol Processor the same pro­ce­dure can be fol­lowed if the 1/3 com­ma cor­rec­tion is replaced by 7 cents. Another pro­ce­dure is to "add" inter­vals, which is accept­able on a dig­i­tal mod­el because of the accu­ra­cy. This pro­ce­dure is auto­mat­i­cal­ly sum­marised at the bot­tom of the "scale" page:

Werckmeister IV tem­pera­ment (Asselin 2000 p. 96)
Added fifths down: “do,fa” start­ing frac­tion 1/1
Created mean­tone down­ward notes “fa,sib” frac­tion 3/2 adjust­ed -1/3 com­ma
Created mean­tone down­ward notes “sib,mib,sol#” frac­tion 3/2 adjust­ed 1/3 com­ma
Created mean­tone down­ward notes “sol#,do#” frac­tion 3/2
Created mean­tone down­ward notes “do#,fa#” frac­tion 3/2 adjust­ed -1/3 com­ma
Created mean­tone down­ward notes “fa#,si” frac­tion 3/2
Created mean­tone down­ward notes “si,mi” frac­tion 3/2 adjust­ed -1/3 com­ma
Created mean­tone down­ward notes “mi,la” frac­tion 3/2
Created mean­tone upward notes “do,sol” frac­tion 3/2 adjust­ed -1/3 com­ma
Created mean­tone upward notes “sol,re” frac­tion 3/2

Werckmeister IV temperament

Let us com­pare some tem­pera­ments on ascend­ing unal­tered and descend­ing altered scales…

Equal-tempered tun­ing, 20th century
Classical (Chaumont) mean­tone tem­pera­ment, 16th-17th century
Meantone tem­pera­ment, pure minor thirds, 16th-17th century
BACH tem­pera­ment (Kellner) 18th century

Eighteen tem­pera­ments described by Pierre-Yves Asselin (2000) have been pro­grammed in the "-to.trTunings" tonal resource. These can be checked against var­i­ous musi­cal works, see the pages Comparing tem­pera­ments and Tonal analy­sis of musi­cal works.

As Schlick's tem­pera­ment is not ful­ly doc­u­ment­ed, we have set "do-la♭" as a pure major third and "mi-sol#" as a major third aug­ment­ed by a 2/3 com­ma. As a result, "sol#" and "la♭" remain distinct.

Tartini-Vallotti tem­pera­ment (Asselin 2000 p. 104)

Implementations of tem­pera­ments in the Bol Processor can­not be used as a ref­er­ence because (1) errors may have occurred and (2) it is impor­tant to know the musi­cal reper­toire for which each tem­pera­ment was designed. See also chap­ter VIII of Musique et tem­péra­ments (Asselin 2000 p. 139-180) for the his­to­ry of tem­pera­ments and musi­cal exam­ples dis­cussed in terms of instru­ment tuning.

Tartini-Vallotti tem­pera­ment: the inter­val list

Circular graphs show notice­able inter­vals - per­fect fifths, wolf fifths, har­mon­ic and Pythagorean major thirds - in a wide range of uncer­tain­ty. For exam­ple, in the Tartini-Vallotti tem­pera­ment shown above, "C-E" is list­ed as a har­mon­ic major third (green seg­ment), although it is slight­ly larg­er (+7 cents) than a "pure" major third (ratio 5/4). The safe way to check that this tem­pera­ment match­es its descrip­tion is to read the devi­a­tions in the inter­val list (see picture).

D'Alembert-Rousseau tem­pera­ment with series of slight­ly larger/smaller fifths

In a few tem­pera­ments the sizes of the fifths are not giv­en explic­it­ly, as the tuner is instruct­ed to tune slight­ly larg­er (than per­fect) or slight­ly small­er fifths. This is the case in the D'Alembert-Rousseau tem­pera­ment (Asselin 2000 p. 119), where the series "do, fa, sib, mi♭, sol#" is expect­ed to be slight­ly larg­er and "sol#, do#, fa#, si, mi" slight­ly small­er… In addi­tion, the frame should be "com­plete", which implies the absence of a remain­ing com­ma frac­tion when clos­ing the cycle of fifths.

In this exam­ple, the con­di­tions were met by increas­ing the slight­ly larg­er fifths "do, fa, sib, mi♭, sol#" by 1/12 com­ma (+2 cents). To com­plete the cycle, the last series "sol#, do#, fa#, si, mi" was declared as equalised inter­vals. This result­ed in the slight­ly small­er fifths being reduced by 2 cents to reflect the slight­ly larg­er ones. Incidentally, this -1/12 com­ma adjust­ment is also the one required to con­struct an equal-tempered scale.

The whole process of cre­at­ing a scale is auto­mat­i­cal­ly record­ed in the Comments sec­tion of the "scale" page, for exam­ple "d_alembert_rousseau":

D'Alembert-Rousseau tem­pera­ment (Asselin 2000 p. 119)
Created mean­tone upward notes “do,sol,re,la,mi” frac­tion 3/2 adjust­ed -1/4 com­ma
Created mean­tone down­ward notes “do,fa,sib,mib,sol#” frac­tion 3/2 adjust­ed 1/12 com­ma
Equalized inter­vals over series “sol#,do#,fa#,si,mi” approx frac­tion 2/3 adjust­ed 2.2 cents to ratio = 0.668

It took us about 8 min­utes to under­stand the pro­ce­dure and anoth­er 8 min­utes to tune the scale accord­ing to D'Alembert-Rousseau…

For a com­par­i­son of tem­pera­ments applied to sev­er­al pieces of Baroque music, see the page Comparing tem­pera­ments.

The full set of tun­ing schemes cur­rent­ly imple­ment­ed on the Bol Processor is pre­sent­ed on this page : https://bolprocessor.org/misc/figs/list-scales.php

More than 12 degrees

We will use a mod­el from ancient Indian musi­col­o­gy to demon­strate divi­sions of more than 12 degrees per octave. This mod­el is an inter­pre­ta­tion of the descrip­tion of the basic scales (gra­ma) and their trans­po­si­tions (mur­ccha­na) in Bharata Muni's Natya Shastra, a trea­tise dat­ing from a peri­od between 400 BCE and 200 CE — read the page The two-vina exper­i­ment.

The inner wheel of Arnold's mod­el, anal­o­gous to the "Ma-grama" of Natya Shastra

The grama-murcchana mod­el and its appli­ca­tion to Western har­mo­ny is described on the page Just into­na­tion: a gen­er­al frame­work. Its appli­ca­tion to Hindustani music is pre­sent­ed on the page Raga into­na­tion.

E.J. Arnold (1982) had designed a device to demon­strate the trans­po­si­tion of scales in Bharata's mod­el. The actu­al divi­sion of the octave is 23 steps, but this amounts to hav­ing 22 option­al posi­tions (shru­ti-s) since the base note has only one option.

The result can be described as 11 pairs of note posi­tions giv­ing 211 = 2048 pos­si­ble chro­mat­ic scales. Of these, only 12 are "opti­mal­ly con­so­nant", i.e. with only one "wrong" major fifth, short by 1 syn­ton­ic com­ma (pramāņa ṣru­ti), which here, for sim­plic­i­ty, is 21 cents.. These 12 chro­mat­ic scales are the ones that can be used in har­mon­ic or modal music to expe­ri­ence the best consonance.

Below is a pic­ture of the "gra­ma" scale as dis­played by the BP3 editor:

A frame­work for just-intonation chro­mat­ic scales based on the grama-murcchana mod­el in ancient Indian musi­col­o­gy (see full image). The syn­ton­ic com­ma (pramāņa ṣru­ti) has been set at 21 cents. The note "m4" is not marked.

In this scale we use the con­ven­tion­al Indian sargam nota­tion: sa, re, ga, ma , pa, dha, ni, trans­lat­ed as "C", "D", "E", "F", "G", "A", "B". Note that "re" ("D"), for exam­ple, can be found in four posi­tions: r1 and r2 are the two pos­si­bil­i­ties for "D♭", the first one (256/243) being called "Pythagorean" (derived from five descend­ing fifths) and the sec­ond one (16/15) "har­mon­ic" (derived from one descend­ing fifth and one descend­ing major third). Positions r2 and r3 are "D♮" (nat­ur­al) with r3 being har­mon­ic (10/9) and r4 being Pythagorean (9/8).

Tanpura: the drone of Indian musi­cians
(man­u­fac­tured in Miraj)

There are spe­cial cas­es (vis­i­ble on the wheel mod­el) where m3 is almost super­im­posed on p1 and m4 with p2, their dif­fer­ence being an inaudi­ble schis­ma (32805 / 32768 = 1.00112 = 1.9 cents). We use m3p1 and m4p2 to denote these merged positions.

The inter­vals giv­en in cents are those iden­ti­fied by Western musi­col­o­gists: the Pythagorean lim­ma (256/243 = 90 cents), the syn­ton­ic com­ma (81/80 = 22 cents) and the minor semi­tone (25/24 = 70 cents). This shows that a shru­ti, as described by Bharata, can be of 3 dif­fer­ent sizes. However, in its appli­ca­tion to Indian music, this mod­el should be ren­dered "flex­i­ble" with a size of the syn­ton­ic com­ma (pramāņa ṣru­ti) between 0 and 56.8 cents — see page The two-vina exper­i­ment.

Clicking on the IMAGE link dis­plays a cir­cu­lar graph­ic rep­re­sen­ta­tion of the "gra­ma" scale:

The "gra­ma" scale, an inter­pre­ta­tion of the ancient Indian the­o­ry of musi­cal scales

Let us play a dia­ton­ic scale accord­ing to the grama-murcchana mod­el, an occur­rence of Western just-intonation scales, and the piano stretched-octave tun­ing, again with "C4" (or "sa_4") as the block key. The gram­mar is called "-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 into­na­tion, C4) C4 D4 E4 F4 G4 A4 B4 C5 _scale(piano, C4) do4 re4 mi4 fa4 sol4 la4 si4 do5

Diatonic scales in the grama-murcchana, just-intonation and tem­pered stretched-octave tunings

The dif­fer­ences are bare­ly per­cep­ti­ble for a sim­ple rea­son: the first two are iden­ti­cal, since this just into­na­tion scale is a spe­cial case of grama-murcchana, while the piano scale is a fair approx­i­ma­tion of the for­mer. This can be seen in the fol­low­ing Csound score:

f1 0 256 1 "vina-wave-table.aiff" 0 4 0

t 0.000 60.000
i1 0.000 0.500 261.630 90.000 90.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 ; sa_4
i1 0.500 0.500 294.334 90.000 90.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 ; r4_4
i1 1.000 0.500 327.038 90.000 90.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 ; g3_4
i1 1.500 0.500 348.753 90.000 90.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 ; m1_4
i1 2.000 0.500 392.445 90.000 90.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 ; p4_4
i1 2.500 0.500 436.137 90.000 90.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 ; d3_4
i1 3.000 0.500 490.556 90.000 90.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 ; n3_4
i1 3.500 0.500 523.260 90.000 90.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 ; sa_5

i1 4.000 0.500 261.630 90.000 90.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 ; Cj4
i1 4.500 0.500 294.334 90.000 90.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 ; Dj4
i1 5.000 0.500 327.038 90.000 90.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 ; Ej4
i1 5.500 0.500 348.753 90.000 90.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 ; Fj4
i1 6.000 0.500 392.445 90.000 90.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 ; Gj4
i1 6.500 0.500 436.137 90.000 90.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 ; Aj4
i1 7.000 0.500 490.556 90.000 90.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 ; Bj4
i1 7.500 0.500 523.260 90.000 90.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 ; Cj5

i1 8.000 0.500 261.630 90.000 90.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 ; do4
i1 8.500 0.500 293.811 90.000 90.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 ; re4
i1 9.000 0.500 329.916 90.000 90.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 ; mi4
i1 9.500 0.500 349.538 90.000 90.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 ; fa4
i1 10.000 0.500 392.445 90.000 90.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 ; sol4
i1 10.500 0.500 440.585 90.000 90.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 ; la4
i1 11.000 0.500 494.742 90.000 90.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 ; si4
i1 11.500 0.500 524.464 90.000 90.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 ; do5
s

Let us now lis­ten to the 22 shru­tis against a drone ("C" and "G" trans­lat­ed 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}

Time struc­ture of the drone sequence (played 2 times)

Note the use of the _retro per­for­mance tool to reverse the order of the Full_scale sequence. The _legato(300) com­mand extends the dura­tion of notes up to three times their cur­rent dura­tion. This pro­duces a Droneseq sound struc­ture sim­i­lar to that of the Indian tan­pu­ra.

In the sound ren­der­ing of this exam­ple, a 279 Hz sam­ple wave­form of a Miraj tan­pu­ra was used to feed the Karplus-Strong algo­rithm.

The 23 posi­tions of Bharata's grama-murcchana mod­el inter­pret­ed as "just intonation"

f1 0 0 1 "tanpura_waveform.aiff" 0 4 0

t 0.000 60.000
i1 1.125 1.125 261.630 30.000 30.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 ; sa_4
i1 0.000 4.500 196.223 30.000 30.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 ; p4_3
i1 2.250 3.375 261.630 30.000 30.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 ; sa_4
i1 5.625 1.125 261.630 30.000 30.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 ; sa_4
i1 3.375 4.500 130.815 30.000 30.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 ; sa_3
i1 4.500 4.500 196.223 30.000 30.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 ; p4_3
i1 9.000 1.000 261.630 90.000 90.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 ; sa_4
i1 6.750 3.375 261.630 30.000 30.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 ; sa_4
i1 10.000 1.000 275.496 90.000 90.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 ; r1_4
i1 10.125 1.125 261.630 30.000 30.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 ; sa_4
i1 11.000 1.000 279.159 90.000 90.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 ; r2_4
i1 7.875 4.500 130.815 30.000 30.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 ; sa_3
i1 12.000 1.000 290.671 90.000 90.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 ; r3_4
i1 9.000 4.500 196.223 30.000 30.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 ; p4_3
i1 13.000 1.000 294.334 90.000 90.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 ; r4_4
i1 11.250 3.375 261.630 30.000 30.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 ; sa_4
i1 14.000 1.000 310.032 90.000 90.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 ; g1_4
i1 14.625 1.125 261.630 30.000 30.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 ; sa_4
i1 15.000 1.000 313.956 90.000 90.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 ; g2_4
i1 12.375 4.500 130.815 30.000 30.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 ; sa_3
i1 16.000 1.000 327.038 90.000 90.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 ; g3_4
i1 17.000 1.000 331.224 90.000 90.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 ; g4_4
i1 13.500 4.500 196.223 30.000 30.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 ; p4_3
i1 18.000 1.000 348.753 90.000 90.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 ; m1_4
i1 15.750 3.375 261.630 30.000 30.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 ; sa_4
i1 19.000 1.000 353.201 90.000 90.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 ; m2_4
i1 19.125 1.125 261.630 30.000 30.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 ; sa_4
i1 20.000 1.000 367.852 90.000 90.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 ; m3p1_4
i1 16.875 4.500 130.815 30.000 30.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 ; sa_3
i1 21.000 1.000 372.038 90.000 90.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 ; m4p2_4
i1 18.000 4.500 196.223 30.000 30.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 ; p4_3
i1 22.000 1.000 387.474 90.000 90.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 ; p3_4
i1 20.250 3.375 261.630 30.000 30.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 ; sa_4
i1 23.000 1.000 392.445 90.000 90.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 ; p4_4
i1 23.625 1.125 261.630 30.000 30.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 ; sa_4
i1 24.000 1.000 413.375 90.000 90.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 ; d1_4
i1 21.375 4.500 130.815 30.000 30.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 ; sa_3
i1 25.000 1.000 418.608 90.000 90.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 ; d2_4
i1 26.000 1.000 436.137 90.000 90.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 ; d3_4
i1 22.500 4.500 196.223 30.000 30.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 ; p4_3
i1 27.000 1.000 441.632 90.000 90.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 ; d4_4
i1 24.750 3.375 261.630 30.000 30.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 ; sa_4
i1 28.000 1.000 465.178 90.000 90.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 ; n1_4
i1 28.125 1.125 261.630 30.000 30.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 ; sa_4
i1 29.000 1.000 470.934 90.000 90.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 ; n2_4
i1 25.875 4.500 130.815 30.000 30.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 ; sa_3
i1 30.000 1.000 490.556 90.000 90.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 ; n3_4
i1 27.000 4.500 196.223 30.000 30.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 ; p4_3
i1 31.000 1.000 496.574 90.000 90.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 ; n4_4
i1 29.250 3.375 261.630 30.000 30.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 ; sa_4
i1 32.625 1.125 261.630 30.000 30.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 ; sa_4
i1 30.375 4.500 130.815 30.000 30.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 ; sa_3
i1 32.000 4.000 523.260 90.000 90.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 ; sa_5
i1 31.500 4.500 196.223 30.000 30.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 ; p4_3
i1 33.750 4.500 261.630 30.000 30.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 ; sa_4
i1 38.000 1.333 523.260 90.000 90.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 ; sa_5
i1 34.875 4.500 130.815 30.000 30.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 ; sa_3
i1 39.333 1.333 496.574 90.000 90.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 ; n4_4
i1 40.666 1.334 490.556 90.000 90.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 ; n3_4
i1 42.000 1.333 470.934 90.000 90.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 ; n2_4
i1 43.333 1.333 465.178 90.000 90.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 ; n1_4
i1 44.666 1.334 441.632 90.000 90.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 ; d4_4
i1 46.000 1.333 436.137 90.000 90.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 ; d3_4
i1 47.333 1.333 418.608 90.000 90.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 ; d2_4
i1 48.666 1.334 413.375 90.000 90.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 ; d1_4
i1 50.000 1.333 392.445 90.000 90.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 ; p4_4
i1 51.333 1.333 387.474 90.000 90.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 ; p3_4
i1 52.666 1.334 372.038 90.000 90.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 ; m4p2_4
i1 54.000 1.333 367.852 90.000 90.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 ; m3p1_4
i1 55.333 1.333 353.201 90.000 90.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 ; m2_4
i1 56.666 1.334 348.753 90.000 90.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 ; m1_4
i1 58.000 1.333 331.224 90.000 90.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 ; g4_4
i1 59.333 1.333 327.038 90.000 90.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 ; g3_4
i1 60.666 1.334 313.956 90.000 90.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 ; g2_4
i1 62.000 1.333 310.032 90.000 90.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 ; g1_4
i1 63.333 1.333 294.334 90.000 90.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 ; r4_4
i1 64.666 1.334 290.671 90.000 90.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 ; r3_4
i1 66.000 1.333 279.159 90.000 90.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 ; r2_4
i1 67.333 1.333 275.496 90.000 90.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 ; r1_4
i1 68.666 5.334 261.630 90.000 90.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 ; sa_4
s

Listening to this sequence makes it clear that treat­ing a sequence of shruti-s as a "scale" is icon­o­clas­tic for the aes­thet­ics of Hindustani music: most of these notes sound out of tune when played in rela­tion to a drone (the tan­pu­ra). As dis­cussed on page The two-vina exper­i­ment, the pres­ence of a drone makes it unlike­ly that mutu­al con­so­nance in melod­ic inter­vals will always pre­vail over con­so­nance with the drone's upper par­tials. If the grama-murcchana sys­tem has any rel­e­vance to the per­for­mance of clas­si­cal ragas — see page Raga into­na­tion — then at the very least the mod­el should be made flex­i­ble enough to accom­mo­date the cor­rect into­na­tion in melod­ic movements.

Comparing scales

A scale com­par­i­son tool is avail­able on the tonal resource page. Click on COMPARE TONAL SCALES and select the ones that need to be analysed.

Scales are com­pared 2 by 2, so that a set of n scales gives n2/2 results, which are dis­played in tables. The fol­low­ing is a com­par­i­son of scales called Amin, Cmaj and equal_tempered. The first two ones are described on the page Just into­na­tion: a gen­er­al frame­work.

Comparison of three tonal scales

All com­par­isons are made on a 12-degree (chro­mat­ic) scale, mea­sur­ing the sizes of per­fect fifths — some of which may be wolf's fifths as explained on the just into­na­tion page. The aver­age dif­fer­ence of fifths is cal­cu­lat­ed by sum­ming the squares of the dif­fer­ences between the sizes of fifths of iden­ti­cal degrees (count­ed in cents):

D=\ \sqrt{\frac{\sum_{^{i=1}}^{12}\left(fa_i\ -\ fb_i\right)^2}{12}}

The dis­tance between Amin and Cmaj is 8.9 cents and the dis­tance between each of these scales and the equal-tempered one is almost 6 cents.

The sec­ond table is the result of a search for the small­est dis­tance when trans­pos­ing one of the scales by 1 to 11 semi­tones. Here we see that Amin (see pic­ture) and Cmaj (see pic­ture) are prac­ti­cal­ly equiv­a­lent — they are har­mon­i­cal­ly relat­ed — since the dif­fer­ence goes down to 1.2 cents. The best match­ing ver­sion of Cmaj is con­struct­ed by trans­pos­ing Amin up a fifth (7 semi­tones), thus mov­ing 'C' to 'G'. For details of this pro­ce­dure, see the sec­tion on Creation of just-intonation scales.

This device can be fur­ther devel­oped to pro­duce a clas­si­fi­ca­tion of select­ed tonal scales high­light­ing similar/identical tun­ing schemes.

Another approach to tonal scale com­par­i­son is to assess the con­cor­dance between a musi­cal work and the full set of doc­u­ment­ed tun­ing pro­ce­dures: read the page Tonal analy­sis of musi­cal works.

The syntactic model

Settings in "-se.tryOneScale"

The fol­low­ing are guide­lines for a cor­rect and use­ful imple­men­ta­tion of micro­ton­al scales in BP3. We fol­low sim­ple sequences list­ed in "-gr.tryOneScale". This gram­mar is linked to "-to.tryOneScale" which con­tains a unique just into­na­tion scale with its notes labelled "Cj", "Cj#", "Dj" etc. In "-se.tryOneScale", the Note con­ven­tion has been set to 0 (English), the 'C4' key num­ber to 60 and the Default block key to 60. All these para­me­ters are impor­tant to repro­duce the same effects. Read the Check MIDI micro­tonal­i­ty page for prac­ti­cal details.

Rule #1: If only 1 micro­ton­al scale is loaded with the gram­mar, it will be used by default in all productions.

Example: Let us play:

S --> C4 A4 G4

It pro­duces the fol­low­ing 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 dis­play of "Cj4" etc. makes it clear that just into­na­tion has been used. This is also con­firmed by ratio 436.137/261.630 = 1.666 = 5/3.

Why not use the note labels "Cj4", "Aj"' and "Gj4" in the gram­mar? This only works if, for exam­ple, the scale is specified:

S --> _scale(just into­na­tion, Cj4) Cj4 Aj4 Gj4

This will give the same Csound score because the block key "Cj4" is set to 261.630 Hz in the scale def­i­n­i­tion. Using "Aj4" as the block key would give:

S --> _scale(just into­na­tion, Aj4) Cj4 Aj4 Gj4

and a sight­ly dif­fer­ent 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 dia­pa­son fre­quen­cy in "-se.tryOneScale". The ratios are unchanged, e.g. 440.007/263.952 = 5/3.

How can we play equal-tempered inter­vals with this gram­mar? This is achieved by spec­i­fy­ing the default scale: _scale(0,0):

S --> _scale(0,0) C4 A4 G4

yield­ing the fol­low­ing 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

The fre­quen­cies are not explic­it because the default Csound score for­mat uses the octave point pitch-class rep­re­sen­ta­tion, for exam­ple "A4" is the 9th pitch-class or the 8th octave (on a stan­dard MIDI instru­ment). To make them explic­it, just set the dia­pa­son in "-se.tryOneScale" to a slight­ly dif­fer­ent val­ue, for exam­ple 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 the fre­quen­cy of "C4" to be 261.630 Hz, but the val­ue of 261.626 Hz dif­fers due to round­ing. The ratio of the dif­fer­ence is 261.630/261.626 = 1.000015 = 0.026 cents!

Rule #2: When pars­ing a sequence of notes, if a micro­ton­al scale has been spec­i­fied, the pars­er will first attempt to match the note against labels in the cur­rent micro­ton­al scale. If there is no match, it will try to inter­pret the note accord­ing to the Note con­ven­tion spec­i­fied in settings.

For instance:

S --> _scale(just into­na­tion, Cj4) Cj4 Aj4 Gj4 D4 F4 E4

The notes in the sequence "D4 F4 E4" are trans­lat­ed to the cor­re­spond­ing posi­tions in the into­na­tion scale. The result is vis­i­ble in both the Csound score and the graphic.

This prac­tice is only rel­e­vant to 12-degree tonal scales where posi­tions are equiv­a­lent — albeit with slight­ly dif­fer­ent fre­quen­cy ratios. For exam­ple, since the match­ing is based on key num­bers, feed­ing the "gra­ma" (23-degree) micro­ton­al scale (see above) with "C4 D4 E4" would pro­duce "sa_4 r2_4 r4_4", where r2_4 is close to "C#4" and r4_4 is close to "D4". This makes sense because the key sequence is 60-62-64. There is cur­rent­ly no gener­ic way of map­ping note posi­tions in scales with dif­fer­ent divi­sions. An addi­tion­al dif­fi­cul­ty would be scales with an inter­val oth­er than 2/1.

We will show lat­er that rule #2 pro­vides a flex­i­bil­i­ty that makes it very easy to insert enhar­mon­ic cor­rec­tions in a musi­cal score by select­ing one of 12 just-intonation chro­mat­ic scales — see the page Just into­na­tion: a gen­er­al frame­work.

Rule #3: If the pars­er can­not iden­ti­fy a note in the cur­rent micro­ton­al scale and against the note con­ven­tion, it will try oth­er micro­ton­al scales pre­vi­ous­ly loaded in the sequence.

Top of the "-gr.tryScales" grammar

This can be demon­strat­ed with "-gr.tryScales". At the top of the gram­mar are list­ed the scales that will be sent to the con­sole along with the gram­mar and instruc­tions. Each scale becomes "active" in the gram­mar once a _scale() oper­a­tor 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 into­na­tion. There are no prob­lems with note "fap3", which belongs to the piano scale, nor with "C4" which is known in the English note con­ven­tion. As pre­dict­ed by rule #2, the note "C4" is trans­lat­ed to its equiv­a­lent "Cj4" and played in just intonation.

Since the baseoc­tave of the scale piano is 3 (see the image above), the pitch of "fap3" will be close to that of "F4".

What hap­pens to note "rep4"? If the piano scale had not been acti­vat­ed, this note would be reject­ed as a syn­tax error. However, fol­low­ing rule #3, the pars­er finds it in the piano scale. This results in the key num­ber 74 since baseoc­tave = 3.

The note is inter­pret­ed as key #74 in the just into­na­tion scale, dis­played as "Dj5". This can be seen in the Csound score below and in 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

As a result, notes found in a sequence are always inter­pret­ed as belong­ing to the scale declared imme­di­ate­ly to the left, even if their label belongs to a dif­fer­ent scale or note convention.

Therefore, it is not a good idea to mix notes belong­ing to dif­fer­ent scales with­out declar­ing the scale before they occur. A "_scale()" dec­la­ra­tion is best placed at the begin­ning of each sequence, espe­cial­ly at the begin­ning of the right argu­ment of a rule.

References

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

Asselin, P.-Y. Musique et tem­péra­ment. Paris, 1985, repub­lished in 2000: Jobert. Soon avail­able in English.

Continuous parameters in Csound scores

The fol­low­ing are sim­ple exam­ples explain­ing the design of Csound scores con­tain­ing instruc­tions to con­trol para­me­ters that can vary con­tin­u­ous­ly. We will use sim­ple notes (no sound-object) and no Csound instru­ment file, so that all scores can eas­i­ly con­vert­ed into sound files using the "default.orc" orches­tra file sup­plied with BP3.

Consider the fol­low­ing gram­mar with the metronome set to 60 beats per minute:

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

The graph­ic dis­play does not show pitch­bend controls:

Pianoroll and object dis­play of "C5 D5 E5"

The _pitchcont instruc­tion at the begin­ning instructs the inter­preter to inter­po­late pitch­bend val­ues through­out whole sequence. This process can be inter­rupt­ed with _pitchstep.

The _pitchrange(200) instruc­tion indi­cates that the pitch may vary between -200 and +200 units, which are mapped to the MIDI stan­dard val­ues 0 and +16383 (both log­a­rith­mic). This is the range required by "default.orc", which counts inter­vals in cents. There are 1200 cents in an octave. So, _pitchbend(100) would raise the fol­low­ing note by one semitone.

Note: No pitch­bend val­ue is assigned to 'C5'. The default val­ue is '0'. Notes 'D5' and 'E5' are pre­ced­ed by _pitchbend(0), which assigns a '0' val­ue. All pitch­bend vari­a­tions are assigned dur­ing the pro­lon­ga­tion of 'D5'. How is this done?

The MIDI out­put is decep­tive. Pitchbend assign­ments are not tak­en into account in this format:

"C5 D5 E5" in the MIDI output

However, the Csound out­put has tak­en all para­me­ters into account:

"C5 D5 E5" (with pitch­bend assign­ments) in the Csound output

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, see doc­u­men­ta­tion) labelled f101 has been cre­at­ed by Bol Processor and insert­ed above 'D5' to spec­i­fy vari­a­tions of the pitch­bend para­me­ter. This table is called by the 10th argu­ment of line 'D5'. Arguments 8 and 9 con­tain the start and end val­ues of pitch­bend accord­ing to "default.orc". These are 0 for all three notes.

The sec­ond argu­ment of the table is the dura­tion of its valid­i­ty, here 1.000 sec­onds. The third argu­ment (256) is its size — always a pow­er of 2. The fourth argu­ment "-7" spec­i­fies the GEN rou­tine that Csound will use for its inter­po­la­tion (see doc­u­men­ta­tion). By default, GEN07 (lin­ear inter­po­la­tion) is used.

Numbers high­light­ed in red indi­cate the val­ues of pitch­bend dur­ing the vari­a­tion: 0, 120, -150, 0. Numbers in black indi­cate the time inter­vals between two val­ues. Note that 102 + 51 + 103 = 256.

All con­tin­u­ous para­me­ters are han­dled in the same way by the Bol Processor when cre­at­ing Csound scores. This includes stan­dard MIDI con­trols (vol­ume, pres­sure, mod­u­la­tion, panoram­ic, pitch­bend) and any addi­tion­al para­me­ters defined in the Csound instru­ment file. See for exam­ple the page Sarasvati Vina.

Note

There is a workaround for play­ing the same piece with the cor­rect pitch­bend 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 poly­met­ric struc­ture, with a line of silences '-' placed in the right places to receive pitch­bend mod­i­fi­ca­tions. As pitch­bend mod­i­fies all sounds on the cur­rent MIDI chan­nel it will also mod­i­fy 'D5' dur­ing its pro­lon­ga­tion. The fol­low­ing is a MIDI ren­der­ing on PianoTeq — at a high­er speed, so that 'D5' remains audible:

C5 D5 E5 in the MIDI for­mat with pitch­bend effects on D5

Csound tuning in BP3

This page deals with the Bol Processor BP3 using an updat­ed ver­sion of the Csound orches­tra file "default.orc". Changes to the dia­pa­son ('A4' fre­quen­cy) in the set­tings now affect the pro­duc­tion of Csound scores.

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

if (p4 < 15.0) then
icps = cpspch(p4)
else icps = p4
endif

By default, this instru­ment receives the pitch val­ue (argu­ment p4) in the octave point pitch-class for­mat — see doc­u­men­ta­tion. In this case, the fre­quen­cy depends only on the dia­pa­son set up in the Csound orches­tra, or 440 Hz by default, i.e. cpspch(8.09) = 440.

To "tune" the Csound instru­ment to the dia­pa­son select­ed for the project in the Bol Processor BP3, if the base fre­quen­cy is not exact­ly 440 Hz, p4 will con­tain the actu­al fre­quen­cy of the note (cps for­mat) instead of its octave point pitch-class val­ue. The orches­tra file "default.orc" can decide which for­mat is used because (1) no note is ever sent above the 14th octave and (2) fre­quen­cies are nev­er low­er than 15 Hz. So, the val­ue of p4 auto­mat­i­cal­ly makes the deci­sion in "default.orc".

Let us try for example:

S --> A4 B4 C5

If the dia­pa­son is 440 Hz, we get the stan­dard Csound score output:

i1 0.000 1.000 8.09 90.000 90.000 0.000 0.000 0.000 0.000 ; A4
i1 1.000 1.000 8.11 90.000 90.000 0.000 0.000 0.000 0.000 ; B4
i1 2.000 1.000 9.00 90.000 90.000 0.000 0.000 0.000 0.000 ; C5

On the first line, 'A4' is set to 8.09 in the octave point pitch-class format.

Once we set the dia­pa­son to 435 Hz the Csound score will become:

i1 0.000 1.000 435.00 90.000 90.000 0.000 0.000 0.000 0.000 ; A4
i1 1.000 1.000 488.27 90.000 90.000 0.000 0.000 0.000 0.000 ; B4
i1 2.000 1.000 517.31 90.000 90.000 0.000 0.000 0.000 0.000 ; C5

This score shows the actu­al fre­quen­cies of the notes, for exam­ple 'A4' = 435 Hz. This sequence of notes will sound slight­ly low­er than the pre­vi­ous one.

If the dia­pa­son is rad­i­cal­ly dif­fer­ent from 440 Hz, the names of the notes will not change. Only the fre­quen­cies will be change accord­ing­ly. See for exam­ple the Csound score cre­at­ed with 'A4' = 300 Hz:

i1 0.000 1.000 300.00 90.000 90.000 0.000 0.000 0.000 0.000 ; A4
i1 1.000 1.000 336.74 90.000 90.000 0.000 0.000 0.000 0.000 ; B4
i1 2.000 1.000 356.76 90.000 90.000 0.000 0.000 0.000 0.000 ; C5

Let us now exam­ine the changes in dia­pa­son when deal­ing with Csound objects. Take for exam­ple the object "a" in "-gr.tryCsoundObjects". The Csound score of its pro­to­type (as shown in "-so.tryCsoundObjects") is a mix of 3 instruments:

t 0 120
i1 0 0.5 4.05 ; F0
i2 1.5 0.5 5.05 ; F1
i3 1.5 0.2 643.5 1 ; D#5
e

Instruments i1 and i2 use the octave point pitch-class for­mat, while instru­ment i3 uses the direct cps for­mat. This score has been cre­at­ed with 'A4' = 440 Hz which explains why 643.5 Hz is labelled D#5. The labelling of the notes is of minor impor­tance as it will be revised when the per­for­mance Csound score is created.

When 'A4' = 440 Hz the Csound score of a per­for­mance of "a" exact­ly reflects the score in its prototype:

t 0.000 60.000
i1 0.000 0.250 4.05 90.000 90.000 0.000 0.000 0.000 0.000 ; F0
i2 0.750 0.250 5.05 0.000 0.000 90.000 90.000 0.000 0.000 0.000 ; F1
i3 0.750 0.100 643.50 1.000 ; D#5
s
e

If the dia­pa­son is set to 500 Hz the Csound score of the per­for­mance will be:

t 0.000 60.000
i1 0.000 0.250 24.80 90.000 90.000 0.000 0.000 0.000 0.000 ; F0
i2 0.750 0.250 49.61 0.000 0.000 90.000 90.000 0.000 0.000 0.000 ; F1
i3 0.750 0.100 643.50 1.000 ; C#5
s
e

Pianorolls with A4 = 440 Hz (left) and 500 Hz (right)

All pitch­es are now giv­en in the cps for­mat. The pitch­es of notes F0 and F1 would be changed in the sound out­put. However, the pitch of instru­ment i3 would remain at 643.50 Hz as set in the sound-object's pro­to­type. As a result of the change in ref­er­ence, the name of the note pro­duced by i3 would now be 'C#5'. This change is reflect­ed in the pianorolls (see image).

Important…

This auto­mat­ic the pitch for­mat selec­tion does not work if you try to send a fre­quen­cy low­er than 15 Hz, as it would be the case for 'F0' in the pre­vi­ous exam­ple if the dia­pa­son was set to 300 Hz. This should nev­er hap­pen, how­ev­er, as 15 Hz is below the range of audi­ble sounds.

At the oppo­site end, octaves beyond 14 are way beyond the musi­cal range since 'C15' is already more than 535 KHz…

This might have an inci­dence on Csound scores being used for pro­duc­ing any­thing else than music, although in this case the use of the octave point pitch-class for­mat is very unlikely.

Changing middle C key number

"Middle C", or 'C4' in the English con­ven­tion, is the key in the mid­dle of a piano key­board. By con­ven­tion, its MIDI key num­ber is 60, but this val­ue can be changed in the settings.

For exam­ple, set­ting 'C4' to key #48 will cause all notes on a MIDI device to be one octave (12 semi­tones) low­er . This does not change the Csound sound out­put. Playing "A4 B4 C5" with 'C4' oth­er than 60 will pro­duce the same sound out­put and the same Csound score, but in the cps pitch format:

t 0.000 120.000
i1 0.000 1.000 440.00 90.000 90.000 0.000 0.000 0.000 0.000 ; A4
i1 1.000 1.000 493.88 90.000 90.000 0.000 0.000 0.000 0.000 ; B4
i1 2.000 1.000 523.25 90.000 90.000 0.000 0.000 0.000 0.000 ; C5
s
e

When applied to Csound objects, chang­ing 'C4' to a key num­ber oth­er than 60 will not change the note names or their actu­al fre­quen­cies, but it will use the cps pitch for­mat. For exam­ple, play­ing "a" will result in the fol­low­ing Csound score:

t 0.000 60.000
i1 0.000 0.250 21.83 90.000 90.000 0.000 0.000 0.000 0.000 ; F0
i2 0.750 0.250 43.65 0.000 0.000 90.000 90.000 0.000 0.000 0.000 ; F1
i3 0.750 0.100 643.50 1.000 ; D#5
s
e

Misc. grammar controls

The fol­low­ing short exam­ples illus­trate the usage of spe­cif­ic con­trols of the infer­ence mech­a­nism in gram­mars of Bol Processor (BP2 and BP3).

_destru

This instruc­tion is use­ful in pat­tern gram­mars con­tain­ing rep­e­ti­tion and pseudo-repetition mark­ers. For instance, the fol­low­ing gram­mar cre­ates a sequence of two occur­rences of vari­able "X" which may fur­ther be derived as "abc" or "de".

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

In the first rule, (= ) is called a mas­ter paren­the­sis and (: ) a slave paren­the­sis — con­tain­ing a copy of the for­mer. This master-slave depen­den­cy is main­tained through­out sub­se­quent derivations.

The only eli­gi­ble final deriva­tions would be "abcabc" or "dede". However, the final string would be dis­played for instance "(= abc)(: abc)". To obtain a usable string in which 'a', 'b', 'c' may be fur­ther instan­ti­at­ed as sound-objects, it is nec­es­sary to remove struc­tur­al mark­ers. The Bol Processor does it auto­mat­i­cal­ly once the final string has been cre­at­ed, i.e. there are no more can­di­date rules for fur­ther deriva­tions. However, the user may want to dis­play strings with­out their mark­ers. Instruction _destru is used to this effect.

Let us con­sid­er for instance "-gr.tryDESTRU":

-se.tryDESTRU
-al.abc
// This gram­mar pro­duces var­i­ous pat­terns on alpha­bet …

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 --> lamb­da [This is an eras­ing 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 --> lamb­da [This is an eras­ing rule]

The first rule in sub­gram­mar #1 cre­ates a self-embedding pat­tern in which the start sym­bol S is cre­at­ed again recur­sive­ly. This recur­siv­i­ty might pro­duce unlim­it­ed strings. To avoid this, each rule in sub­gram­mar #1 is assigned ini­tial weight "2" decreased by "1" once the rule has been fired. Therefore, no rule may be used more than 2 times. Subgrammar #2 con­tains a sin­gle rule delet­ing the left-over "S".

Subgrammar #3 destroys the struc­ture by eras­ing all paren­the­ses and master/slave mark­ers, then it rewrites vari­ables "X", "Y", "Z" as strings of ter­mi­nal sym­bols. Tracing the pro­duc­tion 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 strict­ly from left to right due to the LIN instruction.

The fol­low­ing is a series of 10 items pro­duced by this grammar:

abc­cb­bc­cbaabc­cb­bc­c­ba
cbacbacbacbacbacbacbacbacbacbacbac­ba
abc­cb­bc­cbaabc­cb­bc­c­ba
cbaabc­cbaabc
cbacbacbacbacbacbacbacbacbacbacbac­ba
abcab­cab­cab­cab­cab­cab­cabc
abcab­cab­cab­cab­cab­cab­cabc
cbb­cab­cab­cabc­cb­b­cab­cab­cabc­cb­b­cab­cab­cabc­cb­b­cab­cab­cabc
cbacbacbac­ba
cbbc­cb­bc­cbacb­bc­cb­bc­cbacb­bc­cb­bc­cbacb­bc­cb­bc­c­ba

Complex pat­terns are vis­i­ble on the fol­low­ing sound ren­der­ing of the first item using "-so.abc" sound-object prototypes.

Item "abc­cb­bc­cbaabc­cb­bc­c­ba" cre­at­ed by -gr.tryDESTRU

Mozart’s musical dice game

Dice animation
Source: MaskOfVirtue

The fol­low­ing is a ver­sion of a Musikalisches Würfelspiel attrib­uted to the Austrian com­pos­er Wolfgang Amadeus Mozart (1756-1791). The source is a man­u­script pub­lished by B. Schott's Söhne (Mainz 39542) con­tain­ing musi­cal frag­ments and their cor­re­spon­dances to num­bers select­ed by rolling two dice.

We will show an imple­men­ta­tion of this game that works with both BP2.9.8 and BP3. The BP3 exam­ple has already been intro­duced in the page Bol Processor ‘BP3’ and its PHP inter­face. Here we will focus on the impro­vi­sa­tion­al aspects.

The imple­men­ta­tion took time because the score frag­ments were not avail­able in dig­i­tal for­mat. Today, sim­i­lar projects can be eas­i­ly han­dled using MusicXML scores and the import pro­ce­dure imple­ment­ed in the Bol Processor BP3.

Set up options

Settings of “-gr.Mozart”
Settings of "-gr.Mozart"

In the set­tings of the gram­mar "-gr.Mozart" (see pic­ture), the option "Non-stop improvize" is checked. This means that the machine is expect­ed to cre­ate and play new vari­a­tions of the theme for­ev­er. On the BP3, in the absence of real-time MIDI, only 10 vari­a­tions are pro­duced, saved in a MIDI or Csound file and imme­di­ate­ly avail­able for lis­ten­ing via the inter­face players.

At the bot­tom of the set­tings, the note con­ven­tion has been set to "French". At the top of it is the "seed for ran­dom­iza­tion" which deserves a comment.

Computers pro­duce sequences of ran­dom num­bers deter­mined by suc­ces­sive calls to the rand() func­tion in the C pro­gram­ming lan­guage. Another func­tion called srand(x) reseeds the sequence with num­ber "x": the seed. A giv­en seed will pro­duce the same sequence for sub­se­quent calls of rand(). The only way to get unpre­dictable sequences is to use a dif­fer­ent seed each time a ran­dom sequence is required. In oth­er words, shuf­fle the cards. To do this, the Bol Processor picks up a seed in the time() func­tion which returns the cur­rent date/time as an inte­ger number.

Here, the seed is set to "999". Unless mod­i­fied, the sequence of vari­a­tions of Mozart's dice game should be iden­ti­cal (on the same com­put­er). In order to gen­er­ate ran­dom sequences we need to instruct the machine to reseed the sequence with an arbi­trary num­ber of its choice. By con­ven­tion, this is done by set­ting the seed to 0.

The result

Below you can hear a sequence of 10 vari­a­tions cre­at­ed with seed = 999. The MIDI file was down­loaded and sent to a PianoTeq syn­the­sis­er tuned to equal temperament:

Ten vari­a­tions of "-gr.Mozart" pro­duced with seed = 999

I remem­ber play­ing vari­a­tions of "-gr.Mozart" to a team of music teach­ers who con­clud­ed enthu­si­as­ti­cal­ly: "That must be Mozart!"

You can also down­load the MIDI file and send it to a MIDI device. Below is anoth­er set of vari­a­tions sent by BP2.9.8 to a Roland D-50 syn­the­sis­er whose split patch assigned notes to dif­fer­ent instru­ments accord­ing to their tonal position:

Variations of "-gr.mozart" played on a split patch of Roland D-50

The same can be achieved by using _chan() or _ins() instruc­tions in the gram­mar to assign instru­ments via reserved MIDI chan­nels or their indices in Csound.

These exam­ples are played on elec­tron­ic instru­ments tuned to equal tem­pera­ment. However, Bol Processor + Csound can pro­duce the same by exploit­ing micro­tonal­i­ty to pro­duce works tuned in dif­fer­ent tem­pera­ments or in pure into­na­tion. Below is the same set of pieces using Zarlino's mean­tone tem­pera­ment (Asselin 2000 p. 85):

Mozart's musi­cal dice game in Zarlino's mean­tone temperament

Finally, "just into­na­tion" can be achieved by retun­ing the instru­ment at each mea­sure to match the har­mon­ic con­text, as explained on the page Just into­na­tion, a gen­er­al frame­work. This gives the fol­low­ing inter­pre­ta­tion — the best tun­ing, in my opinion:

Mozart's musi­cal dice game in just intonation

The MIDI for­mat does not allow for these pre­cise context-sensitive micro­ton­al adjustments.

The stochastic model

A chal­leng­ing aspect of this game is that there is no equal prob­a­bil­i­ty of get­ting num­bers in the range 2 … 12. For exam­ple, a sum of 7 is six times more like­ly than a sum of 2 or 12. The design­er of this game may have been aware of this, as the less like­ly num­bers have been mapped to musi­cal sequences that sound more "dis­so­nant".

In order to sim­u­late the dice game, it was there­fore nec­es­sary to assign weights to the rules that reflect­ed the real prob­a­bil­i­ties. This was achieved in the gram­mar (below) by assign­ing weights K1, K2 etc. to all rules acti­vat­ed by dice rolls.

-se.Mozart

// Use a harp­si­chord or piano sound

LIN [Select rules ran­dom­ly and apply from left to right]

gram#1[1] S --> _vel(80) A B
gram#1[2] A --> A1 A2 A3 A4 A5 A6 A7 A8 A1 A2 A3 A4 A5 A6 A7 A'8
gram#1[3] B --> B1 B2 B3 B4 B5 B6 B7 B8 B1 B2 B3 B4 B5 B6 B7 B8

LIN
gram#2[1] <K1=1> A1 --> T96
gram#2[2] <K2=2> A1 --> T32
gram#2[3] <K3=3> A1 --> T69
gram#2[4] <K4=4> A1 --> T40
gram#2[5] <K5=5> A1 --> T148
gram#2[6] <K6=6> A1 --> T104
gram#2[7] <K7=5> A1 --> T152
gram#2[8] <K8=4> A1 --> T119
gram#2[9] <K9=3> A1 --> T98
gram#2[10] <K10=2> A1 --> T3
gram#2[11] <K11=1> A1 --> T54

LIN [These rules could be mixed with the pre­ced­ing ones. But pro­duc­tion is faster in this way.]
gram#3[1] <K1> A2 --> T22
gram#3[2] <K2> A2 --> T6
gram#3[3] <K3> A2 --> T95
gram#3[4] <K4> A2 --> T17
gram#3[5] <K5> A2 --> T74
gram#3[6] <K6> A2 --> T157
gram#3[7] <K7> A2 --> T60
gram#3[8] <K8> A2 --> T84
gram#3[9] <K9> A2 --> T142
gram#3[10] <K10> A2 --> T87
gram#3[11] <K11> A2 --> T130

LIN
gram#4[1] <K1> A3 --> T141
gram#4[2] <K2> A3 --> T128
gram#4[3] <K3> A3 --> T158
gram#4[4] <K4> A3 --> T113
gram#4[5] <K5> A3 --> T163
gram#4[6] <K6> A3 --> T27
gram#4[7] <K7> A3 --> T171
gram#4[8] <K8> A3 --> T114
gram#4[9] <K9> A3 --> T42
gram#4[10] <K10> A3 --> T165
gram#4[11] <K11> A3 --> T10

LIN
gram#5[1] <K1> A4 --> T41
gram#5[2] <K2> A4 --> T63
gram#5[3] <K3> A4 --> T13
gram#5[4] <K4> A4 --> T85
gram#5[5] <K5> A4 --> T45
gram#5[6] <K6> A4 --> T167
gram#5[7] <K7> A4 --> T53
gram#5[8] <K8> A4 --> T50
gram#5[9] <K9> A4 --> T156
gram#5[10] <K10> A4 --> T61
gram#5[11] <K11> A4 --> T103

LIN
gram#6[1] <K1> A5 --> T105
gram#6[2] <K2> A5 --> T146
gram#6[3] <K3> A5 --> T153
gram#6[4] <K4> A5 --> T161
gram#6[5] <K5> A5 --> T80
gram#6[6] <K6> A5 --> T154
gram#6[7] <K7> A5 --> T99
gram#6[8] <K8> A5 --> T140
gram#6[9] <K9> A5 --> T75
gram#6[10] <K10> A5 --> T135
gram#6[11] <K11> A5 --> T28

LIN
gram#7[1] <K1> A6 --> T122
gram#7[2] <K2> A6 --> T46
gram#7[3] <K3> A6 --> T55
gram#7[4] <K4> A6 --> T2
gram#7[5] <K5> A6 --> T97
gram#7[6] <K6> A6 --> T68
gram#7[7] <K7> A6 --> T133
gram#7[8] <K8> A6 --> T86
gram#7[9] <K9> A6 --> T129
gram#7[10] <K10> A6 --> T47
gram#7[11] <K11> A6 --> T37

LIN
gram#8[1] <K1> A7 --> T11
gram#8[2] <K2> A7 --> T134
gram#8[3] <K3> A7 --> T110
gram#8[4] <K4> A7 --> T159
gram#8[5] <K5> A7 --> T36
gram#8[6] <K6> A7 --> T118
gram#8[7] <K7> A7 --> T21
gram#8[8] <K8> A7 --> T169
gram#8[9] <K9> A7 --> T62
gram#8[10] <K10> A7 --> T147
gram#8[11] <K11> A7 --> T106

LIN
gram#9[1] A8 --> T5
gram#9[2] A'8 --> T'5

LIN
gram#10[1] <K1> B1 --> T70
gram#10[2] <K2> B1 --> T117
gram#10[3] <K3> B1 --> T66
gram#10[4] <K4> B1 --> T90
gram#10[5] <K5> B1 --> T25
gram#10[6] <K6> B1 --> T138
gram#10[7] <K7> B1 --> T16
gram#10[8] <K8> B1 --> T120
gram#10[9] <K9> B1 --> T65
gram#10[10] <K10> B1 --> T102
gram#10[11] <K11> B1 --> T35

LIN
gram#11[1] <K1> B2 --> T121
gram#11[2] <K2> B2 --> T39
gram#11[3] <K3> B2 --> T139
gram#11[4] <K4> B2 --> T176
gram#11[5] <K5> B2 --> T143
gram#11[6] <K6> B2 --> T71
gram#11[7] <K7> B2 --> T155
gram#11[8] <K8> B2 --> T88
gram#11[9] <K9> B2 --> T77
gram#11[10] <K10> B2 --> T4
gram#11[11] <K11> B2 --> T20

LIN
gram#12[1] <K1> B3 --> T26
gram#12[2] <K2> B3 --> T126
gram#12[3] <K3> B3 --> T15
gram#12[4] <K4> B3 --> T7
gram#12[5] <K5> B3 --> T64
gram#12[6] <K6> B3 --> T150
gram#12[7] <K7> B3 --> T57
gram#12[8] <K8> B3 --> T48
gram#12[9] <K9> B3 --> T19
gram#12[10] <K10> B3 --> T31
gram#12[11] <K11> B3 --> T108

LIN
gram#13[1] <K1> B4 --> T9
gram#13[2] <K2> B4 --> T56
gram#13[3] <K3> B4 --> T132
gram#13[4] <K4> B4 --> T34
gram#13[5] <K5> B4 --> T125
gram#13[6] <K6> B4 --> T29
gram#13[7] <K7> B4 --> T175
gram#13[8] <K8> B4 --> T166
gram#13[9] <K9> B4 --> T82
gram#13[10] <K10> B4 --> T164
gram#13[11] <K11> B4 --> T92

LIN
gram#14[1] <K1> B5 --> T112
gram#14[2] <K2> B5 --> T174
gram#14[3] <K3> B5 --> T73
gram#14[4] <K4> B5 --> T67
gram#14[5] <K5> B5 --> T76
gram#14[6] <K6> B5 --> T101
gram#14[7] <K7> B5 --> T43
gram#14[8] <K8> B5 --> T51
gram#14[9] <K9> B5 --> T137
gram#14[10] <K10> B5 --> T144
gram#14[11] <K11> B5 --> T12

LIN
gram#15[1] <K1> B6 --> T49
gram#15[2] <K2> B6 --> T18
gram#15[3] <K3> B6 --> T58
gram#15[4] <K4> B6 --> T160
gram#15[5] <K5> B6 --> T136
gram#15[6] <K6> B6 --> T162
gram#15[7] <K7> B6 --> T168
gram#15[8] <K8> B6 --> T115
gram#15[9] <K9> B6 --> T38
gram#15[10] <K10> B6 --> T59
gram#15[11] <K11> B6 --> T124

LIN
gram#16[1] <K1> B7 --> T109
gram#16[2] <K2> B7 --> T116
gram#16[3] <K3> B7 --> T145
gram#16[4] <K4> B7 --> T52
gram#16[5] <K5> B7 --> T1
gram#16[6] <K6> B7 --> T23
gram#16[7] <K7> B7 --> T89
gram#16[8] <K8> B7 --> T72
gram#16[9] <K9> B7 --> T149
gram#16[10] <K10> B7 --> T173
gram#16[11] <K11> B7 --> T44

LIN
gram#17[1] <K1> B8 --> T8
gram#17[2] <K2> B8 --> T78
gram#17[3] <K3> B8 --> T8
gram#17[4] <K4> B8 --> T8
gram#17[5] <K5> B8 --> T8
gram#17[6] <K6> B8 --> T8
gram#17[7] <K7> B8 --> T8
gram#17[8] <K8> B8 --> T8
gram#17[9] <K9> B8 --> T8
gram#17[10] <K10> B8 --> T8
gram#17[11] <K11> B8 --> T8

SUB1 [Substitute only once.]
gram#18[1] T1 --> {fa3 re3 sol3,fa5 re5 sol5}
gram#18[2] T2 --> {{2,si2,sol3}-,la4 {2,fa#4 sol4 si4 sol5}}
gram#18[3] T3 --> {{2,do3,mi3}-,sol5 do5 mi5}
gram#18[4] T4 --> {{1,sol2 si2} sol3 si2,sol5 re5_}
gram#18[5] T5 --> {sol2 {2,sol3 fa3 mi3 re3}, {2,sol4,si4,re5,sol5}-}
gram#18[6] T'5 --> {sol2 {2,si3 sol3 fa#3 mi3}, {2,sol4,si4,re5,sol5}-}
gram#18[7] T6 --> {{2,do3,mi3}-,sol4 do5 mi5}
gram#18[8] T7 --> {{2,do3,sol3}-,mi5 do5 mi5 sol5 do6 sol5}
gram#18[9] T8 --> {do3 sol2 do2,do5_ -}
gram#18[10] T9 --> {sol3_ sol2,{do5,mi5}{si4,re5}-}
gram#18[11] T10 --> {sol3_ -,si4 la4 si4 do5 re5 si4}
gram#18[12] T11 --> {do3 re3 re2,mi5 do5 si4 la4 sol4 fa#4}
gram#18[13] T12 --> {do3 do3 do3,{mi4 mi4 mi4},{do5 do5 do5}}
gram#18[14] T13 --> {{2,mi3,sol3}-,do5 sol4 mi4}
gram#18[15] T15 --> {{2,do3,sol3}{do3,mi3},mi5 {1,sol5 mi5}do5}
gram#18[16] T16 --> {{2,re3,fa#3}{do3,fa#3},la5 fa#5 re5}
gram#18[17] T17 --> {{2,mi3,sol3}-,do5 sol4 do5 mi5 sol4 do5}
gram#18[18] T18 --> {{2,do3,mi3}{do3,sol3},sol4 do5 mi5}
gram#18[19] T19 --> {{2,do3,sol3}{do3,mi3},{1,mi5 do5}mi5 sol5}
gram#18[20] T20 --> {si2_ -,sol5{1,si5 re6}re5}
gram#18[21] T21 --> {do3 re3 re2,do5 mi5 sol5 re5 la4 fa#5}
gram#18[22] T22 --> {do3_ -,mi5 do5 sol4}
gram#18[23] T23 --> {{3,fa3 mi3 re3 mi3 fa3 sol3},fa5 mi5 re5 mi5 fa5 sol5}
gram#18[24] T25 --> {re3_ do3,re4 fa#4 la4 re5 fa#5 la5}
gram#18[25] T26 --> {{3,do3 mi3 sol3 mi3 do4 do3}, {do5,mi5}{do5,mi5}{do5,mi5}}
gram#18[26] T27 --> {{2,sol3,si3}-,fa5 mi5 fa5 re5 do5 si4}
gram#18[27] T28 --> {{2,do3,la3}-,fa#5 re5 la4 la5 fa#5 re5}
gram#18[28] T29 --> {sol3_ sol2,{2,si4 re5 sol5 re5}si4}
gram#18[29] T31 --> {{2,do3,sol3}{do3,sol3},{1,mi5 do5}sol4 mi5}
gram#18[30] T32 --> {{2,do3,mi3}-,sol4 do5 mi5}
gram#18[31] T34 --> {sol3_ -,{2,mi5 do5 re5 si4} sol4}
gram#18[32] T35 --> {{2,re3,fa#3}{do3,la3},la4 re5 fa#5}
gram#18[33] T36 --> {do3 re3 re2,la4 mi5 re5 sol5 fa#5 la5}
gram#18[34] T37 --> {{2,si2,re3}-,{2,sol5 si5 sol5 re5}si4}
gram#18[35] T38 --> {{1,{do3,mi3}sol3_} {1,{do3,mi3}sol3_} {1,{do3,mi3}sol3_}, do5 sol4 mi5}
gram#18[36] T39 --> {{3,si2 re3 sol3 re3 si2 sol2},sol5 sol4 sol4}
gram#18[37] T40 --> {{2,do3,mi3}-,do5 si4 do5 mi5 sol4 do5}
gram#18[38] T41 --> {{2,do3,mi3}-,{2,do5 si4 do5 mi5} sol4}
gram#18[39] T42 --> {sol2_ -,si4 do5 re5 si4 la4 sol4}
gram#18[40] T43 --> {{2,do3,mi3}-,sol5{2,fa5 mi5 re5 do5}}
gram#18[41] T44 --> {fa3_ sol3,la4{2,fa5 re5 la4 si4}}
gram#18[42] T45 --> {{2,mi3,sol3}-,do5 si4 do5 sol4 mi4 do4}
gram#18[43] T46 --> {{2,si2,re3}-,sol5{2,si5 sol5 re5 si4}}
gram#18[44] T47 --> {{2,si2,re3}-,sol5{1,sol5 re5}si5}
gram#18[45] T48 --> {{2,do3,sol3}{do3,mi3},mi5{2,do5 mi5 sol5 do6}}
gram#18[46] T49 --> {{1,{do3,mi3}sol3_} {1,{do3,mi3}sol3_} {1,{do3,mi3}sol3_},mi5 do5 sol4}
gram#18[47] T50 --> {{2,mi3,sol3}-,do5{1,mi5 do5}sol4}
gram#18[48] T51 --> {{2,do3,mi3}-,do5 sol4 mi5 do5 sol5 mi5}
gram#18[49] T52 --> {fa3_ sol3,re5 do#5 re5 fa5 sol4 si4}
gram#18[50] T53 --> {do3_ -,{do5,mi5}{1,do5 re5,mi5 fa5}{mi5,sol5}}
gram#18[51] T54 --> {do3 do3 do3,{mi4,do5}{mi4,do5}{mi4,do5}}
gram#18[52] T55 --> {{2,si2,re3}-,sol5 si5 re5}
gram#18[53] T56 --> {{2,sol2,sol3}sol3,{1,re5 si4}sol4 -}
gram#18[54] T57 --> {{1,{do3,mi3}sol3_} {1,{do3,mi3}sol3_} {1,{do3,mi3}sol3_},mi5 do5 sol4}
gram#18[55] T58 --> {{1,{do3,mi3}sol3_} {1,{do3,mi3}sol3_} {1,{do3,mi3}sol3_},sol5 mi5 do5}
gram#18[56] T59 --> {{1,{do3,mi3}sol3_} {1,{do3,mi3}sol3_} {1,{do3,mi3}sol3_},sol5 do5 mi5}
gram#18[57] T60 --> {{2,do3,mi3}-,sol5{2,fa5 mi5 re5 do5}}
gram#18[58] T61 --> {{2,mi3,sol3}-,do5{1,mi5 do5}sol5}
gram#18[59] T62 --> {do3 re3 re2,mi5 do5 si4 sol4 la4 fa#4}
gram#18[60] T63 --> {do3_ -,{2,mi5 do5 si4 do5} sol4}
gram#18[61] T64 --> {{2,do3,sol3}{do3,sol3},mi5 sol5 do6 sol5 mi5 do5}
gram#18[62] T65 --> {{2,re3 fa#3}-,{1,re5 la4}re5 fa#5}
gram#18[63] T66 --> {{re3,la3}{re3,fa#3}{do3,re3},fa#5 la5 fa#5}
gram#18[64] T67 --> {{2,do3,mi3}{mi3,sol3},do5 si4 do5 mi5 sol4 do5}
gram#18[65] T68 --> {si2_ -,sol5{2,si5 sol5 re5 sol5}}
gram#18[66] T69 --> {{2,do3,mi3}-,sol5 mi5 do5}
gram#18[67] T70 --> {re3_ do3,fa#5{2,la5 fa#5 re5 fa#5}}
gram#18[68] T71 --> {{2,si2,re3}{si2,re3},{2,sol5 si5 re6 si5} sol5}
gram#18[69] T72 --> {fa3_ sol3,fa5 mi5 re5 do5 si4 re5}
gram#18[70] T73 --> {{1,{do3,mi3}sol3_} {1,{do3,mi3}sol3_} {1,{do3,mi3}sol3_},sol5 mi5 do5}
gram#18[71] T74 --> {{2,do3,mi3}-,do6 si5 do6 sol5 mi5 do5}
gram#18[72] T75 --> {do3 do3 do3,{re5,fa#5}{re5,fa#5}{re5,fa#5}}
gram#18[73] T76 --> {{2,do3,mi3}{do3,sol3},do6 si5 do6 sol5 mi5 do5}
gram#18[74] T77 --> {{2,si2,re3}{si2,sol3},{1,sol5 si5}sol5 re5}
gram#18[75] T78 --> {do3_ do2,do5 do4 -}
gram#18[76] T80 --> {do3_ -,re5 la4 fa#5}
gram#18[77] T82 --> {{2,si2,sol3}{si2,re3},{1,re5 si4}sol4 sol5}
gram#18[78] T84 --> {{2,do3,mi3}-,do5 sol4 mi5 do5 sol5 mi5}
gram#18[79] T85 --> {{2,mi3,sol3}-,do5 mi5 sol4}
gram#18[80] T86 --> {{2,si2,sol3}-,re5{1,re5 sol5}si5}
gram#18[81] T87 --> {{2,do3,mi3}{do3,sol3},sol5 do5 mi5}
gram#18[82] T88 --> {{2,si2,re3}{si2,re3},sol5 re5 sol5 si5 sol5 re5}
gram#18[83] T89 --> {{1,fa3 mi3}re3 sol3,{1,fa5 mi5}re5 sol5}
gram#18[84] T90 --> {{2,do3,la3}{do3,la3},fa#5 la5 re6 la5 fa#5 la5}
gram#18[85] T92 --> {{2,sol2,sol3}sol3,{si4,re5}{1,sol5 si5}re5}
gram#18[86] T95 --> {{2,do3,mi3}-,sol5 mi5 do5}
gram#18[87] T96 --> {do3_ -,mi5 do5 sol4}
gram#18[88] T97 --> {{2,si2,re3}{si2,sol3},sol5 fa#5 sol5 re5 si4 sol4}
gram#18[89] T98 --> {{1,{do3,mi3}sol3_} {1,{do3,mi3}sol3_} {1,{do3,mi3}sol3_},do5 sol4 mi5}
gram#18[90] T99 --> {{2,do3,la3}{do3,la3},fa#5 la5 re5}
gram#18[91] T101 --> {{2,do3,sol3}{do3,mi3},mi5 re5 mi5 sol5 do6 sol5}
gram#18[92] T102 --> {{2,do3,la3}{do3,la3},{1,fa#5 re5}la4 fa#5}
gram#18[93] T103 --> {{2,mi3,sol3}-,{2,do5 mi5 do5 sol4} mi4}
gram#18[94] T104 --> {do3_ -,mi5 re5 mi5 sol5 do6 sol5}
gram#18[95] T105 --> {do3_ -,fa#5{2,la5 fa#5 re5 fa#5}}
gram#18[96] T106 --> {do3 re3 re2,la4{2,re5 do5 si4 la4}}
gram#18[97] T108 --> {{2,do3,sol3}{do3,mi3},mi5 sol5 do6}
gram#18[98] T109 --> {{2,fa3,la3}{sol3,re4},re5 fa5 re5 fa5 si4 re5}
gram#18[99] T110 --> {do3 re3 re2,si4 la4 la4 sol4 sol4 fa#4,re5 do5 do5 si4 si4 la4}
gram#18[100] T112 --> {{1,{do3,mi3}sol3_} {1,{do3,mi3}sol3_} {1,{do3,mi3}sol3_},mi5 do5 sol4}
gram#18[101] T113 --> {{2,sol3,si3}-,fa5 re5 si4}
gram#18[102] T114 --> {sol3 sol3 sol3,{si4,re5}{si4,re5}{si4,re5}}
gram#18[103] T115 --> {{2,do3,mi3}-,do5 sol4 mi5 do5 sol5 mi5}
gram#18[104] T116 --> {fa3_ sol3,re5 fa5 la5 fa5 re5 si4}
gram#18[105] T117 --> {{2,re3,fa#3}-,re5 la4 re5 fa#5 la5 fa#5}
gram#18[106] T118 --> {do3 re3 re2,mi5 la5 sol5 si5 fa#5 la5}
gram#18[107] T119 --> {{2,do3,mi3}-,mi5 do5 sol5 mi5 do6 sol5}
gram#18[108] T120 --> {{2,re3,fa#3}{do3,fa#3},re6{2,la5 fa#5 re5 la4}}
gram#18[109] T121 --> {{2,si2,sol3}-,sol5{1,si5 sol5}re5}
gram#18[110] T122 --> {{si2,re3}{si2,re3}{si2,re3},{2,sol5 fa#5 sol5 si5} re5}
gram#18[111] T124 --> {do3 do3 do3,{mi4,do5}{mi4,do5}{mi4,do5}}
gram#18[112] T125 --> {sol3 sol2 -,{2,sol5 mi5 re5 si4}sol4}
gram#18[113] T126 --> {mi3_ {1,mi3 do3},do5 sol4 do5 mi5 sol5 {do5,mi5}}
gram#18[114] T128 --> {sol2_ -,si4 re5 sol5}
gram#18[115] T129 --> {{si2,re3}{si2,re3}{si2,sol3},{2,la5 sol5 fa#5 sol5}re5}
gram#18[116] T130 --> {do3 do3 do3,mi4 mi4 mi4,do5 do5 do5}
gram#18[117] T132 --> {sol3 sol2 -,{do5,mi5}{1,si4 sol4,re5 si4}sol4}
gram#18[118] T133 --> {{2,si2,sol3}-,re5{2,sol5 re5 si4 re5}}
gram#18[119] T134 --> {do3 re3 re2,la4 mi5{si4,re5}{la4,do5}{sol4,si4}{fa#4,la4}}
gram#18[120] T135 --> {{do3,re3}{do3,re3}{do3,re3},fa#5{1,fa#5 re5}la5}
gram#18[121] T136 --> {{2,do3,mi3}-,do6 si5 do6 sol5 mi5 do5}
gram#18[122] T137 --> {{1,{do3,mi3}sol3_} {1,{do3,mi3}sol3_} {1,{do3,mi3}sol3_},do5 sol4 mi5}
gram#18[123] T138 --> {{3,re2 re3 do#3 re3 do3 re3},{la4,re5,fa#5}fa#5_}
gram#18[124] T139 --> {si2_ -,{2,sol5 si5 sol5 si5}re5}
gram#18[125] T140 --> {{do3,fa#3}{do3,fa#3}{do3,la3},la4{1,la4 re5}fa#5}
gram#18[126] T141 --> {{2,si2,sol3}sol2,re5 mi5 fa5 re5 do5 si4}
gram#18[127] T142 --> {{2,do3,mi3}-,do5 sol4 mi5}
gram#18[128] T143 --> {{2,si2,re3}{si2,re3},sol5{1,re5 si4}sol4}
gram#18[129] T144 --> {{1,{do3,mi3}sol3_} {1,{do3,mi3}sol3_} {1,{do3,mi3}sol3_},sol5 do5 mi5}
gram#18[130] T145 --> {fa3_ sol3,re5 fa5 la4 re5 si4 re5}
gram#18[131] T146 --> {do3 do3 do3,{fa#4,re5}{re5,fa#5}{fa#5,la5}}
gram#18[132] T147 --> {do3 re3 re2,mi5 do6 si5 sol5 la5 fa#5}
gram#18[133] T148 --> {{2,do3,mi3}-,do6 si5 do6 sol5 mi5 do5}
gram#18[134] T149 --> {fa3_ sol3,{1,fa5 re5}la4 si4}
gram#18[135] T150 --> {{3,do3 si2 do3 re3 mi3 fa#3},{sol4,do5,mi5}mi5_}
gram#18[136] T152 --> {{2,do3,mi3}-,sol5{2,fa5 mi5 re5 do5}}
gram#18[137] T153 --> {do3_ -,re5 la4 fa#5 re5 la5 fa#5}
gram#18[138] T154 --> {do3_ -,re5 do#5 re5 fa#5 la5 fa#5}
gram#18[139] T155 --> {{2,si2,re3}-,sol5 si5 sol5 re5 si4 sol4}
gram#18[140] T156 --> {{2,mi3,sol3}-,{2,do5 sol4 mi5 do5} sol5}
gram#18[141] T157 --> {do3_ -,mi5 re5 mi5 sol5 do6 sol5}
gram#18[142] T158 --> {sol2_ -,si4{2,re5 si4 la4 sol4}}
gram#18[143] T159 --> {do3 re3 re2,mi5 sol5 re5 do5 si4 la4}
gram#18[144] T160 --> {{2,do3,mi3}{do3,mi3},do5 si4 do5 mi5 sol4 do5}
gram#18[145] T161 --> {do3 do3 do3,{fa#4,re5}{fa#4,re5}{fa#4,re5}}
gram#18[146] T162 --> {{2,do3,sol3}{do3,mi3},mi5 re5 mi5 sol5 do6 sol5}
gram#18[147] T163 --> {{2,si2,re3}-,sol5 fa#5 sol5 re5 si4 sol4}
gram#18[148] T164 --> {{3,sol3 fa#3 sol3 re3 si2 sol3},re5 sol4_}
gram#18[149] T165 --> {si2_ -,re5 si4 sol4}
gram#18[150] T166 --> {{2,sol3,si3}-,{2,re5 si5 sol5 re5}si4}
gram#18[151] T167 --> {{2,do3,mi3}-,do5{1,do5 re5}mi5}
gram#18[152] T168 --> {{2,do3,mi3}{mi3,sol3},sol5{2,fa5 mi5 re5 do5}}
gram#18[153] T169 --> {do3 re3 re3,mi5 sol5 re5 sol5 la4 fa#5}
gram#18[154] T171 --> {{2,sol2,sol3}{si2,sol3},si4 do5 re5 mi5 fa5 re5}
gram#18[155] T173 --> {fa3_ sol3,{1,fa5 la5}la4{1,si4 re5}}
gram#18[156] T174 --> {{1,{do3,mi3}sol3_} {1,{do3,mi3}sol3_} {1,{do3,mi3}sol3_},sol4 do5 mi5}
gram#18[157] T175 --> {sol3 sol2 -,{2,mi5 do5 si4 re5}sol5}
gram#18[158] T176 --> {{2,si2,re3}{si2,re3},la5 sol5 si5 sol5 re5 sol5}

COMMENT:
This is Mozart's musi­cal dice game…
[Source: B. Schott's Söhne, Mainz 39542]

Sound-object and pianoroll displays of a polymetric expression {{2,do3,sol3}{do3,mi3},mi5 re5 mi5 sol5 do6 sol5} produced by T162 in "-gr.Mozart"
Sound-object and pianoroll dis­plays of a poly­met­ric expres­sion {{2,do3,sol3}{do3,mi3},mi5 re5 mi5 sol5 do6 sol5} pro­duced by T162 in "-gr.Mozart"

Subgrammars #1 to #17 rewrite the work string — ini­tial­ly "S" — as strings of vari­ables "A1", "A2", "B1", "T96" etc. The num­bers of the "T-variables" are tak­en from tables in the game.

Subgrammar #18 rewrites each "T-variable" as a poly­met­ric expres­sion of ter­mi­nal sym­bols (sim­ple notes). For exam­ple, "la3" is equiv­a­lent to "A4" in English which is set to 440 Hz in "-se.Mozart". This instru­ment can be tuned.

The pic­tures show self-explanatory pianoroll and sound-object dis­plays of the poly­met­ric expres­sion pro­duced by "T162":

{{2,do3,sol3}{do3,mi3},mi5 re5 mi5 sol5 do6 sol5}

Octave numbering and diapason

When we cap­tured notes from a MIDI key­board to con­struct the rules for sub­gram­mar #18, we had the Bol Processor set up incor­rect­ly due to con­fu­sion over octave num­ber­ing in the English and French conventions.

In English, the "mid­dle C" on a piano key­board is called "C4" and its num­ber is 60. In French, the key with the same num­ber is called "do3". When we mis­tak­en­ly called it "do4", all the notes were writ­ten an octave higher…

After fix­ing the prob­lem on BP2, there were two ways to cor­rect the octave shift:

  • Set the "Middle C" num­ber to 48 
  • Keep the stan­dard "Middle C" = "C4" = 60 and trans­pose the whole piece down 12 semi­tones:
    S --> _transpose(-12) _vel(80) A B

We believe that the sec­ond solu­tion makes more sense because it is based on a uni­ver­sal stan­dard of key numbering.

Both solu­tions have the same cor­rec­tive effect on the Csound score: only note names will change, for exam­ple "mi5" is replaced with "mi4" but both octave point pitch-class nota­tions remain "9.04".

Settings on -gr.Mozart

On the Settings page the dia­pa­son (fre­quen­cy of "A4") is set to 440 Hz which is the most com­mon stan­dard for tun­ing instru­ments. If "A4" was num­bered 48 this fre­quen­cy should be low­ered to 220 Hz.

However, this dia­pa­son set­ting has no effect on the tonal­i­ty of pieces pro­duced by "-gr.Mozart" in MIDI for­mat. The real-time MIDI stream or MIDI file will be played by MIDI devices — such as the MIDIjs javascript play­er — using their own default set­ting of "A4".

In the Bol Processor BP2, the fre­quen­cy of "A4" also had no effect on the Csound out­put. In the orches­tra file "default.orc", the oscil­la­tor para­me­ter kpitch was derived from the octave point pitch-class para­me­ter p4 via the func­tion cpspch() also using the default 440 Hz dia­pa­son = cpspch(8.09) — see doc­u­men­ta­tion. This has been changed in BP3, using an updat­ed ver­sion of "default.orc". See Csound tun­ing in BP3 for more details.

References

Asselin, P.-Y. Musique et tem­péra­ment. Paris, 1985, repub­lished in 2000: Jobert. Soon avail­able in English.

Csound

No posts found.

Csound objects

This arti­cle is a con­tin­u­a­tion of Csound check in which we intro­duced the cre­ation of Csound para­me­ters mon­i­tored by per­for­mance con­trols. Musical phras­es were cre­at­ed from sim­ple notes trans­lat­ed into Csound events in a straight­for­ward man­ner. We now con­sid­er the cre­ation of Csound scores based on sound-objects con­tain­ing Csound instruc­tions — which may be called "Csound objects".

Csound object "e" in sound-object pro­to­types file "-so.tryCsoundObjects"

Csound objects con­tain a Csound score with a spe­cif­ic tem­po and dura­tion. For exam­ple, in object "e" shown above, the tem­po (line "t" of the score) is 120 beats/min. The total dura­tion is 2 beats, or 1000 ms. Note that to cal­cu­late the total dura­tion of this sound-object, the dura­tions of 'E3' and 'G3' (0.667 sec) shouldn't be added to those of 'C3' and 'D3', because of the start dates.

The dura­tion of a Csound object is inde­pen­dent of the dura­tion set by MIDI events that may coex­ist in the sound-object pro­to­type. In most sit­u­a­tions, note sequences and dura­tions are iden­ti­cal in the MIDI stream and the Csound score. This makes it pos­si­ble to play almost the same items via MIDI and Csound. However, as we will see, Csound is open to con­trols that are not avail­able in MIDI.

Calculations can be eas­i­ly ver­i­fied against the C-sound instru­ment file "‑cs.tryCsoundObjects" pro­vid­ed in the exam­ple set bp3-ctests-main.zip — down­load­able from GitHub along with the Bol Processor BP3 inter­face: php-frontend-master.zip. Items can be cre­at­ed with the gram­mar "‑gr.tryCsoundObjects" using the alpha­bet "‑ho.tryCsoundObjects" asso­ci­at­ed with the sound-object pro­to­type file "‑mi.tryCsoundObjects".

Csound score of sound-object "a"

Let us start with sound-object "a" whose score is shown in the pic­ture. The score is giv­en for a tem­po of 120 beats per minute, giv­ing a total dura­tion of 2 beats ( = 1.5 + 0.5) or 1000 ms.

The first event (note 'F0') is repeat­ed 2 times with iden­ti­cal tim­ing, a mean­ing­less detail to check that Csound can han­dle this abnor­mal case.

Events i1 and i2, call­ing instru­ments 1 and 2, describe tonal posi­tions in the octave point pitch-class for­mat: octave num­ber + semi­tones above C. We notice that "5.05" has been mis­la­belled as 'G5'. This will have no effect on the com­pu­ta­tion, as the Bol Processor will auto­mat­i­cal­ly cor­rect it to 'F1'. It will also rename notes accord­ing to the con­ven­tion set in the set­tings: English, French or Indian.

Pitch for­mat in instru­ment 3

Event i3, call­ing instru­ment 3, defines pitch as fre­quen­cy (in Hz). It is assumed that 643.5 Hz is 'D#5' because the dia­pa­son is 'A4' = 440 Hz. This tun­ing is defined in the set­tings (page "-se.tryCsoundObjects"). Bol Processor can change the name of this note accord­ing to the diapason.

Changes of the dia­pa­son are tak­en into account by BP3 when gen­er­at­ing Csound scores, but this was not yet the case with BP2. The fol­low­ing exam­ples have been pro­duced with the default 'A4' = 440 Hz, giv­ing iden­ti­cal results with BP2 and BP3. See the page Csound tun­ing in BP3 page to exam­ine dif­fer­ent cases.

Producing object "a" at a tem­po of 60 beats per minute results in the fol­low­ing Csound score:

a

Pianoroll of object "a"

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

Note that this score is more com­plete than the one con­tained in sound-object "a". This is because the sound-object pro­to­type file "-so.tryCsoundObjects" is linked to a Csound instru­ment file "-cs.tryCsoundObjects" (see fig­ure below).

Mention of the relat­ed Csound instru­ments file is nec­es­sary to bind it to the sound-objects pro­to­types file.

Instrument 1 of the Csound instru­ment file is designed to han­dle 10 argu­ments while the score of "i1" events in "a" only con­tains 4. The 6 miss­ing argu­ments are filled with default val­ues of the para­me­ters they rep­re­sent. Here, for exam­ple, '90' is the default vol­ume. Zeros rep­re­sent default pitch­bend or func­tion table index­es.

Note that "5.05" has been cor­rect­ly fixed to "F1". This is only rel­e­vant to human read­ers, as Csound ignores any text fol­low­ing a semicolon.

You can­not con­vert this and oth­er exam­ples to sound with the sup­plied Csound orches­tra "default.orc", because it only han­dles instru­ment 1. The exam­ples on this page are for visu­al inspec­tion only.

Object graph­ic of f {a b, c}

In the fol­low­ing exam­ple, we need to look at the graph to under­stand why the events of "a" are delayed by 160ms com­pared to "b". Object "b" has a piv­ot set at 20% of its dura­tion from the start date. This can be checked in "-so.tryCsoundObjects".

Although the object graph­ic and the pianoroll for this item indi­cate that "b" should start on a neg­a­tive date (-160ms), the Csound score is shift­ed to show only pos­i­tive or zero dates.

{a, b} c

Pianoroll of {a b, c}

i3 0.000 0.800 461.34 1.000 ; A4
i4 0.100 0.200 6.03 1.050 ; C2
i1 0.160 0.250 4.05 90.000 90.000 0.000 0.000 0.000 0.000 ; F0
i1 0.160 0.250 4.05 90.000 90.000 0.000 0.000 0.000 0.000 ; F0
i2 0.910 0.250 5.05 0.000 0.000 90.000 90.000 0.000 0.000 0.000 ; F1
i3 0.910 0.100 643.50 1.000 ; D#5
i2 1.160 0.125 9.00 0.000 0.000 90.000 90.000 0.000 0.000 0.000 ; C5
i2 1.285 0.125 9.02 0.000 0.000 62.000 62.000 0.000 0.000 0.000 ; D5
i2 1.410 0.125 9.04 0.000 0.000 90.000 90.000 0.000 0.000 0.000 ; E5
i2 1.535 0.125 9.05 0.000 0.000 90.000 90.000 0.000 0.000 0.000 ; F5

Note on piv­ots and relo­ca­tion: sound-object "b" has its piv­ot shown as a full arrow, unlike oth­er sound-objects in this set which only have a red tri­an­gle. This means that it is not relo­cat­able. Relocation would be per­formed if these sound-objects had topo­log­i­cal prop­er­ties such as pro­hibit­ing the cov­er­ing of their beginning/end, allow­ing trun­ca­tion of beginning/end to a cer­tain degree, break­ing the tem­po etc. A constraint-satisfaction algo­rithm is run on each pro­duc­tion to pro­duce a solu­tion that min­imis­es the num­ber of con­straints vio­lat­ed. This is best illus­trat­ed by "-gr.koto3" (read the arti­cle).

Sequence "b midiobject"

Let us now look at a phrase con­tain­ing "mid­iob­ject", a sound-object with both a MIDI stream and a Csound score. The MIDI stream is ignored when con­struct­ing the score. The time res­o­lu­tion (10 ms) also has no effect on the accu­ra­cy of tim­ings in the Csound score.

b mid­iob­ject

i3 0.000 0.800 461.34 1.000 ; A4
i4 0.100 0.200 6.03 1.050 ; C2
i1 1.160 0.666 7.04 90.000 90.000 0.000 0.000 0.000 0.000 ; E3
i1 1.160 1.000 7.00 90.000 90.000 0.000 0.000 0.000 0.000 ; C3
i1 2.160 1.000 7.02 90.000 90.000 0.000 0.000 0.000 0.000 ; D3
i1 2.493 0.667 7.07 90.000 90.000 0.000 0.000 0.000 0.000 ; G3

Since the score of "mid­iob­ject" has been defined with a tem­po of 60 beats/min for a dura­tion of 2 beats, the dura­tions of the notes E3, C3, D3, G3 are unchanged.

Expression {a b a, c midiobject}

Now con­sid­er a poly­met­ric struc­ture in which the first line con­tains 3 sound-objects and the sec­ond line con­tains 2 sound-objects. The struc­ture will be forced to a sym­bol­ic dura­tion of 3 beats — the dura­tion of "a b a" — and the sec­ond line will arrange the objects as "two in three" with sym­bol­ic dura­tions of 1.5 beats.

This is clear on the pic­ture, look­ing at the piv­ots of sound-objects, if one does not get con­fused by the phys­i­cal dura­tion of the sound-objects. The sound-object pro­to­type "b" has a dura­tion of 0.8 beats, result­ing in a phys­i­cal dura­tion of 800 ms.

PIanoroll of {a b a, c midiobject}

On the sec­ond line, the sym­bol­ic dura­tion of each object is 1.5 beats. Consequently, the sound-object "c", whose pro­to­type has a phys­i­cal dura­tion of 500 ms, is set to phys­i­cal dura­tion = 500 * 1.5 = 750 ms. The object "c" appears as sequence "C5 D5 E5 F5" with total phys­i­cal dura­tion of 4 * 188 ms = 752 ms. These dura­tions are reflect­ed in the Csound score below.

{a b a, c midiobject}

i1 0.000 0.250 4.05 90.000 90.000 0.000 0.000 0.000 0.000 ; F0
i1 0.000 0.250 4.05 90.000 90.000 0.000 0.000 0.000 0.000 ; F0
i2 0.000 0.188 9.00 0.000 0.000 90.000 90.000 0.000 0.000 0.000 ; C5
i2 0.187 0.188 9.02 0.000 0.000 62.000 62.000 0.000 0.000 0.000 ; D5
i2 0.374 0.188 9.04 0.000 0.000 90.000 90.000 0.000 0.000 0.000 ; E5
i2 0.561 0.188 9.05 0.000 0.000 90.000 90.000 0.000 0.000 0.000 ; F5
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
i3 0.840 0.800 461.34 1.000 ; A4
i4 0.940 0.200 6.03 1.050 ; C2
i1 1.500 0.999 7.04 90.000 90.000 0.000 0.000 0.000 0.000 ; E3
i1 1.500 1.500 7.00 90.000 90.000 0.000 0.000 0.000 0.000 ; C3
i1 2.000 0.250 4.05 90.000 90.000 0.000 0.000 0.000 0.000 ; F0
i1 2.000 0.250 4.05 90.000 90.000 0.000 0.000 0.000 0.000 ; F0
i2 2.750 0.250 5.05 0.000 0.000 90.000 90.000 0.000 0.000 0.000 ; F1
i3 2.750 0.100 643.50 1.000 ; D#5
i1 3.000 1.500 7.02 90.000 90.000 0.000 0.000 0.000 0.000 ; D3
i1 3.499 1.000 7.07 90.000 90.000 0.000 0.000 0.000 0.000 ; G3

Combined objects and notes

In the fol­low­ing exam­ple, we com­bine sound-objects (con­tain­ing Csound scores) with sim­ple notes that are con­vert­ed to Csound events. These notes are played on (default) MIDI chan­nel 1, which is assigned to instru­ment 1.

a C4 D4 b c

Combined objects and notes on pianoroll. Notes in brown colour are those avail­able on both MIDI and Csound out­puts. Notes in green are exclu­sive­ly Csound.

i1 0.000 0.250 4.05 90.000 90.000 0.000 0.000 0.000 0.000 ; F0
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
i1 1.000 1.000 8.00 90.000 90.000 0.000 0.000 0.000 0.000 ; C4
i3 2.840 0.800 461.34 1.000 ; A4
i4 2.940 0.200 6.03 1.050 ; C2
i1 2.000 1.000 8.02 90.000 90.000 0.000 0.000 0.000 0.000 ; D4
i2 4.000 0.125 9.00 0.000 0.000 90.000 90.000 0.000 0.000 0.000 ; C5
i2 4.125 0.125 9.02 0.000 0.000 62.000 62.000 0.000 0.000 0.000 ; D5
i2 4.250 0.125 9.04 0.000 0.000 90.000 90.000 0.000 0.000 0.000 ; E5
i2 4.375 0.125 9.05 0.000 0.000 90.000 90.000 0.000 0.000 0.000 ; F5

This com­bi­na­tion is high­light­ed in the pianoroll. Notes that are present in both the MIDI stream and the Csound score are dis­played in brown, while notes that are present only in the Csound out­put are dis­played in green.

Pitchbend map­ping by instru­ment 2

Let us apply a con­tin­u­ous pitch­bend con­trol to a sound-object con­tain­ing four Csound instruc­tions, using instru­ment 2, which maps the MIDI pitch­bend range [0..16384] to a range of [-200..+200], both on log­a­rith­mic scales. (This map­ping is there­fore linear.)

In the Bol Processor score, the use of mapped val­ues in _pitchbend() con­trols is pos­si­ble, thanks to a _pitchrange(200) instruc­tion at the begin­ning of the sequence.

The result­ing Csound score makes it clear that the pitch­bend should vary con­tin­u­ous­ly over each Csound event : 0 to 24.997, 24.997 to 49.994 etc. Csound will fur­ther inter­po­late the val­ues using its GEN 07 (lin­ear inter­po­la­tion) gen­er­a­tor.

_pitchrange(200) _pitchcont _pitchbend(0) c _pitchbend(100)

i2 0.000 0.125 9.00 0.000 24.997 90.000 90.000 0.000 0.000 0.000 ; C5
i2 0.125 0.125 9.02 24.997 49.994 62.000 62.000 0.000 0.000 0.000 ; D5
i2 0.250 0.125 9.04 49.994 74.991 90.000 90.000 0.000 0.000 0.000 ; E5
i2 0.375 0.125 9.05 74.991 99.988 90.000 90.000 0.000 0.000 0.000 ; F5

Volume con­trol is pos­si­ble on instru­ments 1 and 2, but not on instru­ment 3. Therefore its effect is only applied to cer­tain events of sound-object "a":

_volumecont _volume(30) a _volume(127)

i1 0.000 0.250 4.05 30.000 54.250 0.000 0.000 0.000 0.000 ; F0
i1 0.000 0.250 4.05 30.000 54.250 0.000 0.000 0.000 0.000 ; F0
i2 0.750 0.250 5.05 0.000 0.000 102.750 127.000 0.000 0.000 0.000 ; F1
i3 0.750 0.100 643.50 1.000 ; D#5

Csound score of sound-object "d"

In the fol­low­ing exam­ple, a con­tin­u­ous pitch­bend cor­rec­tion can­not be applied because instru­ment 5, called by "d", does not have a pitch­bend para­me­ter. However, the val­ue of +100 cents is applied to the pitch para­me­ter itself.

The Csound score of sound-object "d" is lim­it­ed to 1 note at 440 Hz (with ref­er­ence to instru­ment 5). This note was labelled 'A4' on the pro­to­type, but we should remem­ber that with a dia­pa­son of 435 Hz it will be slight­ly high­er than 'A4'. The increase is 1200 * log2(440/435) = 24 cents. So, in the per­for­mance it will be set to 124 cents above 435 Hz, giv­ing 435 * 2^(124/1200) = 467 Hz. As shown below:

_pitchrange(200) _pitchcont _pitchbend(100) d _pitchbend(0)

i5 0.000 0.500 466.16 ; A4

In the fol­low­ing exam­ple, a con­tin­u­ous pitch­bend cor­rec­tion results in dif­fer­ent adjust­ments of the pitch­bend para­me­ters of the instru­ments called by sound-objects "a", "b" and "c". Simple notes 'C4' and 'D4' call instru­ment 1 because it is the one assigned to the (default) chan­nel 1. The vol­ume is also adjust­ed continuously.

Note that we also apply neg­a­tive val­ues to the pitch­bend para­me­ter, expect­ing the Csound orches­tra to do the extrapolation.

_pitchrange(200) _pitchcont _volumecont _volume(30) _pitchbend(-10) a C4 D4 b c _pitchbend(100) _volume(127)

i1 0.000 0.250 4.05 30.000 34.850 0.000 -10.000 -4.500 0.000 ; F0
i1 0.000 0.250 4.05 30.000 34.850 0.000 -10.000 -4.500 0.000 ; F0
i2 0.750 0.250 5.05 6.499 11.999 44.550 49.400 0.000 0.000 0.000 ; F1
i3 0.750 0.100 643.50 1.005 ; D#5
i1 1.000 1.000 8.00 49.400 68.800 0.000 12.000 34.000 0.000 ; C4
i3 2.840 0.800 461.34 1.069 ; A4
i4 2.940 0.200 6.03 1.151 ; C2
i1 2.000 1.000 8.02 68.800 88.200 0.000 34.000 56.000 0.000 ; D4
i2 4.000 0.125 9.00 77.990 83.490 107.600 112.450 0.000 0.000 0.000 ; C5
i2 4.125 0.125 9.02 83.490 88.989 77.466 80.807 0.000 0.000 0.000 ; D5
i2 4.250 0.125 9.04 88.989 94.488 117.300 122.150 0.000 0.000 0.000 ; E5
i2 4.375 0.125 9.05 94.488 99.988 122.150 127.000 0.000 0.000 0.000 ; F5

Settings of the "blurb" parameter

Let us check an arbi­trary para­me­ter "burb" which affects argu­ments 9, 10 and 11 of instru­ment 2.

This para­me­ter is designed as addi­tive in its com­bi­na­tions. The default val­ue is '0'.

In sound-object "e", the third event 'D3' is required to set 'blurb' to a start val­ue of 10 and to an end val­ue of 30.

Csound score of sound-object "e"

These val­ues are added to those inter­po­lat­ed over the con­tin­u­ous 'blurb' vari­a­tion: 25.6 + (100 - 25.6) * 0.5 = 62.8 and 100 at dates 0.5 and 1 sec. This gives an ini­tial val­ue of 62.8 + 10 = 72.8 and a final val­ue of 100 + 30 = 130.

_cont(blurb) _value(blurb,25.6) e _value(blurb,100)

i2 0.000 0.333 7.04 8191.500 8191.500 64.000 64.000 25.600 50.375 0.000 ; E3
i2 0.000 0.500 7.00 8191.500 8191.500 64.000 64.000 25.600 62.800 0.000 ; C3
i2 0.500 0.500 7.02 8191.500 8191.500 64.000 64.000 72.800 130.000 0.000 ; D3
i2 0.666 0.334 7.07 8191.500 8191.500 64.000 64.000 75.150 99.963 0.000 ; G3

If the vari­a­tion of "blurb" becomes more com­plex, the Bol Processor will han­dle it
through func­tion tables.

_cont(blurb) _value(blurb,12) e _value(blurb,110)_ _value(blurb,130)__ _value(blurb,80)__ _value(blurb,-20)_ _value(blurb,-10)___ _value(blurb,40)

f101 0.000 256 -7 12.000 76 110.000 76 130.000 104 96.750
i2 0.000 3.330 7.04 8191.500 8191.500 64.000 64.000 12.000 96.750 101.000 ; E3
f102 0.000 256 -7 12.000 51 110.000 51 130.000 102 80.000 52 30.000
i2 0.000 5.000 7.00 8191.500 8191.500 64.000 64.000 12.000 30.000 102.000 ; C3
f103 5.000 256 -7 40.000 51 -6.000 51 8.000 154 70.000
i2 5.000 5.000 7.02 8191.500 8191.500 64.000 64.000 40.000 70.000 103.000 ; D3
f104 6.660 256 -7 -13.400 26 -10.000 230 39.917
i2 6.660 3.335 7.07 8191.500 8191.500 64.000 64.000 -13.400 39.917 104.000 ; G3

In the Csound score of "e", event 'D3' has non-zero ini­tial val­ues on argu­ments 9 and 10. These val­ues are added to those deter­mined by vari­a­tions of the "blurb" para­me­ter, there­by giv­ing 40 for argu­ment 9 (the ini­tial val­ue of "blurb") and 70 for argu­ment 10 (the final val­ue). The same cal­cu­la­tion is applied to the attached table f103. Consequently, the first and last val­ues of a func­tion table always reflect the ini­tial and final val­ues of the para­me­ter. This allows Csound instru­ments to oper­ate in a con­sis­tent man­ner, either inter­po­lat­ing the ini­tial and final val­ues, or pick­ing up (and inter­po­lat­ing) the val­ues in the attached func­tion table.

The "oops" para­me­ter in instru­ment 6

The Bol Processor com­bines Csound para­me­ters either addi­tive­ly or mul­ti­plica­tive­ly. For pre­de­fined MIDI-mapped para­me­ters, the com­bi­na­tion mode is pre­set: all para­me­ters, except vol­ume, are com­bined addi­tive­ly. For addi­tion­al (non-MIDI) para­me­ters, the com­pos­er can choose both the default val­ue and the com­bi­na­tion mode.

For exam­ple, instru­ment 6 deals with an "oops" para­me­ter that com­bines mul­ti­plica­tive­ly. Sound-object "f" con­tains calls to this instru­ment with val­ues of "oops" oth­er than the default.

f

i6 0.000 0.500 7.00 0.000 0.000 90.000 90.000 0.000 0.000 0.000 0.500 1.500 0.000 0.000 0.000 0.000 ; C3
i6 0.500 0.500 7.02 0.000 0.000 90.000 90.000 0.000 0.000 0.000 0.000 4.700 0.000 0.000 0.000 0.000 ; D3
i6 1.000 0.500 7.04 0.000 0.000 90.000 90.000 0.000 0.000 0.000 0.250 2.500 0.000 0.000 0.000 0.000 ; E3

_cont(oops) _value(oops,0) f _value(oops,4)

i6 0.000 0.500 7.00 0.000 0.000 90.000 90.000 0.000 0.000 0.000 0.000 2.000 0.000 0.000 0.000 0.000 ; C3
i6 0.500 0.500 7.02 0.000 0.000 90.000 90.000 0.000 0.000 0.000 0.000 12.533 0.000 0.000 0.000 0.000 ; D3
i6 1.000 0.500 7.04 0.000 0.000 90.000 90.000 0.000 0.000 0.000 0.667 10.000 0.000 0.000 0.000 0.000 ; E3

Sound-object f for mm = 60 beats/min

The "oops" para­me­ter varies from 0 to 4 over 1500 ms. At the start of 'D3' and 'E3', its val­ues are 4 * (500 / 1500) = 1.33 and 4 * (1000 / 1500) = 2.66 respectively.

The ini­tial val­ue of "oops" in 'C3' is 0 * 0.5 = 0, and its final val­ue 1.5 * 1.33 = 2, as shown on the score.

The ini­tial val­ue for 'D3' will be O, and for 'E3' it will be 0.25 * 2.66 = 0.665. The val­ue at the end of D3 is 4.7 * 2.66 = 12.5. The val­ue at the end of D3 is 2.5 * 4 = 10.


These exam­ples have been designed to test all the fea­tures of the Csound inter­face as it is imple­ment­ed in Bol Processor. We expect more to come as both envi­ron­ments con­tin­ue to explore new con­cepts and build tools for musicians.

We apol­o­gise for the lack of a cor­pus of real musi­cal pieces cre­at­ed with Bol Processor and Csound. A first exam­ple of high musi­cal qual­i­ty was com­posed in 1996: read and lis­ten to Sarasvati vina!

Csound checkup

Csound in the Bol Processor (BP2, BP3) environment

This arti­cle and the next one on Csound objects are reserved for Csound geeks inter­est­ed in cre­at­ing Csound scores with Bol Processor. They are com­ple­men­tary but they can be stud­ied independently.

The exam­ples in this sec­tion are not intend­ed to be audi­to­ry. Rather, the idea was to pro­duce short Csound scores that could be used to illus­trate the treat­ment of para­me­ters in a vari­ety of contexts.

The cal­cu­la­tions in this arti­cle can be eas­i­ly checked against the Csound instru­ment file "‑cs.chekAllCsound" includ­ed in the bp3-ctests-main.zip exam­ple set, which can be down­loaded from GitHub along with the Bol Processor BP3's inter­face: php-frontend-master.zip. See the Bol Processor ‘BP3’ and its PHP inter­face page for the instal­la­tion and testing.

All items can be pro­duced with the gram­mar "‑gr.checkAllCsound".

Let us start with a sim­ple example:

A4 G4 C5 A4

This pro­duces the fol­low­ing Csound score:

t 0.000 60.000
i2 0.000 1.000 440.00 90.000 0.000 0.000 0.000 ; A4
i2 1.000 1.000 392.00 90.000 0.000 0.000 0.000 ; G4
i2 2.000 1.000 523.25 90.000 0.000 0.000 0.000 ; C5
i2 3.000 1.000 440.00 90.000 0.000 0.000 0.000 ; A4
s

Instrument 2 is used because it's the one assigned to chan­nel 1 by default in the Csound instru­ment file "-cs.checkAllCsound".
This score will not pro­duce any sound with the default orches­tra file "default.orc" because it does not con­tain a def­i­n­i­tion for instru­ment 2.
Argument 4 is the pitch (in Herz) relat­ed to the dia­pa­son (fre­quen­cy of A4) set in "-se.checkAllCsound".
Argument 5 is the MIDI val­ue of the vol­ume, default 90 accord­ing to the set­tings.
Arguments 6 and 7 can be used for the 'blurb' para­me­ter (see infra).
Argument 8 is not not used, its val­ue remains 0.

No treat­ment of MIDI pitch­bend in instru­ment 2

Instrument 2 does not use the pitch­bend val­ue as a para­me­ter, but changes the pitch para­me­ter (in Hz) accord­ing­ly. In the fol­low­ing exam­ple, G4, which is 200 cents high­er, will be played 2 semi­tones high­er, at the same pitch as A4 (440 Hz).

_pitchrange(200) A4 _pitchbend(200) G4 _pitchbend(0) C5 A5

i2 0.000 1.000 440.00 90.000 0.000 0.000 0.000 ; A4
i2 1.000 1.000 440.00 90.000 0.000 0.000 0.000 ; G4
i2 2.000 1.000 523.25 90.000 0.000 0.000 0.000 ; C5
i2 3.000 1.000 880.00 90.000 0.000 0.000 0.000 ; A5

Volume map­ping in instru­ment 3

Now we will force the instru­ment to 3. Note that many new para­me­ters are dis­played.
The default vol­ume is 90 on the MIDI scale. This is con­vert­ed to 16.98 (log scale) using the vol­ume map­ping defined in instru­ment 3.
As instru­ment 3 accepts pitch­bend cor­rec­tions (argu­ments 5 and 6), pitch­bend = 16383 (+2 semi­tones) is applied to G4 instead of chang­ing its frequency.

_ins(3) _pitchrange(200) A4 _pitchbend(200) G4 _pitchbend(0) C5 A5

i3 0.000 1.000 440.00 8191.500 8191.500 16.981 16.981 0.000 0.000 0.000 0.000 0.000 ; A4
i3 1.000 1.000 392.00 16383.000 16383.000 16.981 16.981 0.000 0.000 0.000 0.000 0.000 ; G4
i3 2.000 1.000 523.25 8191.500 8191.500 16.981 16.981 0.000 0.000 0.000 0.000 0.000 ; C5
i3 3.000 1.000 880.00 8191.500 8191.500 16.981 16.981 0.000 0.000 0.000 0.000 0.000 ; A5

Arguments 5 and 6 rep­re­sent the start and end val­ues of the pitch­bend. This makes it pos­si­ble to tell Csound to cal­cu­late a por­ta­men­to (see infra).

Mapping of mod­u­la­tion in instru­ment 3

Playing sim­ple notes on chan­nel 2 calls up instru­ment 3, which has vol­ume and mod­u­la­tion con­trol para­me­ters. Here the mod­u­la­tion range (0 to 12431) is mapped to 0 to 3035.097 (argu­ments 11 and 12).

chan(2) _modcont _mod(0) C4 D4__ E4 _mod(12431)

i3 0.000 1.000 261.63 8191.500 8191.500 16.981 16.981 0.000 0.000 0.000 607.019 0.000 ; C4
i3 1.000 3.000 293.66 8191.500 8191.500 16.981 16.981 0.000 0.000 607.019 2428.078 0.000 ; D4
i3 4.000 1.000 329.63 8191.500 8191.500 16.981 16.981 0.000 0.000 2428.078 3035.097 0.000 ; E4

Another way to do the same with­out tem­per­ing with chan­nels is to use instru­ment 3.

ins(3) _modcont _mod(0) C4 D4__ E4 _mod(12431)

Note that instru­ment spec­i­fi­ca­tions over­ride the assign­ments of The_default instru­ment, which are made on the basis of the MIDI chan­nel. For instance, in the fol­low­ing exam­ple, because of the _ins(1) state­ment, _chan(2) does not set the instru­ment index to 3, so _mod() is ignored:

ins(1) _chan(2) _modcont _mod(0) C4 D4__ E4 _mod(12431)

i1 0.000 1.000 8.00 90.000 90.000 0.000 0.000 0.000 0.000 ; C4
i1 1.000 3.000 8.02 90.000 90.000 0.000 0.000 0.000 0.000 ; D4
i1 4.000 1.000 8.04 90.000 90.000 0.000 0.000 0.000 0.000 ; E4

Polymetric struc­ture {C5 D5 E5 F5, G5 D5 C6}

Let us con­sid­er a poly­met­ric struc­ture in which the same note (D5) has two con­sec­u­tive NoteOn's.

In MIDI, a NoteOff is insert­ed before the sec­ond NoteOn of "D5". In Csound the same
instru­ment is called twice. In both ver­sions the break between suc­ces­sive occur­rences of "D5" is audible.

_ins(The_default) {_volume(30) C5 D5 E5 F5,_volume(20) G5 D5 C6}

i1 0.000 1.000 9.00 30.000 30.000 0.000 0.000 0.000 0.000 ; C5
i1 0.000 1.333 9.07 20.000 20.000 0.000 0.000 0.000 0.000 ; G5
i1 1.000 1.000 9.02 30.000 30.000 0.000 0.000 0.000 0.000 ; D5
i1 1.333 1.333 9.02 20.000 20.000 0.000 0.000 0.000 0.000 ; D5 striked again
i1 2.000 1.000 9.04 30.000 30.000 0.000 0.000 0.000 0.000 ; E5
i1 3.000 1.000 9.05 30.000 30.000 0.000 0.000 0.000 0.000 ; F5
i1 2.666 1.334 10.00 20.000 20.000 0.000 0.000 0.000 0.000 ; C6

Note that this exam­ple would sound strange with­out the vol­ume con­trols: we would get a silence dur­ing the time the two D5' are super­im­posed, sim­ply because they are sine waves with equal ampli­tudes and oppo­site phases!

Let us look at the same note played at dif­fer­ent vol­umes in step­wise vari­a­tions. Notice that instru­ment 3 is now spec­i­fied by its name "Harpsichord". (Don't look for it in an orches­tra file!)

_ins(Harpsichord) _volume(0) A4 _volume(32) A4 _volume(64) A4 _volume(80) A4_volume(127) A4

i3 0.000 1.000 440.00 8191.500 8191.500 -24.000 -24.000 0.000 0.000 0.000 0.000 0.000 ; A4
i3 1.000 1.000 440.00 8191.500 8191.500 -2.763 -2.763 0.000 0.000 0.000 0.000 0.000 ; A4
i3 2.000 1.000 440.00 8191.500 8191.500 0.000 0.000 0.000 0.000 0.000 0.000 0.000 ; A4
i3 3.000 1.000 440.00 8191.500 8191.500 13.204 13.204 0.000 0.000 0.000 0.000 0.000 ; A4
i3 4.000 1.000 440.00 8191.500 8191.500 24.000 24.000 0.000 0.000 0.000 0.000 0.000 ; A4

The fol­low­ing illus­tra­tion shows the vol­ume decreas­ing con­tin­u­ous­ly from 127 (i.e. +24 after map­ping) to 0 (i.e. -24 after map­ping). Instrument 3 has two para­me­ters (7 and 8) that take the start and end vol­umes respec­tive­ly, and these val­ues are inter­po­lat­ed by Csound (using scheme GEN07) to pro­duce a con­tin­u­ous change.

_ins(Harpsichord) _volumecont _volume(127) A4 _volume(0)

i3 0.000 1.000 440.00 8191.500 8191.500 24.000 -24.000 0.000 0.000 0.000 0.000 0.000 ; A4

Now we will look at sim­i­lar con­tin­u­ous changes over sev­er­al notes invok­ing the same instrument.

_ins(Harpsichord) _volumecont _volume(127) A4 G4 C5 A5 A4 G4 C5 A5 _volume(0)

i3 0.000 1.000 440.00 8191.500 8191.500 24.000 21.688 0.000 0.000 0.000 0.000 0.000 ; A4
i3 1.000 1.000 392.00 8191.500 8191.500 21.688 18.431 0.000 0.000 0.000 0.000 0.000 ; G4
i3 2.000 1.000 523.25 8191.500 8191.500 18.431 12.899 0.000 0.000 0.000 0.000 0.000 ; C5
i3 3.000 1.000 880.00 8191.500 8191.500 12.899 -0.031 0.000 0.000 0.000 0.000 0.000 ; A5
i3 4.000 1.000 440.00 8191.500 8191.500 -0.031 -1.179 0.000 0.000 0.000 0.000 0.000 ; A4
i3 5.000 1.000 392.00 8191.500 8191.500 -1.179 -2.794 0.000 0.000 0.000 0.000 0.000 ; G4
i3 6.000 1.000 523.25 8191.500 8191.500 -2.794 -5.547 0.000 0.000 0.000 0.000 0.000 ; C5
i3 7.000 1.000 880.00 8191.500 8191.500 -5.547 -24.000 0.000 0.000 0.000 0.000 0.000 ; A5

The same, but step by step:

_ins(Harpsichord) _volumestep _volume(127) A4 G4 C5 A5 A4 G4 C5 A5 _volume(0)

i3 0.000 1.000 440.00 8191.500 8191.500 24.000 24.000 0.000 0.000 0.000 0.000 0.000 ; A4
i3 1.000 1.000 392.00 8191.500 8191.500 21.688 21.688 0.000 0.000 0.000 0.000 0.000 ; G4
i3 2.000 1.000 523.25 8191.500 8191.500 18.431 18.431 0.000 0.000 0.000 0.000 0.000 ; C5
i3 3.000 1.000 880.00 8191.500 8191.500 12.899 12.899 0.000 0.000 0.000 0.000 0.000 ; A5
i3 4.000 1.000 440.00 8191.500 8191.500 -0.031 -0.031 0.000 0.000 0.000 0.000 0.000 ; A4
i3 5.000 1.000 392.00 8191.500 8191.500 -1.179 -1.179 0.000 0.000 0.000 0.000 0.000 ; G4
i3 6.000 1.000 523.25 8191.500 8191.500 -2.794 -2.794 0.000 0.000 0.000 0.000 0.000 ; C5
i3 7.000 1.000 880.00 8191.500 8191.500 -5.547 -5.547 0.000 0.000 0.000 0.000 0.000 ; A5

Changing the vol­ume con­tin­u­ous­ly on the first two notes, then the vol­ume stays unchanged:

_ins(Harpsichord) _volumecont _volume(127) A4 G4 _volume(10) C5 A5

i3 0.000 1.000 440.00 8191.500 8191.500 24.000 4.549 0.000 0.000 0.000 0.000 0.000 ; A4
i3 1.000 1.000 392.00 8191.500 8191.500 4.549 -7.372 0.000 0.000 0.000 0.000 0.000 ; G4
i3 2.000 1.000 523.25 8191.500 8191.500 -7.372 -7.372 0.000 0.000 0.000 0.000 0.000 ; C5
i3 3.000 1.000 880.00 8191.500 8191.500 -7.372 -7.372 0.000 0.000 0.000 0.000 0.000 ; A5

Continuous pitch­bend vari­a­tion over an entire phrase:

_ins(Harpsichord) _pitchcont _pitchbend(16383) A4 G4 C5 A5 A4 G4 C5 A5 _pitchbend(0)

i3 0.000 1.000 440.00 16383.000 14335.125 16.981 16.981 0.000 0.000 0.000 0.000 0.000 ; A4
i3 1.000 1.000 392.00 14335.125 12287.250 16.981 16.981 0.000 0.000 0.000 0.000 0.000 ; G4
i3 2.000 1.000 523.25 12287.250 10239.375 16.981 16.981 0.000 0.000 0.000 0.000 0.000 ; C5
i3 3.000 1.000 880.00 10239.375 8191.500 16.981 16.981 0.000 0.000 0.000 0.000 0.000 ; A5
i3 4.000 1.000 440.00 8191.500 6143.625 16.981 16.981 0.000 0.000 0.000 0.000 0.000 ; A4
i3 5.000 1.000 392.00 6143.625 4095.750 16.981 16.981 0.000 0.000 0.000 0.000 0.000 ; G4
i3 6.000 1.000 523.25 4095.750 2047.875 16.981 16.981 0.000 0.000 0.000 0.000 0.000 ; C5
i3 7.000 1.000 880.00 2047.875 0.000 16.981 16.981 0.000 0.000 0.000 0.000 0.000 ; A5

Here, pitch­bend and vol­ume vary simultaneously:

_ins(Harpsichord) _volumecont _volume(0) _pitchcont _pitchrange(200) _pitchbend(200) A4 G4 C5 A5 A4 G4 C5 A5 _pitchbend(-200) _volume(127)

i3 0.000 1.000 440.00 16383.000 14335.125 -24.000 -5.547 0.000 0.000 0.000 0.000 0.000 ; A4
i3 1.000 1.000 392.00 14335.125 12287.250 -5.547 -2.794 0.000 0.000 0.000 0.000 0.000 ; G4
i3 2.000 1.000 523.25 12287.250 10239.375 -2.794 -1.179 0.000 0.000 0.000 0.000 0.000 ; C5
i3 3.000 1.000 880.00 10239.375 8191.500 -1.179 -0.031 0.000 0.000 0.000 0.000 0.000 ; A5
i3 4.000 1.000 440.00 8191.500 6143.625 -0.031 12.899 0.000 0.000 0.000 0.000 0.000 ; A4
i3 5.000 1.000 392.00 6143.625 4095.750 12.899 18.431 0.000 0.000 0.000 0.000 0.000 ; G4
i3 6.000 1.000 523.25 4095.750 2047.875 18.431 21.688 0.000 0.000 0.000 0.000 0.000 ; C5
i3 7.000 1.000 880.00 2047.875 0.000 21.688 24.000 0.000 0.000 0.000 0.000 0.000 ; A5

So far we have seen how instru­ments inter­po­late between sin­gle start and end val­ues.
Instrument 1, here called "The_default", i.e. the one defined in "default.orc", is able to vary pitch­bend and vol­ume in a more sophis­ti­cat­ed way, using a func­tion table.

BP3 auto­mat­i­cal­ly cre­ates func­tion tables when required and when the instru­ment spec­i­fi­ca­tion (here "-cs.checkAllCsound") pro­vides slots (argu­ments) for enter­ing func­tion table indexes.

Let us look at a sim­ple exam­ple with pitch­bend. Both of the fol­low­ing nota­tions result in the same score.
You will hear the pro­duc­tion of this score with the demo orches­tra "default.orc". (Doesn't sound great!)

ins(The_default) _pitchcont _pitchbend(0) D4__ _pitchbend(16383) E4_ _pitchbend(0)__

ins(The_default) _pitchrange(200) _pitchcont _pitchbend(-200) D4__ pitchbend(+200) E4_ pitchbend(-200)__

i1 0.000 3.000 8.02 90.000 90.000 0.000 -200.000 200.000 0.000 ; D4
f101 3.000 256 -7 200.000 102 -200.000 154 -200.000
i1 3.000 5.000 8.04 90.000 90.000 0.000 200.000 -200.000 101.000 ; E4

Note that GENO7 is used. GENO8 (cubic spline inter­po­la­tion) could be con­sid­ered, but it has the dis­ad­van­tage of forc­ing the first deriv­a­tive to zero at the start and end points. GEN07 is also much faster.

Here, C4 needs a 4-point table, because of _pitchcont where­as D4 only needs lin­ear interpolation?

ins(1) _pitchrange(200) _pitchbend(0) _pitchcont C4_ _pitchbend(20) __ _pitchbend(165) __ D4 _ _ _ _pitchbend(150)

f101 0.000 256 -7 0.000 85 20.000 85 165.000 86 160.000
i1 0.000 6.000 8.00 90.000 90.000 0.000 0.000 160.000 101.000 ; C4
i1 6.000 4.000 8.02 90.000 90.000 0.000 160.000 150.000 0.000 ; D4

Here, the ini­tial por­ta­men­to on a silence '-' is only pro­vid­ed by the
MIDI out­put. Csound ignores silence:

ins(1) _pitchrange(200) _pitchbend(0) _pitchcont - ___ C4 ___ _pitchbend(200) __ D4 ___ _pitchbend(150)

f101 4.000 256 -7 100.000 170 200.000 86 183.333
i1 4.000 6.000 8.00 90.000 90.000 0.000 100.000 183.333 101.000 ; C4
i1 10.000 4.000 8.02 90.000 90.000 0.000 183.333 150.000 0.000 ; D4

ins(1) _pitchrange(200) _pitchbend(0) _pitchcont - _ _pitchbend(20) __ C4 ___ _pitchbend(200) __ D4 ___ _pitchbend(150)

f101 4.000 256 -7 80.000 170 200.000 86 183.333
i1 4.000 6.000 8.00 90.000 90.000 0.000 80.000 183.333 101.000 ; C4
i1 10.000 4.000 8.02 90.000 90.000 0.000 183.333 150.000 0.000 ; D4

ins(1) _pitchcont _pitchrange(200) _pitchbend(0) - ___ C4 ___ _pitchbend(200) __ D4 ___ _pitchbend(150

f101 4.000 256 -7 100.000 170 200.000 86 183.333
i1 4.000 6.000 8.00 90.000 90.000 0.000 100.000 183.333 101.000 ; C4
i1 10.000 4.000 8.02 90.000 90.000 0.000 183.333 150.000 0.000 ; D4

Here the sec­tion between brack­ets { } fol­lows an inde­pen­dent portamento

ins(1) _pitchcont _pitchrange(200) _pitchbend(0) - ___ {C4 ___ _pitchbend(200) __ } D4 ___ _pitchbend(150)

f101 4.000 256 -7 42.857 170 200.000 86 200.000
i1 4.000 6.000 8.00 90.000 90.000 0.000 42.857 200.000 101.000 ; C4
i1 10.000 4.000 8.02 90.000 90.000 0.000 107.143 150.000 0.000 ; D4

A poly­met­ric struc­ture. E4 retains the ini­tial pitch­bend val­ue of C4.

ins(1) _pitchcont _pitchrange(200) _pitchbend(0) - ___ {C4 ___ _ pitchbend(200) __ , E4} D4 ___ _pitchbend(150)

f101 4.000 256 -7 42.857 170 200.000 86 200.000
i1 4.000 6.000 8.00 90.000 90.000 0.000 42.857 200.000 101.000 ; C4
i1 4.000 6.000 8.04 90.000 90.000 0.000 42.857 107.143 0.000 ; E4
i1 10.000 4.000 8.02 90.000 90.000 0.000 107.143 150.000 0.000 ; D4

Here, E4 has its own inde­pen­dent move­ment, which would be impos­si­ble with MIDI.

ins(1) _pitchcont _pitchrange(200) _pitchbend(0) - ___ {C4 ___ _ pitchbend(200) __ ,E4_ _pitchbend(180) _ _pitchbend(60) _ } D4 ____ _pitchbend(150)

f101 4.000 256 -7 42.857 170 200.000 86 200.000
i1 4.000 6.000 8.00 90.000 90.000 0.000 42.857 200.000 101.000 ; C4
f102 4.000 256 -7 42.857 128 180.000 64 60.000 64 60.000
i1 4.000 6.000 8.04 90.000 90.000 0.000 42.857 60.000 102.000 ; E4
i1 10.000 4.000 8.02 90.000 90.000 0.000 107.143 150.000 0.000 ; D4

Don't for­get to set _pitchrange(200) on chan­nel 2, oth­er­wise _pitchbend(180) will be used as the MIDI val­ue (range 0..16383). Note again that chan­nel 2 will not call instru­ment 3 because instru­ment 1 has already been specified.

ins(1) _pitchcont _pitchrange(200) _pitchbend(0) - ___ {C4 ___ _ pitchbend(200) __ , _chan(2) _pitchrange(200) E4_ _pitchbend(180) __ } D4 ___ _pitchbend(150)

f101 4.000 256 -7 42.857 170 200.000 86 200.000
i1 4.000 6.000 8.00 90.000 90.000 0.000 42.857 200.000 101.000 ; C4
f102 4.000 256 -7 42.857 128 180.000 128 180.000
i1 4.000 6.000 8.04 90.000 90.000 0.000 42.857 180.000 102.000 ; E4
i1 10.000 4.000 8.02 90.000 90.000 0.000 107.143 150.000 0.000 ; D4

In the above exam­ple, if you for­get to set the instru­ment to 1, instru­ments will be assigned based on MIDI chan­nels. This results in:

pitch­cont _pitchrange(200) _pitchbend(0) - ___ {C4 ___ _ pitchbend(200) __ , _chan(2) _pitchrange(200) E4_ _pitchbend(180) __ } D4 ___ _pitchbend(150)

i2 4.000 6.000 268.18 90.000 0.000 0.000 0.000 ; C4
i3 4.000 6.000 329.63 9946.821 15563.850 16.981 16.981 0.000 0.000 0.000 0.000 0.000 ; E4
i2 10.000 4.000 312.41 90.000 0.000 0.000 0.000 ; D4

Let us now try an arbi­trary para­me­ter 'blurb' (which has no MIDI equiv­a­lent)
on the two instru­ments 'Harpsichord' and 'Flute'.

_ins(Harpsichord) _cont(blurb) _value(blurb,123.42) C4 D4 _ins(Flute) E4 F4 _value(blurb,-211) _step(blurb) G4 A4 _value(blurb,-34) _fixed(blurb) B4 C5

i3 0.000 1.000 261.63 8191.500 8191.500 16.981 16.981 123.420 39.815 0.000 0.000 0.000 ; C4
i3 1.000 1.000 293.66 8191.500 8191.500 16.981 16.981 39.815 -43.790 0.000 0.000 0.000 ; D4
i2 2.000 1.000 329.63 90.000 -43.790 -127.395 0.000 ; E4
i2 3.000 1.000 349.23 90.000 -127.395 -211.000 0.000 ; F4
i2 4.000 1.000 392.00 90.000 -211.000 -211.000 0.000 ; G4
i2 5.000 1.000 440.00 90.000 -122.500 -122.500 0.000 ; A4
i2 6.000 1.000 493.88 90.000 -34.000 -34.000 0.000 ; B4
i2 7.000 1.000 523.25 90.000 -34.000 -34.000 0.000 ; C5

Instrument "Flute" can han­dle func­tion tables for 'blurb'.

ins(Flute) _cont(blurb) _value(blurb,544.5) C4__ _value(blurb,120) __ _value(blurb,-37)___ _value(blurb,0)

f101 0.000 256 -7 544.500 96 120.000 64 -37.000 96 0.000
i2 0.000 8.000 261.63 90.000 544.500 0.000 101.000 ; C4

Note that if the 'arbi­trary' para­me­ter is called 'vol­ume', it will be MIDI vol­ume, here remapped to the range -24..+24

_ins(Harpsichord) _cont(volume) _value(volume,127) A4 B4 _value(volume,0)

i3 0.000 1.000 440.00 8191.500 8191.500 24.000 -0.031 0.000 0.000 0.000 0.000 0.000 ; A4
i3 1.000 1.000 493.88 8191.500 8191.500 -0.031 -24.000 0.000 0.000 0.000 0.000 0.000 ; B4

The same applies to 'pitch­bend', 'pres­sure', 'panoram­ic' and 'mod­u­la­tion' (all case sen­si­tive). In instru­ment 3, MIDI mod­u­la­tion is remapped to the range 0..4000.

_ins(Harpsichord) _cont(modulation) _value(modulation,0) A4 B4 C5 D5 _value(modulation,16383)

i3 0.000 1.000 440.00 8191.500 8191.500 16.981 16.981 0.000 0.000 0.000 1000.000 0.000 ; A4
i3 1.000 1.000 493.88 8191.500 8191.500 16.981 16.981 0.000 0.000 1000.000 2000.000 0.000 ; B4
i3 2.000 1.000 523.25 8191.500 8191.500 16.981 16.981 0.000 0.000 2000.000 3000.000 0.000 ; C5
i3 3.000 1.000 587.33 8191.500 8191.500 16.981 16.981 0.000 0.000 3000.000 4000.000 0.000 ; D5

Now the two have been combined:

_ins(Harpsichord) _cont(volume) _cont(modulation) _value(volume,127) _value(modulation,0) A4 B4 C5 D5 _value(volume,0) _value(modulation,16383)

i3 0.000 1.000 440.00 8191.500 8191.500 24.000 18.431 0.000 0.000 0.000 1000.000 0.000 ; A4
i3 1.000 1.000 493.88 8191.500 8191.500 18.431 -0.031 0.000 0.000 1000.000 2000.000 0.000 ; B4
i3 2.000 1.000 523.25 8191.500 8191.500 -0.031 -2.794 0.000 0.000 2000.000 3000.000 0.000 ; C5
i3 3.000 1.000 587.33 8191.500 8191.500 -2.794 -24.000 0.000 0.000 3000.000 4000.000 0.000 ; D5

Note that if the addi­tion­al para­me­ter is unknown to the instru­ment, it will sim­ply be ignored. No warn­ing will be giv­en. For example:

_ins(Harpsichord) _cont(gasp) _value(gasp,0) A4 B4 _value(gasp,1000)

i3 0.000 1.000 440.00 8191.500 8191.500 16.981 16.981 0.000 0.000 0.000 0.000 0.000 ; A4
i3 1.000 1.000 493.88 8191.500 8191.500 16.981 16.981 0.000 0.000 0.000 0.000 0.000 ; B4

The 'Splashmachine' instru­ment han­dles the 'splash' para­me­ter which is instruct­ed to cre­ate func­tion tables with GEN08 (cubic spline) instead of GEN07.

ins(Splashmachine) _cont(splash) _value(splash,544.5) C4__ _value(splash,120) __ _value(splash,-37)___ _value(splash,130)

f101 0.000 256 -8 544.500 96 120.000 64 -37.000 96 130.000
i4 0.000 8.000 8.00 90.000 90.000 0.000 0.000 0.000 0.000 544.500 130.000 101.000 ; C4

The same instru­ment also uses GENO8 for the pitchbend.

_ins(Splashmachine) _cont(pitchbend) _pitchrange(200) _value(pitchbend,120) C4__ _value(pitchbend,34) __ _value(pitchbend,55)___ _value(pitchbend,-160)

This can be writ­ten more simply:

_ins(Splashmachine) _cont(pitchbend) _pitchrange(200) _pitchbend(120) C4__ _pitchbend(34) __ _pitchbend(55)___ _pitchbend(-160)

f101 0.000 256 -8 120.000 96 34.000 64 55.000 96 -160.000
i4 0.000 8.000 8.00 90.000 90.000 0.000 120.000 -160.000 101.000 0.000 0.000 0.000 ; C4

All these exam­ples pro­duce iden­ti­cal results with BP2.9.8 and its cur­rent ver­sion BP3.

Want to know more? Read the page Csound objects!