Install MinGW

👉   An ear­li­er ver­sion of this page rec­om­mend­ed w64devkit. This was a wrong choice, as its down­load­able files are sig­nalled with virus­es or mali­cious code.

Look at the warn­ing dis­played at the top right of any page of the Bol Processor. In the Windows envi­ron­ment you can read:

Top right warn­ing in Windows envi­ron­ment indi­cat­ing that a 'gcc' instal­la­tion is required.

The instal­la­tion of MinGW will allow "gcc" to run on a Windows machine. This may not be nec­es­sary if it has already been installed by anoth­er appli­ca­tion. In this case, there will be no such warn­ing at the top right of Bol Processor pages:

Clicking on the "run the com­pil­er" link will cre­ate the "bp.exe" con­sole. After reload­ing the page you are ready to use BP3:

👉  The PANIC but­ton is used to get silence when you are run­ning more than one instance of BP3.

Download MinGW-w64:

Install MinGW-w64:

  • Open the MinGW file with 7-Zip, telling it to extract files and store them to a fold­er, by default "x86_64-13.2.0-release-win32-seh-ucrt-rt_v11-rev0" in your Downloads folder.
  • Save the path to this fold­er in a text file, for instance (if the user is named "berna"):
    C:\Users\berna\Downloads\x86_64-13.2.0-release-win32-seh-ucrt-rt_v11-rev0\mingw64
  • 👉  For geeks and expert Windows users: It is not good prac­tice to keep exe­cutable files in the Downloads fold­er, as they may be delet­ed when opti­mis­ing disk space. You should move them to a suit­able loca­tion like oth­er appli­ca­tions. I keep the Downloads loca­tion for the demo.

Set up the Environment Path:

  • Right-click on 'This PC' or 'Computer' on the desk­top or in File Explorer, and select 'Properties'.
  • Click on 'Advanced system settings' and then 'Environment Variables'.
  • In the System Variables sec­tion, find and select the vari­able 'Path', then click on 'Edit'.
  • Click on 'New' and add the path to the direc­to­ry 'bin' of your MinGW-w64 instal­la­tion, such as "C:\Users\berna\Downloads\x86_64-13.2.0-release-win32-seh-ucrt-rt_v11-rev0\mingw64\bin" if you haven't changed the location.
  • Click 'OK' to close all dialogues.

Verify Installation:

  • 👉   The BP3 inter­face does this ver­i­fi­ca­tion auto­mat­i­cal­ly. If ‘gcc’ responds you will be offered to (re)compile the con­sole. The fol­low­ing instruc­tions are for an addi­tion­al check.
  • Open Command Prompt (cmd.exe) and type:
    cd C:\MinGW\bin
    gcc --version
  • The first com­mand opens a Unix "shell". The sec­ond com­mand should out­put the GCC ver­sion installed and include 'x86_64', indi­cat­ing it's set up for 64-bit.
    Ignore the win32 seg­ments you see in file and fold­er names. They are there to con­fuse you!

Additional Tips

  • Choosing a Shell: MinGW-w64 works with stan­dard Windows com­mand prompt and also with more Unix-like ter­mi­nals like Git Bash or Cygwin if those are already installed.
  • Using Make: To use 'make' with MinGW-w64, make sure that pack­age 'mingw32-make' is select­ed dur­ing instal­la­tion. It might be named dif­fer­ent­ly like 'mingw-w64-make' based on the ver­sion. You might need to rename 'mingw32-make.exe' to 'make.exe' in the bin direc­to­ry to make it rec­og­niz­able as 'make'.

By fol­low­ing these steps, you should be well-equipped to com­pile 64-bit appli­ca­tions — not only BP3 — using GCC on Windows via MinGW-w64. This set­up is use­ful for devel­op­ers who need a light­weight GCC envi­ron­ment with­out need­ing a full Linux set­up or the bulk of Visual Studio.

Publications

Bol Processor

Kippen, James & Bernard Bel (1989)
https://hal.science/hal-00275429v1
Can a com­put­er help resolve the prob­lem of ethno­graph­ic descrip­tion?
Anthropological Quarterly, 62 (3): 131-144.

Bel, Bernard (1990)
https://doi.org/10.1080/09298219008570560
Time and musi­cal struc­tures
(Download PDF)
Interface, 19 (2-3): 107-135.

Bel, Bernard (1990)
https://theses.hal.science/tel-00009692
Acquisition et représen­ta­tion de con­nais­sances en musique
(Knowledge acqui­si­tion and rep­re­sen­ta­tion in music)
Thèse de doc­tor­at en sci­ences. Université de droit, d'économie et des sci­ences - Aix-Marseille III.

Kippen, James & Bernard Bel (1992)
https://hal.science/halshs-00004506v1
Modelling music with gram­mars: for­mal lan­guage rep­re­sen­ta­tion in the Bol Processor.
In A. Marsden & A. Pople (eds.) Computer Representations and Models in Music, London, Academic Press, 1992: 207-238.

Kippen, James & Bernard Bel (1992)
https://hal.science/hal-00256386v1
Bol Processor Grammars.
In Mira Balaban, Otto Laske et Kemal Ebcioglu (eds.) Understanding Music with AI, American Association for Artificial Intelligence Press, Menlo Park CA: 366-400.

Kippen, James & Bernard Bel (1992)
https://bp3.tech/two-algorithms/
Symbolic and son­ic rep­re­sen­ta­tions of sound-object struc­tures.
In Mira Balaban, Otto Laske et Kemal Ebcioglu (eds.) Understanding Music with AI, American Association for Artificial Intelligence Press, Menlo Park CA: 64-110.

Kippen, James & Bernard Bel (1992)
https://hal.science/hal-00256385v1
Modelling impro­visato­ry and com­po­si­tion­al process­es.
In Denise Penrose & Ray Lauzanna (eds.) Languages of Design, 1. Elsevier Science Publishers, Amsterdam: 11-26.

Bel, Bernard (1992)
https://bp3.tech/time-setting-of-sound-objects/
Time-setting of sound-objects: a constraint-satisfaction approach.
International Workshop on Sonic Representation and Transform, Trieste (Italy), 26-30 October.

Bel, Bernard (1998)
https://hal.science/hal-00250274
Migrating Musical Concepts - an overview of the Bol Processor.
Computer Music Journal, Vol. 22, 2: 56-64.

Bel, Bernard (2001)
https://bp3.tech/rationalizing-musical-time/
Rationalizing musi­cal time: syn­tac­tic and symbolic-numeric approach­es.
In Clarence Barlow, (ed.) The Ratio Book. Den Haag: Royal Conservatory - Institute of Sonology: 86-101.

QAVAID

Kippen, James & Bernard Bel (1989)
https://hal.science/halshs-00004505
The iden­ti­fi­ca­tion and mod­el­ling of a per­cus­sion ‘lan­guage,’ and the Emergence of Musical Concepts in a machine-learning exper­i­men­tal set-up.
Computers and the Humanities, 23 (3): 119-214.

Bel, Bernard (1990)
https://hal.science/hal-00275789v2
Inférence de lan­gages réguliers.
Journées Françaises de l'Apprentissage, Lannion, France : 5-27.

Modelling music with grammars

Jim Kippen & Bernard Bel

Modelling music with gram­mars: for­mal lan­guage rep­re­sen­ta­tion in the Bol Processor. In A. Marsden & A. Pople (eds.): Computer Representations and Models in Music, London, Academic Press, 1992, p. 207-238.

Abstract

Improvisation in North Indian tabla drum­ming is sim­i­lar to speech inso­far as it is bound to anun­der­ly­ing sys­tem of rules deter­min­ing cor­rect sequences. The par­al­lel is fur­ther rein­forced by the fact that tabla music may be rep­re­sent­ed with an oral nota­tion sys­tem used for its trans­mis­sion and, occa­sion­al­ly, per­for­mance. Yet the rules are implic­it and avail­able only through the musi­cians’ abil­i­ty to play cor­rect sequences and recog­nise incor­rect ones. A lin­guis­tic mod­el of tabla impro­vi­sa­tion and eval­u­a­tion derived from pat­tern lan­guages and for­mal gram­mars has been imple­ment­ed in the Bol Processor, a soft­ware sys­tem used in inter­ac­tive field­work with expert musi­cians. The paper demon­strates the abil­i­ty of the mod­el to han­dle com­plex struc­tures by tak­ing real exam­ples from the reper­toire. It also ques­tions the rel­e­vance of attempt­ing to mod­el irreg­u­lar­i­ties encoun­tered in actu­al performance.

Download this paper

Pattern grammars

Bernard Bel

Pattern gram­mars in for­mal rep­re­sen­ta­tions of musi­cal struc­tures. 11th International Joint Conference on Artificial Intelligence, Workshop on AI & Music, 20 August 1989, p.113-42

Abstract

This paper intro­duces sev­er­al for­mal mod­els of pat­tern rep­re­sen­ta­tion in music. Polyvalent mul­ti­modal gram­mars describe par­tial­ly over­lap­ping sound events as found in poly­phon­ic struc­tures. Bol Processor gram­mars are char­ac­ter­i­sa­tions of sequen­tial events in terms of sub­string rep­e­ti­tions, homo­mor­phisms, etc. Parsing tech­niques, sto­chas­tic pro­duc­tion and recent devel­op­ments of BP gram­mars are briefly described.

Download this paper

Time-setting of sound-objects

Bernard Bel

Time-setting of sound-objects: a constraint-satisfaction approach. Invited paper, Workshop on Sonic Representations and Transforms. INTERNATIONAL SCHOOL FOR ADVANCED STUDIES (ISAS), Trieste, 26-30 October 1992.

Abstract

This paper deals with the sched­ul­ing of “sound-objects”, here­by mean­ing pre­de­fined sequences of ele­men­tary tasks in a sound proces­sor, with each task mapped to a time-point. Given a struc­ture of sound-objects com­plete­ly ordered in a phase dia­gram, an “instance” of the struc­ture may be obtained by com­put­ing the dates at which each task should be exe­cut­ed. Time-setting the struc­ture amounts to solv­ing a sys­tem of con­straints depend­ing on (1) met­ric and topo­log­i­cal prop­er­ties of sound-objects, (2) con­texts in which they are found, and (3) para­me­ters relat­ed to the per­for­mance itself (“smooth” or “stri­at­ed” time, speed, etc.). This may require relocating/truncating objects or delay­ing part of the sound-object struc­ture. A constraint-satisfaction algo­rithm is intro­duced, the time com­plex­i­ty of which is O(n.k) in most cas­es, where n is the num­ber of sequences and k the max­i­mum length of a sequence. In the worst case it remains bet­ter than O(n2.k3). Other fields of appli­ca­tions are pro­posed, includ­ing mul­ti­me­dia per­for­mance and computer-aided video editing.

Download this paper

The Well-tempered Clavier

   

Below is the com­plete set of Preludes and Fugues by J.S. Bach known as The Well-Tempered Clavier, Books II and II, pub­lished around 1722 and 1742 respectively.

What was the composer's inten­tion when he used the term "well tempered"?

All the scores in this cor­pus have been con­vert­ed from MusicXML to Bol Processor syn­tax — see Importing MusicXML scores. This paved the way for tonal analy­sis using Bol Processor's tonal batch pro­cess­ing tool, described in detail on the Bach Well-tempered tonal analy­sis page.

Each musi­cal work has been com­pared with a set of tun­ing schemes imple­ment­ed on the Bol Processor. These include tem­pera­ments doc­u­ment­ed by Pierre-Yves Asselin ([1985], 2000) and "nat­ur­al" scales sys­tem­at­i­cal­ly con­struct­ed — see pages Microtonality and Creation of just-intonation scales.

The match­ing algo­rithm select­ed the tun­ing scheme(s) that best matched the def­i­n­i­tions of 'con­so­nant' and 'dis­so­nant' melod­ic and har­mon­ic inter­vals. Two sets of def­i­n­i­tions were used: "stan­dard" and " alter­na­tive". Obviously, under any hypoth­e­sis, some tun­ing schemes are more suit­able than oth­ers for achiev­ing the composer's pre­sumed per­cep­tion of 'con­so­nance'. Therefore, the fol­low­ing sound pro­duc­tions of the Preludes and Fugues, with their "best" tun­ing schemes, should not be tak­en as a defin­i­tive answer to the ques­tion of tem­pera­ment dis­cussed by Bach's stu­dents and fol­low­ers. They may, how­ev­er, come clos­est to what the com­pos­er intend­ed, with­in the lim­its of the ear's abil­i­ty to dis­crim­i­nate between intervals.

Note that if sev­er­al tun­ing schemes ranked first for match­ing a piece, only one of them was used for the demo. It is pos­si­ble that anoth­er may sound better.

Settings of an audio unit for the post-processing

All the pieces were played and record­ed on a Csound instru­ment, sim­i­lar to a harp­si­chord, allow­ing a clear appre­ci­a­tion of the tonal inter­vals. This kind of "mag­ni­fy­ing glass" view of the tonal inter­vals pro­duced harsh sound­ing ver­sions, avail­able in the Standard (raw) and Alternate (raw) fold­ers. These have been post-processed with a bit of reverb to pro­duce soft­er attacks. The post-processed sound files are the ones accessed in the tables below. Readers famil­iar with sound edit­ing are invit­ed to down­load the raw files and sug­gest bet­ter post-processing options.

The last two columns of each table con­tain record­ings of human inter­pre­ta­tions of the same works by out­stand­ing harp­si­chordists. These explore dimen­sions of musi­cal­i­ty that the mechan­i­cal inter­pre­ta­tion of the score with per­fect tonal inter­vals could not reach. It remains that the chal­lenge of accu­rate tonal­i­ty was a pri­or­i­ty for this cor­pus, as evi­denced by the title "well-tempered" giv­en by its composer.

Book I sound examples

These Bol Processor + Csound record­ings may be reused under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0) licence. Attribution includes links to the present page, to Csound and to the author/editor of its MusicXML score (list­ed on the Bach Well-tempered tonal analy­sis page).

Listen with head­phones or a very good sound system!

The record­ings of Wanda Landowska's (1879-1959) are from YouTube. Other inter­pre­ta­tions are cour­tesy of Wikimedia Commons.

As explained on the Bach Well-tempered tonal analy­sis page, the D'Alambert-Rousseau tem­pera­ment was found to be equiv­a­lent to H.A. Kellner's BACH in terms of scale intervals.

Standard
(favourite: Sauveur)
Alternate
(favourite: D'Alembert-Rousseau)
Humanper­for­mance   
KeyPreludeFuguePreludeFuguePreludeFugue
1BWV 846CmajSauveurSauveurRameau en sibMarpurgMartha GoldsteinMartha Goldstein
2BWV 847CminSauveurSauveurD'Alambert-RousseauD'Alambert-RousseauWanda LandowskaMartha Goldstein
3BWV 848C#majAbmajZarlino nat­ur­alD'Alambert-RousseauD'Alambert-RousseauWanda LandowskaWanda Landowska
4BWV 849C#minWerckmeister 4Werckmeister 4CminCminWanda LandowskaWanda Landowska
5BWV 850DmajSauveurSauveurD'Alambert-RousseauRameau en doMartha GoldsteinMartha Goldstein
6BWV 851DminSauveurSauveurD'Alambert-RousseauD'Alambert-RousseauMartha GoldsteinMartha Goldstein
7BWV 852E♭majRameau en sibRameau en sibRameau en sibD'Alambert-RousseauWanda LandowskaWanda Landowska
8BWV 853E♭min/D#minEbminMarpurgEbminDminWanda LandowskaWanda Landowska
9BWV 854EmajSauveurWerckmeister 4EmajD'Alambert-RousseauWanda LandowskaWanda Landowska
10BWV 855EminSauveurSauveurD'Alambert-RousseauD'Alambert-RousseauWanda LandowskaWanda Landowska
11BWV 856FmajSauveurSauveurD'Alambert-RousseauD'Alambert-RousseauWanda LandowskaWanda Landowska
12BWV 857FminZarlino nat­ur­alSauveurD'Alambert-RousseauD'Alambert-RousseauWanda LandowskaWanda Landowska
13BWV 858F#majMarpurgF#majD'Alambert-RousseauD'Alambert-RousseauWanda LandowskaWanda Landowska
14BWV 859F#minSauveurSauveurFminD'Alambert-RousseauWanda LandowskaWanda Landowska
15BWV 860GmajSauveurSauveurD'Alambert-RousseauD'Alambert-RousseauWanda LandowskaWanda Landowska
16BWV 861GminSauveurSauveurRameau en sibRameau en sibWanda LandowskaWanda Landowska
17BWV 862A♭majAbmajZarlino nat­ur­alD'Alambert-RousseauD'Alambert-RousseauWanda LandowskaWanda Landowska
18BWV 863G#minGminAbminGminDminWanda LandowskaWanda Landowska
19BWV 864AmajSauveurSauveurD'Alambert-RousseauD'Alambert-RousseauWanda LandowskaWanda Landowska
20BWV 865AminSauveurSauveurD'Alambert-RousseauD'Alambert-RousseauWanda LandowskaWanda Landowska
21BWV 866B♭majSauveurSauveurRameau en sibMarpurgMartha GoldsteinWanda Landowska
22BWV 867B♭minSauveurMarpurgAminAminWanda LandowskaWanda Landowska
23BWV 868BmajBmajMarpurgD'Alambert-RousseauEbmajWanda LandowskaWanda Landowska
24BWV 869BminSauveurSauveurD'Alambert-RousseauD'Alambert-RousseauWanda LandowskaWanda Landowska
➡ Click a scale or a performer's name to lis­ten to the recording

Book II sound examples

The record­ings of Ottavio Dantone are from YouTube.

As explained above, D'Alambert-Rousseau tem­pera­ment was found to be equiv­a­lent to H.A. Kellner's BACH.

Standard
(favourite: Sauveur)
Alternate
(favourite: D'Alembert-Rousseau)
Humanper­for­mance 
KeyPreludeFuguePreludeFuguePreludeFugue
1BWV 870CmajSauveurSauveurMarpurgD'Alambert-RousseauOttavio DantoneOttavio Dantone
2BWV 871CminRameau en sibSauveurD'Alambert-RousseauD'Alambert-RousseauOttavio DantoneOttavio Dantone
3BWV 872C#majMarpurgDbmajD'Alambert-RousseauD'Alambert-RousseauOttavio DantoneOttavio Dantone
4BWV 873C#minSauveurWerckmeister 4D'Alambert-RousseauD'Alambert-RousseauOttavio DantoneOttavio Dantone
5BWV 874DmajSauveurSauveurD'Alambert-RousseauD'Alambert-RousseauOttavio DantoneOttavio Dantone
6BWV 875DminSauveurSauveurD'Alambert-RousseauD'Alambert-RousseauOttavio DantoneOttavio Dantone
7BWV 876E♭majRameau en sibRameau en sibRameau en sibRameau en sibOttavio DantoneOttavio Dantone
8BWV 877D#minMarpurgMarpurgD'Alambert-RousseauDminOttavio DantoneOttavio Dantone
9BWV 878EmajSauveurWerckmeister 4Werckmeister 4Werckmeister 4Ottavio DantoneOttavio Dantone
10BWV 879EminSauveurSauveurD'Alambert-RousseauD'Alambert-RousseauOttavio DantoneOttavio Dantone
11BWV 880FmajSauveurSauveurMarpurgD'Alambert-RousseauOttavio DantoneOttavio Dantone
12BWV 881FminZarlino nat­ur­alZarlino nat­ur­alD'Alambert-RousseauD'Alambert-RousseauOttavio DantoneOttavio Dantone
13BWV 882F#majF#majBmajD'Alambert-RousseauD'Alambert-RousseauOttavio DantoneOttavio Dantone
14BWV 883F#minSauveurSauveurD'Alambert-RousseauD'Alambert-RousseauOttavio DantoneOttavio Dantone
15BWV 884GmajSauveurSauveurD'Alambert-RousseauD'Alambert-RousseauOttavio DantoneOttavio Dantone
16BWV 885GminSauveurSauveurRameau en sibD'Alambert-RousseauOttavio DantoneOttavio Dantone
17BWV 886A♭majZarlino nat­ur­alAbmajD'Alambert-RousseauD'Alambert-RousseauOttavio DantoneOttavio Dantone
18BWV 887G#minAbminAbminD'Alambert-RousseauD'Alambert-RousseauOttavio DantoneOttavio Dantone
19BWV 888AmajSauveurSauveurRameau en doD'Alambert-RousseauOttavio DantoneOttavio Dantone
20BWV 889AminSauveurSauveurD'Alambert-RousseauD'Alambert-RousseauOttavio DantoneOttavio Dantone
21BWV 890B♭majSauveurSauveurMarpurgMarpurgOttavio DantoneOttavio Dantone
22BWV 891B♭minBbminMarpurgAminAminOttavio DantoneOttavio Dantone
23BWV 892BmajBmajBmajD'Alambert-RousseauD'Alambert-RousseauOttavio DantoneOttavio Dantone
24BWV 893BminSauveurSauveurD'Alambert-RousseauBbminOttavio DantoneOttavio Dantone
➡ Click a scale or a performer's name to lis­ten to the recording

More examples?

Interestingly, sim­i­lar clas­si­fi­ca­tions of tun­ing sys­tems apply to anoth­er famous cor­pus by J.S. Bach: the Goldberg Variations (1741). Read the Bach well-tempered tonal analy­sis page.

Listen to the syn­the­sis of Goldberg Variations with Sauveur's mean­tone tem­pera­ment.
Listen to the syn­the­sis of Goldberg Variations with D'Alembert-Rousseau tem­pera­ment.
Listen to the Aria on a harp­si­chord tuned with Werckmeister III mean­tone temperament.

In the same peri­od (1730), the French musi­cian François Couperin com­posed Les Ombres Errantes, for which our tonal analy­sis sug­gests a Rameau en sib temperament:

François Couperin's “Les Ombres Errantes” inter­pret­ed by the Bol Processor + Csound
with a “Rameau en sib” tem­pera­ment ➡ Image
Source: MusicXML score by Vinckenbosch in the MuseScore com­mu­ni­ty

Conclusive remarks

The title of this cor­pus, The Well-Tempered Clavier, sug­gests that its com­pos­er intend­ed to demon­strate the suit­abil­i­ty of one or more tem­pera­ments for the per­for­mance of musi­cal works in any tonal­i­ty. As pre­vi­ous­ly stat­ed, this does not imply that they were all intend­ed to con­form to the same unique solu­tion; how­ev­er, it is tempt­ing to hypoth­e­size that the same instru­ment and tun­ing scheme were uti­lized for the entire­ty of the set. This has led to spec­u­la­tion by J.S. Bach's pupils, who were not instruct­ed on how to pro­ceed. Part of the rep­u­ta­tion of great artists in those days was based on the with­hold­ing of information.

It would be illog­i­cal in the con­text of human musi­cians and phys­i­cal instru­ments to play a pre­lude in one tun­ing and then retune the instru­ment sole­ly for the pur­pose of play­ing the fugue. Consequently, these audio exam­ples are not intend­ed to emu­late a gen­uine per­for­mance. They can, how­ev­er, assist in eval­u­at­ing the suit­abil­i­ty of a pre­ferred tun­ing scheme for each musi­cal work.

A "deaf musi­col­o­gist" employs a method of tonal­i­ty assess­ment that involves mea­sur­ing melod­ic and har­mon­ic inter­vals in terms of fre­quen­cy ratios. The results of this assess­ment depend on the val­ues (weights) assigned to cer­tain ratios in advance. Our find­ings demon­strate that equal­ly mean­ing­ful sets of hypothe­ses can lead to com­plete­ly dif­fer­ent results, which only trained ears can dis­tin­guish. The com­bi­na­tion of hypothe­ses may not elu­ci­date the sit­u­a­tion. An appar­ent pref­er­ence for a tun­ing scheme may be the result of a numer­i­cal arte­fact rather than proof of its validity.

Bach's fam­i­ly tree, unknown artist (source)

A metic­u­lous lis­ten­ing to these record­ings, with the exclu­sion of the some­what inel­e­gant ren­der­ing of fast trills in the low­er octave, reveals a musi­cal dimen­sion that can­not be reduced to the con­cept of 'inter­vals'. Each piece can be likened to a pre­cious stone, exhibit­ing an aston­ish­ing reg­u­lar­i­ty in its struc­ture. The lis­ten­er is invit­ed by the artist to explore all sides of the crys­tal and to appre­ci­ate its puri­ty: a 'tonal land­scape'. In this approach, the slight­est imper­fec­tion, such as a few cents up or down, is ampli­fied by the struc­ture. In short, the most impor­tant fea­ture may be less the choice of a struc­ture than its con­sis­ten­cy in ren­der­ing each musi­cal phrase.

It is uncer­tain whether J.S. Bach had a spe­cif­ic, unique musi­cal tem­pera­ment in mind when he com­posed The Well-Tempered Clavier. This is because the high­est rat­ing in terms of inter­vals may not be the most appro­pri­ate. This ques­tion remains open to art his­to­ri­ans and musi­col­o­gists. However, from the sound exam­ples, it is evi­dent that play­ing this reper­toire on improp­er­ly tuned instru­ments — in terms of con­so­nance — is tan­ta­mount to expos­ing plas­tic imi­ta­tions of diamonds.

Reference(s)

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

Musicians inter­est­ed in con­tin­u­ing this research and relat­ed devel­op­ment can use the Bol Processor BP3 to process musi­cal works and imple­ment fur­ther tun­ing pro­ce­dures. Follow the instruc­tions on the Bol Processor ‘BP3’ and its PHP inter­face page to install BP3 and learn its basic oper­a­tion. Download and install Csound from its dis­tri­b­u­tion page.

Bernard Bel — January 2022

Please join the BP users help forum , BP open dis­cus­sion forum and/or the BP devel­op­ers list to stay in touch with the progress of work and dis­cuss relat­ed the­o­ret­i­cal issues.

Bach well-tempered tonal analysis

Harpsichord jacks in a com­plet­ed harp­si­chord
Source: Material Matters

The fol­low­ing is a "com­pu­ta­tion­al" tonal analy­sis of musi­cal works by J.S. Bach known as The Well-tempered Clavier, books II and II, pub­lished around 1722 and 1742 respec­tive­ly, and the Goldberg Variations (1741).

All musi­cal scores have been con­vert­ed from MusicXML to Bol Processor syn­tax — see Importing MusicXML scores. This tonal analy­sis is gen­er­at­ed by Bol Processor's tonal batch pro­cess­ing tool.

The aim of this exer­cise was to match each musi­cal work to a set of tun­ing schemes described and imple­ment­ed on the Bol Processor. These include all the tem­pera­ments doc­u­ment­ed by Pierre-Yves Asselin ([1985], 2000) and "nat­ur­al" scales sys­tem­at­i­cal­ly con­struct­ed — see Creation of just into­na­tion scales.

It has been sug­gest­ed that the best match for a scale is the tun­ing scheme that is appro­pri­ate for the inter­pre­ta­tion of a musi­cal work. This assump­tion is based on the hypothe­ses that (1) musi­cians and com­posers of the Baroque peri­od aimed to achieve opti­mal 'con­so­nance', and that (2) this notion implied a pref­er­ence for cer­tain inter­vals which we note as inte­ger ratios. These claims are dis­cussed on this page. Accurately tuned sound exam­ples are sug­gest­ed for audi­tive eval­u­a­tion of the results.

The inter­est of this tonal analy­sis goes beyond the under­stand­ing of music the­o­ry and prac­tice. Its epis­te­mo­log­i­cal dimen­sion is the trust­wor­thi­ness of today's fash­ion­able math­e­mat­i­cal "pre­dic­tive mod­els". We show that, giv­en a set of hypothe­ses, the solu­tion to an opti­mi­sa­tion prob­lem — find­ing the best tun­ing scheme for all musi­cal works in a reper­toire — is not unique, as it depends on ini­tial con­di­tions. Furthermore, the same ini­tial con­di­tions can pro­duce a cloud of seem­ing­ly iden­ti­cal solu­tions, even though each of them points to com­plete­ly dif­fer­ent pro­ce­dures for its real­i­sa­tion in the "real world" — here, the tun­ing of a harpsichord.

The take-home mes­sage is that sci­en­tists should not be impressed by the accu­ra­cy and appar­ent con­sis­ten­cy of machine-generated solu­tions. They must crit­i­cal­ly exam­ine the ini­tial con­di­tions and the cal­cu­la­tion process itself.

Ultimately, the only accept­able way to (in)validate a com­po­si­tion­al mod­el is to lis­ten to the audio ren­der­ing of the results.

“Standard” analysis

The Well-Tempered Clavier con­sists of two books, each con­tain­ing 24 pre­ludes and 24 fugues in all the usu­al key sig­na­tures. In total, this analy­sis cov­ered 96 musi­cal works (pre­sum­ably) writ­ten by the same com­pos­er under (pre­sum­ably) sim­i­lar conditions.

Our first analy­sis is based on the fol­low­ing set­tings of inter­vals esti­mat­ed to be con­so­nant or dis­so­nant:

Settings for a "stan­dard" analysis

The analy­sis of ascend­ing and descend­ing melod­ic inter­vals looks for com­mon fre­quen­cy ratios close to 3/2 (Pythagorean fifths) and 5/4 (har­mon­ic major thirds), which are wide­ly regard­ed as 'con­so­nant'. It also includes the ratios 6/5 (har­mon­ic minor thirds) and 9/8 (Pythagorean major sec­onds), which can be con­sid­ered opti­mal. Other ratios are often con­sid­ered 'dis­so­nant': 40/27 (wolf fifth), 320/243 (wolf fourth) and 81/64 (Pythagorean major third). These dis­so­nant inter­vals are 1 com­ma (ratio 81/80) high­er or low­er than their "con­so­nant" neigh­bours — see the Just into­na­tion: a gen­er­al frame­work page.

Consonant inter­vals are giv­en pos­i­tive weights, for exam­ple '1' for a har­mon­ic major third and '2' for a Pythagorean fifth. Dissonant inter­vals are giv­en neg­a­tive weights, for exam­ple '-2' for wolfish inter­vals and '-1' for Pythagorean major thirds. These weights can be mod­i­fied; indeed, the mod­i­fi­ca­tion will in turn change the rat­ings of the tun­ing schemes.

Each melod­ic inter­val found in the musi­cal work will be sized accord­ing to the same inter­val in the scale being test­ed for com­pat­i­bil­i­ty. For exam­ple, when try­ing to match the D'Alambert-Rousseau tun­ing scheme (see image), a note sequence 'C' - 'Eb' will be sized 290 cents, which is close to 294 cents or the ratio 32/27 (Pythagorean minor third). When this ratio appears in the set­tings, the scale val­ue is increased by the weight of the ratio mul­ti­plied by the (sym­bol­ic) dura­tion of the inter­val — see Tonal Analysis of Musical Works for details of this procedure.

The same method is applied to har­mon­ic inter­vals, which are giv­en the same weights as melod­ic inter­vals, except for the 9/8 ratio, which is ignored.

The scores for ascend­ing and descend­ing melod­ic inter­vals are then added to the score for har­mon­ic inter­vals, with weights of 1, 1 and 2 respec­tive­ly. This weight­ing may be mod­i­fied if "con­so­nance" is expect­ed to be greater for melod­ic than for har­mon­ic inter­vals, or if ascend­ing and descend­ing melod­ic inter­vals are not con­sid­ered equal­ly important.

Each scale is giv­en a mark if it is found to be the best match for a piece of music. Counting these marks over the entire reper­toire gives the best tun­ing scheme(s) for that repertoire.

Results are stored in tables that can be down­loaded in both HTML and CSV for­mats. The ini­tial set­tings are recalled at the bot­tom of the "All Results" HTML page.

Each cell in the "all results" table indi­cates the rank of a giv­en tun­ing scheme (scale) that match­es a giv­en musi­cal work. For exam­ple, in the fugues of book I, Corette's tem­pera­ment (col­umn corrette) was ranked 6th for the 5th fugue, and the best match for this piece was the Sauveur's tem­pera­ment (col­umn sauveur).

The line labelled Ranked first (times) shows the num­ber of times each tun­ing scheme ranked first in the clas­si­fi­ca­tion of this cor­pus. The line labelled Average score shows the aver­age glob­al (melod­ic + har­mon­ic) score com­put­ed for this tun­ing scheme, as explained on our Tonal analy­sis page.

Abstract tables show the list of first ranked tun­ing schemes for each musi­cal work.

The full set of scale images is avail­able on this page.

Discussion of the standard analysis

The scale of Sauveur's temperament

Of of these 96 musi­cal works, 56 chose 'sauveur' as their favourite tun­ing scheme, plus 9 as their sec­ond favourite. This tem­pera­ment strik­ing­ly dom­i­nates the clas­si­fi­ca­tion because of its abil­i­ty to pro­duce almost per­fect Pythagorean fifths (ratio 3/2), har­mon­ic major thirds (ratio 5/4) and har­mon­ic minor thirds (ratio 6/5).

Note that it also con­tains a wolf fourth 'Eb' - 'G#' close to 477 cents (or ratio 320/243) which is per­ceived as a dis­so­nant inter­val. It is assumed that these two notes are nev­er (or rarely) found in melod­ic or har­mon­ic inter­vals in this reper­toire. This illus­trates the fact that there is no one-size-fits-all solu­tion to the prob­lem of tun­ing an instru­ment for this type of music. In a kind of "reverse engi­neer­ing", we can say that the com­pos­er explored melod­ic and har­mon­ic pleas­ing effects in order to build this reper­toire: play­ing on the instru­ment before notat­ing it on sheets of music sheets.

As sug­gest­ed in our tuto­r­i­al, there is no evi­dence that J.S. Bach was aware of the the­o­ret­i­cal work of the French physi­cian Joseph Sauveur, but the the­o­ret­i­cal frame­work of this tem­pera­ment — a sin­gle sequence of fifths dimin­ished by 1/5 com­ma (see image and read Asselin, 2000 p. 80) — sug­gests that any com­pos­er could work it out inde­pen­dent­ly. This process has been record­ed on the Bol Processor's Scale page as follows:

Created meantone downward notes “do,fa,sib,mib” fraction 3/2 adjusted -1/5 comma
Created meantone upward notes “do,sol,re,la,mi,si,fa#,do#,sol#” fraction 3/2 adjusted -1/5 comma

Interestingly, "nat­ur­al scales" with names cor­re­spond­ing to the key — for exam­ple, Abmin (i.e. G#min) for Fugue 18 in G♯ minor, Book II (BWV 887) — were often at the top of the pop­u­lar tun­ing schemes, but in most cas­es were over­tak­en by sev­er­al tem­pera­ments. For more details on these scales, see our page on the Creation of just-intonation scales.

In all cas­es, the equal tem­pera­ment (see image) was among the low­est, due to its use of major and minor thirds close to Pythagorean. This con­tra­dicts the pop­u­lar belief that Bach's series of Preludes and Fugues was intend­ed to equate 'well-tempered' with 'equal-tempered'

This first result also sug­gests that tem­pera­ments often pro­vide a bet­ter tonal struc­ture for achiev­ing max­i­mum con­so­nance than the so-called just into­na­tion scales.

Temperaments are based on empir­i­cal tun­ing pro­ce­dures guid­ed by per­ceived inter­vals (see Asselin, 2000) where­as "just into­na­tion" is the result of spec­u­la­tion about numer­i­cal ratios — a deduc­tive process. This brings us back to a dis­cus­sion of the ancient Indian approach to tonal­i­ty, see the page on The two-vina exper­i­ment.

“Alternate” analysis

At this stage, it is tempt­ing to con­clude that J.S. Bach's The Well-Tempered Clavier was intend­ed to be played on instru­ments tuned to Sauveur's tem­pera­ment. However, the result of any analy­sis must always be exam­ined for bias in its hypothe­ses. In the present case, we must revise the choice of cer­tain fre­quen­cy ratios as cri­te­ria for assess­ing the 'con­so­nance' of melod­ic and har­mon­ic intervals.

The minor third — either har­mon­ic (6/5) or Pythagorean (32/27) — is in ques­tion because the Pythagorean minor third appears in some tem­pera­ments. For exam­ple, the Cmaj nat­ur­al scale (see image) uses 32/27 for its inter­val 'C' - 'Eb'. Therefore, it makes sense to ignore all minor thirds when eval­u­at­ing har­mon­ic inter­vals and to accept both ratios 6/5 and 32/27 as equal pos­i­tive weights in melod­ic inter­vals. This option is illus­trat­ed by sound exam­ples, read on. A use­ful vari­ant would be dif­fer­ent ratios in ascend­ing and descend­ing har­mon­ic intervals.

The same obser­va­tion applies to major thirds: although 5/4 (har­mon­ic) cer­tain­ly sounds bet­ter than 81/64 (Pythagorean) in har­mon­ic inter­vals, there is no strong rea­son to pre­fer the for­mer in melod­ic inter­vals — again with a pos­si­ble dis­tinc­tion between ascend­ing and descend­ing movements.

Let us start the whole analy­sis again with these changed settings:

Settings for an "alter­nate" analysis

Results are the following:

Discussion of the alternate analysis

The results con­tra­dict the con­clu­sion of the 'stan­dard' analy­sis: Sauveur's tem­pera­ment may not be such a good choice, giv­en the alter­na­tive choice of ratios for consonant/dissonant melod­ic and har­mon­ic intervals.

According to these set­tings, the best tun­ing schemes might be the D'Alambert-Rousseau tem­pera­ment (see pic­ture and read Asselin, 2000 p. 119) and H.A. Kellner's BACH tem­pera­ment (see pic­ture and read Asselin, 2000 p. 101). Both were designed after J.S. Bach's death, but sim­i­lar or iden­ti­cal tun­ing pro­ce­dures could have been devised by the composer.

A com­par­i­son of the images and cent posi­tions (iden­ti­cal with­in ± 7 cents) explains why these two tem­pera­ments pro­duced iden­ti­cal match­es, despite their com­plete­ly dif­fer­ent tun­ing pro­ce­dures. Look at the pro­ce­dures (traced by the algo­rithm) and lis­ten to short note sequences pro­duced with these scales:

D'Alembert-Rousseau temperament
Created meantone upward notes “do,sol,re,la,mi” fraction 3/2 adjusted -1/4 comma
Created meantone downward notes “do,fa,sib,mib,sol#” fraction 3/2 adjusted 1/12 comma
Equalized intervals over series “sol#,do#,fa#,si,mi” approx fraction 2/3 adjusted 2.2 cents to ratio = 0.668


Sequence of notes accord­ing to D'Alembert-Rousseau temperament

Kellner's BACH temperament
Created meantone upward notes “do,sol,re,la,mi” fraction 3/2 adjusted -1/5 comma
Added fifths down: “do,fa,sib,mib,lab,reb,solb” starting fraction 1/1
Created meantone upward notes “mi,si” fraction 3/2

Sequence of notes accord­ing to Kellner's BACH temperament

As a reminder, the same sequence of notes with an equal-tempered scale:

Sequence of notes accord­ing to equal temperament
D'Alembert-Rousseau tun­ing scheme (Asselin, 2000 p. 119)

These tun­ing pro­ce­dures are not exact­ly the same as those described by Asselin (2000, p. 120 and 102), but they pro­duce the same tonal positions.

In these tem­pera­ments, inter­vals such as 'C' - 'Eb' are ren­dered as Pythagorean minor thirds (32/27), and many Pythagorean major thirds (ratio 81/64) are encoun­tered. This jus­ti­fies their choice, giv­en the new con­di­tions of analysis.

Again, these tem­pera­ments dom­i­nate the clas­si­fi­ca­tion, tak­ing first place 65 times and sec­ond place 15 times, while the equal tem­pera­ment, despite its mas­tery of Pythagorean major thirds, took first place only 21 times. Compared to Sauveur's tem­pera­ment in the stan­dard analy­sis (56 first posi­tions and 9 sec­ond posi­tions), these tem­pera­ments look 'bet­ter', but this com­par­i­son is irrel­e­vant as the two analy­ses focused on dif­fer­ent ratios.

The 33 Preludes and Fugues that do not con­form to these tem­pera­ments often pre­fer a just into­na­tion scale in the same key; for exam­ple, Prelude 8 in E♭ minor of Book I (BWV 853) choos­es the Ebmin scale, and Prelude 9 in E major of Book I (BWV 854) choos­es the Emaj scale. However, this match­ing is less com­mon in the "dis­si­dent" fugues.

More advanced analy­sis is required. Note that chang­ing the weight­ing of inter­vals or the weight­ing in the sum­ma­tion of melod­ic and har­mon­ic scores can rad­i­cal­ly change the classification.

In this dis­cus­sion, we have only exam­ined tun­ing schemes at the top of the clas­si­fi­ca­tion. Other schemes may be prefer­able when look­ing at melod­ic or har­mon­ic scores sep­a­rate­ly — see our tuto­r­i­al Tonal analy­sis.

Sound examples

The auto­mat­ic tonal analy­sis of a large reper­toire, com­pared with the whole set of tun­ing schemes imple­ment­ed in the Bol proces­sor, did not solve the prob­lem of find­ing "the best tun­ing scheme" for this reper­toire, since it depends on the ini­tial con­di­tions: fre­quen­cy ratios esti­mat­ed as "con­so­nant" or "dis­so­nant", plus the composer's pre­sumed focus on opti­mal con­so­nance. Nevertheless, two analy­ses select­ed 2 (or 3) tun­ing schemes as dom­i­nant in the clas­si­fi­ca­tion. Further analy­sis would be required to refine this result, if it is significant.

All sound exam­ples are com­pared with human inter­pre­ta­tions on (not so well-tempered?) phys­i­cal instru­ments on the page The Well-tempered clavier.

These sound exam­ples are use­ful to hear the dif­fer­ence between tun­ing schemes select­ed on the basis of the "stan­dard" and "alter­na­tive" set­tings. For exam­ple, Fugue 8 of book I may sound more melo­di­ous with a Dmin tun­ing (see illus­tra­tion) than with a Marpurg tun­ing (see illus­tra­tion). The dif­fer­ence may lie in the choice of the most con­ve­nient ratios for minor thirds.

Is this method reliable?

As the results shown in the 4 tables for each book (see above) sug­gest, some pre­ludes and fugues ranked sev­er­al tun­ing schemes as their favourite: num­ber '1' is coloured red in the 'all results' tables. However, we only record­ed one of the win­ners. What does this mean?

Take for exam­ple Prelude 12 of book I. In the "alter­nate" set­tings, five scales are ranked first: Emin, Cmaj, BACH, d_alembert_rousseau, bethisy. We have already shown that BACH and d_alembert_rousseau are almost iden­ti­cal despite the dif­fer­ences in their tun­ing pro­ce­dures. Emin and Cmaj are exact­ly the same. This leaves us with the fol­low­ing choice:

Three scales rank­ing 1st for Prelude 12 of book 1 as per "alter­nate" settings

Tonal posi­tions dif­fer by a only few cents, which may not be notice­able in melod­ic and har­mon­ic inter­vals. Below are record­ings using these three scales:

Prelude 12 of book I, Emin tun­ing scheme
Prelude 12 of book I, Bethisy temperament
Prelude 12 of book I, Kellner's BACH temperament

This exam­ple sug­gests that if the widths of accept­able melod­ic and har­mon­ic inter­vals have been set small enough to pro­vide a well-focused solu­tion set, dif­fer­ences in the first-ranked scales may be inaudible.

Listen to minor thirds

Judging the sizes of the com­mon minor thirds by ear may make it eas­i­er to decide which is more "con­so­nant". Lucky users of the Bol Processor BP3 only need to cre­ate the fol­low­ing data file:

-to.tryTunings

// Harmonic minor third
_scale(2_cycles_of_fifths,0) DO3 RE#3 DO3 RE#3 DO3 RE#3 {4,DO3,RE#3}

//Pythagorean minor third
_scale(2_cycles_of_fifths,0) DO3 MIb=RE#-c3 DO3 MIb=RE#-c3 DO3 MIb=RE#-c3 {4,DO3,MIb=RE#-c3}

// Sequence harmonic then pythagorean
_scale(2_cycles_of_fifths,0) DO3 RE#3 DO3 MIb=RE#-c3 DO3 RE#3 DO3 MIb=RE#-c3 -{2,DO3,RE#3} {2,DO3,MIb=RE#-c3} {2,DO3,RE#3} {2,DO3,MIb=RE#-c3} {2,DO3,RE#3} {2,DO3,MIb=RE#-c3}

These items pro­duce sequences of 'C' - 'D#' melod­ic and har­mon­ic inter­vals using har­mon­ic (6/5) and Pythagorean (32/27) minor thirds:

Harmonic minor thirds in sequence then superposed
Pythagorean minor thirds in sequence then superposed
Alternance of har­mon­ic then Pythagorean minor thirds

Listening to these exam­ples sug­gests that both 6/5 and 32/27 are suit­able ratios for minor thirds as "con­so­nant" melod­ic inter­vals, while 6/5 sounds "soft­er" than 32/27 as a har­mon­ic interval.

The "2_cycles_of_fifths" scale

This demo uses the scale "2_cycles_of_fifths" described by Asselin (2000, p. 62) and imple­ment­ed on a Scale page of the Bol Processor — see pages Microtonality and Just into­na­tion: a gen­er­al frame­work.

The names of the notes (inspired by the book, ibid.) sound bizarre but they make the posi­tions explic­it. For exam­ple, "Mib=RE#-c" indi­cates a posi­tion that is usu­al­ly called mi bémol (E flat), which is iden­ti­cal to ré dièse (D sharp) minus one comma.

This scale — and the even more com­pli­cat­ed "3_cycles_of_fifths" — is not prac­ti­cal for writ­ing music… It is used to visu­alise (and hear) tonal posi­tions pro­duced by dif­fer­ent tun­ing schemes that con­form to the just into­na­tion paradigm.

Listen to tempered fifths

Readers unfa­mil­iar with tun­ing pro­ce­dures may need to appre­ci­ate the tiny dif­fer­ences in inter­vals pro­duced by tem­pera­ments cre­at­ed using the meth­ods intro­duced on the Microtonality page and described in detail in Asselin (2000).

Let us lis­ten to Pythagorean fifths in three forms: pure (fre­quen­cy ratio 3/2 = 702 cents), equal-tempered (700 cents), dimin­ished by 1/5 com­ma (697.3 cents) and dimin­ished by 1/4 com­ma (696.2 cents).

Pure fifth (702 cents)
Equal-tempered fifth (700 cents)
Fifth dimin­ished by 1/5 com­ma (697.3 cents)
Fifth dimin­ished by 1/4 com­ma (696.2 cents)
Sequence of fifths: pure, then equal-tempered, then dimin­ished by 1/5 com­ma, then dimin­ished by 1/4 comma

Below is the Csound score of the last example:

i1 0.000 4.000 261.630 90.000 90.000 0.000 0.000 0.000 0.000 ; do4
i1 0.000 4.000 392.445 90.000 90.000 0.000 0.000 0.000 0.000 ; sol4
i1 4.000 4.000 261.626 90.000 90.000 0.000 0.000 0.000 0.000 ; C4
i1 4.000 4.000 391.996 90.000 90.000 0.000 0.000 0.000 0.000 ; G4
i1 8.000 4.000 261.630 90.000 90.000 0.000 0.000 0.000 0.000 ; do4
i1 8.000 4.000 391.399 90.000 90.000 0.000 0.000 0.000 0.000 ; sol-1|5c4
i1 12.000 4.000 261.630 90.000 90.000 0.000 0.000 0.000 0.000 ; do4
i1 12.000 4.000 391.137 90.000 90.000 0.000 0.000 0.000 0.000 ; sol-1|4c4

Goldberg Variations

The same exer­cise was attempt­ed with J.S. Bach's Goldberg Variations (1741). The aria and its thir­ty vari­a­tions were per­formed in a sin­gle sequence, appar­ent­ly with the same instrument/tuning. For this rea­son, we checked a unique MusicXML score con­tain­ing all the variations.

With the "stan­dard" hypoth­e­sis of con­so­nance, the result is as follows:

(As expect­ed) Sauveur's mean­tone tem­pera­ment won the game, fol­lowed by Kellner's BACH. The equal-tempered scale came 28th in this clas­si­fi­ca­tion… (Note that the cal­cu­la­tion of this table took 3 1/2 hours on an old MacBook Pro…).

Listen to the syn­the­sis of the Goldberg Variations with Sauveur's mean­tone temperament:

The "alter­na­tive" mod­el of con­so­nance gives the fol­low­ing classification:

Favourite tun­ing schemes, accord­ing to this mod­el, would be D'Alembert-Rousseau (see pic­ture) and Kellner's BACH (see pic­ture) mean­tone tem­pera­ments, both of which have equal val­ue because their tonal inter­vals are almost identical.

Listen to the syn­the­sis of the Goldberg Variations with the D'Alembert-Rousseau temperament:

Source: Wikipedia

These pre­ferred tun­ings are the same as those best suit­ed to the set of pre­ludes and fugues in The Well-Tempered Clavier.

These sound exam­ples can be com­pared to human per­for­mance, for exam­ple the Aria on a harp­si­chord tuned to the Werckmeister III mean­tone tem­pera­ment — lis­ten to this record­ing. In fact, the musi­cians show a more flex­i­ble tim­ing than the Bol Processor, which sticks to the para­me­ters of the MusicXML score. Nevertheless, a com­par­i­son focus­ing on tonal inter­vals remains possible.

The fact that Werckmeister III (see image) ranked low in the auto­mat­ic tonal analy­sis does not indi­cate a wrong choice. This tun­ing scheme may per­form bet­ter against a par­tic­u­lar mod­el of "con­so­nance".

Let us use cal­cu­la­tions to work out its main dif­fer­ence from D'Alembert-Rousseau and Kellner's BACH. We can lim­it the analy­sis to bars #1 to #32 (the Aria), which expos­es most of the melodic/harmonic inter­vals; this Aria func­tions sim­i­lar­ly to the open­ing sec­tion (ālāp) in North Indian clas­si­cal music… We notice that nei­ther D - F# (397 cents) nor G - B (398 cents) in Werckmeister III are exact har­mon­ic major thirds (390 cents), inter­vals with a high fre­quen­cy as shown in the table of inter­val frequencies:

Interval fre­quen­cies in the Aria of Goldberg Variations

Below is a com­par­i­son of the Werckmeister III and D'Alembert-Rousseau scales in terms of match­ing melod­ic inter­vals (in the "alter­nate" mod­el of con­so­nance) over the first 32 bars of the Goldberg Variations:

Matching two scales with the melod­ic inter­vals of the Aria in Goldberg Variations:
Werckmeister III (left) and D'Alembert-Rousseau (right)

The width of the yel­low lines is pro­por­tion­al to the occurrence/duration of melod­ic inter­vals in this part of the cor­pus. The pic­ture con­firms the absence of an exact har­mon­ic major third D - F# in the Werckmeister III scale, and the same mis­match of the major third G - B. Another mis­match is on the minor third E - G, here aim­ing at a ratio of 6/5 (315 cents) or 32/27 (294 cents).

Sources of MusicXML scores

Links point to MusicXML scores used in this analy­sis. These links must be cit­ed in the attri­bu­tion part of Creative Commons licences. Updated ver­sions are welcome.

Our thanks to the edi­tors of these scores in the MuseScore community!

The (pub­lic domain) score of the Goldberg Variations has been edit­ed by MuseScore lead devel­op­er Werner Schweer.

Book I sources

1BWV 846CmajPreludeFugue
2BWV 847CminPreludeFugue
3BWV 848C#majPreludeFugue
4BWV 849C#minPreludeFugue
5BWV 850DmajPreludeFugue
6BWV 851DminPreludeFugue
7BWV 852E♭majPreludeFugue
8BWV 853E♭min/D#minPreludeFugue
9BWV 854EmajPreludeFugue
10BWV 855EminPreludeFugue
11BWV 856FmajPreludeFugue
12BWV 857FminPreludeFugue
13BWV 858F#majPreludeFugue
14BWV 859F#minPreludeFugue
15BWV 860GmajPreludeFugue
16BWV 861GminPreludeFugue
17BWV 862A♭majPreludeFugue
18BWV 863G#minPreludeFugue
19BWV 864AmajPreludeFugue
20BWV 865AminPreludeFugue
21BWV 866B♭majPreludeFugue
22BWV 867B♭minPreludeFugue
23BWV 868BmajPreludeFugue
24BWV 869BminPreludeFugue

Book II sources

1BWV 870CmajPreludeFugue
2BWV 871CminPreludeFugue
3BWV 872C#majPreludeFugue
4BWV 873C#minPreludeFugue
5BWV 874DmajPreludeFugue
6BWV 875DminPreludeFugue
7BWV 876E♭majPreludeFugue
8BWV 877D#minPreludeFugue
9BWV 878EmajPreludeFugue
10BWV 879EminPreludeFugue
11BWV 880FmajPreludeFugue
12BWV 881FminPreludeFugue
13BWV 882F#majPreludeFugue
14BWV 883F#minPreludeFugue
15BWV 884GmajPreludeFugue
16BWV 885GminPreludeFugue
17BWV 886A♭majPreludeFugue
18BWV 887G#minPreludeFugue
19BWV 888AmajPreludeFugue
20BWV 889AminPreludeFugue
21BWV 890B♭majPreludeFugue
22BWV 891B♭minPreludeFugue
23BWV 892BmajPreludeFugue
24BWV 893BminPreludeFugue

Reference(s)

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

Tonal analysis of musical works

Musical works encod­ed in the Bol Processor (using "sim­ple notes" accord­ing to English, Italian/Spanish/French and Indian con­ven­tions) can be analysed in terms of har­mon­ic or melod­ic intervals.

The musi­cal aspects are dis­cussed after a descrip­tion of the process.

In the final sec­tion, we present a one-click method for eval­u­at­ing the suit­abil­i­ty of all doc­u­ment­ed tun­ing sys­tems for a giv­en piece of music. A demo of this analy­sis can be found on the Bach well-tempered tonal analy­sis.

Basic process

This cal­cu­la­tion is start­ed by press­ing the ANALYZE INTERVALS but­ton at the bot­tom of the 'Data' window:

The machine found a '-to.tryTunigs' dec­la­ra­tion at the top of the data con­tent, indi­cat­ing that it should pick up the scale def­i­n­i­tions con­tained in this tonal­i­ty resource. These def­i­n­i­tions are only acces­si­ble if '-to.tryTunigs' was opened less than 24 hours ago: these files are stored in the 'temp_bolprocessor' fold­er which is auto­mat­i­cal­ly cleaned up of old stor­age. Click on the 'open' link if necessary.

The ana­lyt­i­cal process is demon­strat­ed using a sin­gle phrase of François Couperin's Les Ombres Errantes import­ed from a MusicXML score — see the Importing MusicXML scores page. This exam­ple is small enough to allow a visu­al check of the tech­ni­cal process, but too short to allow a mean­ing­ful musi­cal inter­pre­ta­tion of the result.

In Bol Processor nota­tion (English con­ven­tion), the musi­cal item reads as fol­lows — read the Polymetric struc­tures page:

-to.tryTunings

_scale(rameau_en_sib,0)
_rndtime(20) {_tempo(13/15) _vel(64){3, _legato(20) C5 _legato(0) {1/4,C5 B4 C5}{3/4,B4} _legato(20) Eb5,{1/2,Eb4}{5/2,G4 D4 F4 C4 Eb4},Eb4 D4 C4}} {_tempo(13/15) _vel(64){4, _legato(0) {1/4,Eb5 D5 Eb5}{3/4,D5} _legato(20) C5 _legato(0) {1/4,C5 B4 C5}{3/4,B4}{1/8,C5 B4}{7/8,C5},{4,B3 F4 Eb4 G4 D4 F4 C4 Eb4},B3 Eb4 D4 C4}}

Beginning of "Les Ombres Errantes"
Scale "Rameau en sib" (see full image)

The sound pro­duc­tion used the tonal­i­ty resource file '-to.tryTunings' which con­tains the tonal scale 'rameau_en_sib' — see the page Comparing tem­pera­ments. This scale prob­a­bly pro­vides the best tun­ing for this piece when played on a "harpsichord-like" Csound instrument.

The machine has picked up a def­i­n­i­tion of the tonal scale in a tem­po­rary copy of '-to.tryTunings'. The essen­tial con­tent of this def­i­n­i­tion is the set of tonal posi­tions in the scale shown in the image — see the Microtonality page.

Click on the ANALYZE INTERVALS but­ton and the fol­low­ing screen appears:

Analysis of melod­ic and har­mon­ic inter­vals in a short frag­ment of "Les Ombres errantes"

The table above gives a sum­ma­ry of match­ing inter­vals: pairs of notes played one after the oth­er (melod­ic) or one above the oth­er (har­mon­ic), dis­tin­guish­ing between ascend­ing and descend­ing melod­ic inter­vals. These match­es can be checked in the graph­i­cal rep­re­sen­ta­tion of this item:

Intervals are list­ed in descend­ing order of impor­tance. For exam­ple, the melod­ic inter­val 'C' to 'B' occurs in 20.3 beats, the high­est num­ber. Ascending melod­ic inter­vals 'B' to 'F' and 'D' to 'B' are the least fre­quent. Values less than 5% of the max­i­mum in the col­umn are ignored in the graph­i­cal display.

Harmonic (left) and melod­ic (right) intervals

Interestingly, the high­est scores of har­mon­ic inter­vals in this musi­cal phrase are minor thirds such as 'D'/'B' and 'C'/'Eb'. The fifth 'C'/'G' is scored only 1.6 beats, which is 18% of the high­est score.

The detec­tion of a "har­mon­ic inter­val" is based on the com­par­i­son of its start and end dates with options that can be mod­i­fied. Let $start1, $end1, $start2 and $end2 be the tim­ings of two notes. We assume $start2 >= $start1 due to a pre­lim­i­nary chrono­log­i­cal sort­ing of the list of notes. The matching_intervals() func­tion does the fol­low­ing to eval­u­ate har­mon­ic intervals:

$duration1 = $end1 - $start1;
$duration2 = $end2 - $start2;
$overlap = $end1 - $start2;
$smallest_duration = $duration1;
if($duration2 < $duration1) $smallest_duration = $duration2;


if($smallest_duration < $min_dur) return FALSE;
if($start1 + ($duration1 / 2.) < $start2) return FALSE;
if($overlap < ((1 - $ratio) * $smallest_duration)) return FALSE;
return TRUE;

This func­tion elim­i­nates brief over­laps of time inter­vals, such as those cre­at­ed by slurs inter­pret­ed as _legato() per­for­mance con­trols when import­ing MusicXML scores — see details. It also elim­i­nates notes with dura­tions less than $min_dur, option­al­ly set to 500 mil­lisec­onds. For exam­ple, short notes such as 'C5', 'B4', 'Eb5', etc., are dis­card­ed. Finally, it checks that $overlap is greater than a frac­tion of the small­est dura­tion, with $ratio set to 0.25 by default. Another option, not shown here, is the max­i­mum tonal dis­tance between two notes, which is set to 11 semi­tones by default.

The con­di­tions for match­ing melod­ic inter­vals are similar:

if($start2 > ($end1 + $max_gap)) return FALSE;
if($start1 + ($duration1 / 2.) >= $start2) return FALSE;
if($overlap >= ($ratio * $smallest_duration)) return FALSE;
return TRUE;

The $max_gap para­me­ter (typ­i­cal­ly 300 mil­lisec­onds) is the max­i­mum delay between the end of the first note and the begin­ning of the next one.

All para­me­ters can be changed before the process is restart­ed. These set­tings are dis­cussed later:

Default set­tings for tonal analysis

Calculations

Detailed tonal analysis

To check the sequence of time inter­vals in great detail it is pos­si­ble to acti­vate the "Display all dates" option yield­ing a detailed analysis.

All match­ing inter­vals will be list­ed. It is not prac­ti­cal to use this option on large pieces of music…

Dates are in sec­onds, round­ed to 0.1s, although more accu­rate val­ues are used. In fact, all time cal­cu­la­tions are based on whole num­bers, as in the Bol Processor console.

The result is always debat­able. For exam­ple, some melod­ic or har­mon­ic inter­vals may appear "acci­den­tal" rather than significant.

For this and oth­er rea­sons, it may be nec­es­sary to explore oth­er options relat­ed to musi­cal and per­for­mance styles.

Graphic display

Melodic and har­mon­ic tonal inter­vals are dis­played against the back­ground of the tonal scale used for the per­for­mance. Here it would be 'rameau_en_sib', although by default an equal-tempered scale is used.

Clicking on the links to the har­mon­ic inter­val pic­tures (see image above) will bring up the fol­low­ing three graphs — in sep­a­rate and resiz­able windows:

Display of har­mon­ic inter­vals. The 'rameau_en_sib' scale is in the middle.

Intervals are shown as gold high­lights with widths pro­por­tion­al to their rel­a­tive val­ues. In the left-hand image, these gold­en seg­ments are drawn behind the fifths, major and minor thirds marked on the scale. For this rea­son, the yel­low high­light­ing of the link between Eb and G, behind the green link of a har­mon­ic major third, is less vis­i­ble in the full image.

Minor thirds (ratio 6/5) have been added to the set­tings. For this rea­son, those avail­able in this scale are shown as black seg­ments. These addi­tion­al ratios are list­ed at the top right of each image.

Restricted analysis

If a MusicXML file has been import­ed along with bar num­bers (notat­ed [—1—], [—2—] etc.), these can be used to restrict the analy­sis to a sub­set of the score.

Below is the set­ting of bars #1 to #32 (the Aria) in J.S. Bach's Goldberg Variations:

Restricting the tonal analy­sis to the Aria in the Goldberg Variations makes sense because oth­er vari­a­tions, due to their high speed, do not show har­mon­ic inter­vals longer than the min­i­mum dura­tion fixed in the set­tings (500 ms).

Musicological discussion

Tonal analy­sis with the Bol Processor aims to help choose the most appro­pri­ate tun­ing sys­tem for a piece of music — a tem­pera­ment as defined by Baroque musi­cians. This top­ic is cov­ered on the page Comparing tem­pera­ments.

We first describe a visu­al method for esti­mat­ing (rather than mea­sur­ing) the ade­qua­cy of a tun­ing sys­tem for the per­for­mance of musi­cal works import­ed from MusicXML scores — read the page on this top­ic. In the next sec­tion, we will show how to auto­mat­i­cal­ly com­pare all can­di­date scales, tak­ing into account the rel­e­vant para­me­ters revealed in this section.

Take, for exam­ple, J.S. Bach's Prelude 1 in C major for which some his­tor­i­cal infor­ma­tion (report­ed by Asselin, 2000 p. 142) sug­gests the choice of a Kirnberger tem­pera­ment. Which one?

Harmonic tonal inter­vals of Bach's 1st pre­lude ver­sus Kirnberger II and Kirnberger III tun­ing systems

The full rep­re­sen­ta­tion of the har­mon­ic inter­vals is shown above and com­pared with two dif­fer­ent scales described by Kirnberger (Asselin, 2000 p. 90, 93). The match looks bet­ter on the right (Kirnberger III). For exam­ple, the inter­val 'D' - 'A' is clos­er to a "pure" fifth (702 cents) on Kirnberger III (697) than on Kirnberger II (691). Another sig­nif­i­cant match is the har­mon­ic major third 'F' - 'A'. Other inter­vals are sim­i­lar in terms of these scales.

A care­ful lis­ten­ing to both ver­sions might con­firm this mechan­i­cal analysis:

Kirnberger II
Kirnberger III

For François Couperin's Les Ombres Errantes, the same crude analy­sis yields no sig­nif­i­cant result. Harmonic inter­val analy­sis may be less rel­e­vant because this piece is more gen­er­al­ly per­ceived as a sequence of melod­ic inter­vals, includ­ing minor thirds and major sec­onds. This can be seen in the graph of melod­ic intervals:

Melodic inter­vals of "Les Ombres Errantes" (full performance)

Comparing this graph with the 'rameau_en_sib' scale does not reveal any inter­est­ing pat­terns, for the sim­ple rea­son that nei­ther minor thirds nor major sec­onds have been tak­en into account in this scale in terms of "just into­na­tion" — see page Just into­na­tion: a gen­er­al frame­work. Although we can assume that a Pythagorean major sec­ond (ratio 9/8) sounds more "con­so­nant" than a har­mon­ic one (ratio 10/9), there is no rea­son to sys­tem­at­i­cal­ly claim that the har­mon­ic minor third (ratio 6/5) is "bet­ter" than the Pythagorean one (ratio 32/27).

The pic­ture on the left shows that the fre­quent melod­ic inter­vals of major thirds empha­sise the har­mon­ic major thirds (ratio 5/4) of this scale.

We need to check inter­vals small­er than the major third in the tonal scales. If we tell the machine to check inter­vals close (with­in ± 10 cents) to the har­mon­ic minor third (ratio 6/5), the above graphs will look like this:

Melodic inter­vals of "Les Ombres Errantes" (full per­for­mance) with black mark­ings of "good" minor thirds (6/5) on a ‘rameau_en_sib’ temperament

The pic­ture on the left side shows that all the minor thirds used in this per­for­mance coin­cide with­in ± 10 cents with the har­mon­ic minor thirds (ratio 6/5) of the scale, which is an incen­tive to admit that the 'rameau_en_sib' scale would be a fair (per­haps the best) tun­ing option for Les Ombres Errantes.

A counter-example is the match­ing of Les Ombres Errantes with a pure-minor-thirds tem­pera­ment designed dur­ing in 16th cen­tu­ry (Asselin 2000 p. 82, see fig­ure). Below are the graphs of the match­ing melod­ic (left) and har­mon­ic (right) inter­vals, with black lines mark­ing the har­mon­ic minor thirds (ratio 6/5):

Melodic (left) and har­mon­ic (right) inter­vals of "Les Ombres Errantes" against a pure-minor-thirds temperament
"Les Ombres Errantes" with a pure minor thirds tem­pera­ment (16th century)

The main draw­back of this 'pure_minor_thirds' tem­pera­ment is the very low posi­tion of 'Ab' which is sup­posed to pro­duce a con­so­nant sequence of minor thirds: 'Ab' - 'B' - 'D' - 'F'. However, 'Ab' - 'B' is not a melod­ic inter­val found in this piece, nor are 'Db' - 'E' and 'E' - 'G', which are well rep­re­sent­ed by the 'pure_minor_thirds' tem­pera­ment. There are also dis­crep­an­cies in the har­mon­ic inter­vals, which are easy to hear. We can con­clude that the pure minor thirds tem­pera­ment is nei­ther the best nor the worst tun­ing sys­tem for this musi­cal work, although the com­par­i­son of sound pro­duc­tions sug­gests that it is sig­nif­i­cant­ly less good than the 'rameau_en_sib' scale.

Comparing graphs is easy with the detached resiz­able pic­tures pro­duced by the Bol Processor.

A "deaf musicologist's" approach

The analy­sis shown so far has replaced a com­par­i­son of sound ren­der­ing — see the page Comparing tem­pera­ments — with a visu­al prob­lem of pattern-matching. We have shown that Baroque musi­cians and tuners sought to achieve con­so­nance in terms of sim­ple fre­quen­cy ratios for fifths (close to 3/2) and har­mon­ic major thirds (close to 5/4). This approach and its under­ly­ing assump­tions are dis­cussed on the page Just into­na­tion: a gen­er­al frame­work.

Furthermore, one might be tempt­ed to claim that a "just into­na­tion" minor third should be har­mon­ic (ratio close to 6/5), but the deci­sion should remain open. To this end, it is pos­si­ble to enter an addi­tion­al set of melod­ic and har­mon­ic inter­vals that the ana­lyst con­sid­ers sig­nif­i­cant for the eval­u­a­tion of tonal scales. Each inter­val is defined by an inte­ger ratio — which can be as com­plex as necessary.

Comparative pat­tern match­ing assigns a numer­i­cal score to each scale that has been eval­u­at­ed for its fit with the musi­cal work. This allows the can­di­date scales to be sort­ed. However, two sep­a­rate scores are required, one for melod­ic inter­vals and one for har­mon­ic inter­vals. A weight­ed sum of scores is there­fore used to sort the list of scales.

This method has been imple­ment­ed in the Tonal analy­sis process. We have com­pared all the scales defined in '-to.tryTunings' — includ­ing in par­tic­u­lar all the tem­pera­ments doc­u­ment­ed by Pierre-Yves Asselin — in terms of their suit­abil­i­ty for the ren­der­ing of melod­ic and tonal inter­vals in François Couperin's Les Ombres Errantes:

Matching scales for "Les Ombres Errantes"

Great result! The machine con­firms that the scale 'rameau_en_sib' is the best can­di­date for the inter­pre­ta­tion of Les Ombres Errantes. Its scores are sig­nif­i­cant­ly bet­ter for both melod­ic and har­mon­ic inter­vals. (A total of 45 tun­ing schemes were tried.)

By default, the eval­u­a­tion of melod­ic and har­mon­ic inter­vals con­sid­ers only per­fect fifths (3/2) and har­mon­ic major thirds (5/4) as "good" inter­vals, with weights of 2 and 1 respec­tive­ly, and wolf fifths (40/27), wolf fourths (320/243) and Pythagorean major thirds (81/64) as "bad" inter­vals, with weights of -2, -2 and -1 respec­tive­ly. All these weights can be mod­i­fied as shown in the image above.

We repeat the com­par­i­son with the addi­tion­al option of har­mon­ic minor thirds (6/5) as melod­ic intervals:

Matching scales, includ­ing har­mon­ic minor thirds (ratio close to 6/5) for melod­ic intervals

As expect­ed, all the melod­ic val­ues increased, but the win­ner remained. If we add the Pythagorean major sec­ond (ratio close to 9/8), we get the following:

Matching scales, includ­ing ratios 6/5 and 9/8 for melod­ic intervals

The 'rameau_en_sib' scale is now chal­lenged by 'sauveur' for melod­ic inter­vals, but its har­mon­ic score remains higher.

Note that scales Abmaj and Cmin are iden­ti­cal, which explains their equal scores.

A visu­al com­par­i­son of scales with melod­ic inter­val mark­ings shows that there is lit­tle dif­fer­ence between these tem­pera­ments in terms of the per­for­mance of Les Ombres Errantes. Since the 'sauveur' tem­pera­ment was designed in 1701 by the (hearing-impaired?) French math­e­mati­cian Joseph Sauveur, it is not unlike­ly that it was used for the com­po­si­tion of Les Ombres Errantes in 1730.

Comparison of 'rameau_en_sib' and 'sauveur' tem­pera­ments for melod­ic inter­vals in "Les Ombres Errantes", with addi­tion­al ratios 6/5 and 9/8 dis­played as black lines.

The scale 'rameau_en_sib' again scores as good as 'sauveur' when the Pythagorean minor third (ratio close to 32/27) is tried as a melod­ic inter­val (both ascend­ing and descend­ing) in place of the ratio 6/5… This is due to the use of 'F' - 'Ab', which is ren­dered as a Pythagorean minor third by 'rameau_en_sib', but not by 'sauveur'.

Many more checks can be made by chang­ing the weights assigned to the occur­rences of melod­ic and har­mon­ic ratios. Finding the best set­tings requires a thor­ough study of the musi­cal score — this is where human musi­col­o­gists come in!

Ears (plus expert knowl­edge of the score) could make the final decision:

"Les Ombres Errantes", Rameau en sib temperament
"Les Ombres Errantes", Sauveur temperament

The ana­lyt­i­cal process we are fol­low­ing is a kind of reverse engi­neer­ing… Obviously, com­posers did not search for a suit­able tem­pera­ment after cre­at­ing a musi­cal work. It is more real­is­tic to assume that they com­posed works on exist­ing instru­ments, with the effect that sets of pieces pro­duced by the same com­pos­er (using the same instru­ment) at a giv­en time obeyed implic­it melod­ic and har­mon­ic con­straints that best suit­ed the tun­ing of their instrument(s).

Comparative study

Let us look again at J.S. Bach's Prelude 1 in C major, for which Kirnberger III was cho­sen (visu­al­ly) as a bet­ter match than Kirnberger II. Including the ratios 6/5 and 9/8 as pos­si­ble melod­ic up/down inter­vals, and 6/5 as a har­mon­ic inter­val, the fol­low­ing clas­si­fi­ca­tion of tun­ing schemes emerges:

Classification of scales for the inter­pre­ta­tion of J.S. Bach's Prelude 1 in C major

The win­ner is undoubt­ed­ly 'sauveur' although the har­mon­ic score is iden­ti­cal for six tem­pera­ments, but 'kirnberger_3' scores much lower.

Note that this was achieved by declar­ing ratios close to 6/5 as pos­si­ble con­so­nant melod­ic and har­mon­ic inter­vals. For a dis­cus­sion of this hypoth­e­sis, see Bach well-tempered tonal analy­sis for a dis­cus­sion of this hypothesis.

Sauveur's tem­pera­ment is the best suit­ed because of its high pro­fi­cien­cy in har­mon­ic minor thirds (6/5) and Pythagorean major sec­onds (9/8). It also has a com­plete set of per­fect fourths and fifths (3/2) except for the wolf fourth 'D#' - 'G#', which is almost 477 cents (instead of 498). Fortunately, this inter­val is nev­er used in Bach's piece:

Matching the melod­ic inter­vals of J.S. Bach's Prelude 1 in C major with Sauveur's temperament
J.S. Bach's Prelude 1 in C major played by the Bol Processor + Csound with Sauveur's temperament

This ren­der­ing can be com­pared (in terms of tune­ful­ness) with a human per­for­mance on a real harpsichord:

J.S. Bach's Prelude 1 in C major played on the copy of an instru­ment built by Hans Moerman in Antwerpen (1584). Source: Wikipedia licence CC BY-SA.

Unsurprisingly, J.S. Bach's Fugue 1 in C major shares the same pref­er­ence for 'sauveur', with oth­er tun­ing schemes fol­low­ing in a dif­fer­ent order. All of the fugues in this series of works (books I and II) are asso­ci­at­ed with pre­ludes in the same key.

The tonal analy­sis of J.S. Bach's Prelude 2 in C minor again selects 'sauveur' using the same eval­u­a­tion cri­te­ria — includ­ing the ratios 6/5 (melod­ic and har­mon­ic) and 9/8 (melod­ic up/down). The scor­ing is com­plete­ly dif­fer­ent, but the win­ner is unchanged, although it is chal­lenged by 'rameau_en_sib' for its har­mon­ic score.

J.S. Bach's Prelude 2 in C minor played by the Bol Processor + Csound with Sauveur's temperament

Note that the Cmin scale has a bad rate because of the melod­ic inter­vals. It beats Sauveur's tem­pera­ment in terms of har­mon­ic inter­vals, but these are rel­a­tive­ly rare in this pre­lude. This clas­si­fi­ca­tion could be quite dif­fer­ent if some ratios (such as 9/8) were ignored for the eval­u­a­tion of melod­ic inter­vals. Even ratios close to Pythagorean thirds (81/64) may sound accept­able in fast melod­ic move­ments — see the page on Bach well-tempered tonal analy­sis.

J.S. Bach's Fugue 2 in C minor again favours 'sauveur'.

We get the same result with J.S. Bach's Prelude 6 in D minor (ran­dom choice). Note the strik­ing­ly high melod­ic scores of 'sauveur':

J.S. Bach's Prelude 6 in D minor played by theBol Processor + Csound with Sauveur's temperament

J.S. Bach once claimed that he could play his entire reper­toire on the instru­ment he had tuned by him­self. This sounds like squar­ing the cir­cle, and many hypothe­ses have been put for­ward to solve this prob­lem for das Wohltemperierte Clavier.

These exam­ples sug­gest that Sauveur's tem­pera­ment may have been Bach's choice. Although there is lit­tle chance that the German com­pos­er (1685-1750) would have heard of the research work of the French physi­cian (1653-1716), the sys­tem­at­ic con­struc­tion of this tem­pera­ment — a sin­gle sequence of fifths dimin­ished by 1/5 com­ma (see image and read Asselin, 2000 p. 80) — sug­gests that any com­pos­er could have worked it out independently.

To test (and chal­lenge) this hypoth­e­sis, we have under­tak­en a tonal analy­sis of 24 pre­ludes and fugues from books I and II of The Well-Tempered Clavier using the same set­tings. Read the Bach Well-tempered tonal analy­sis page. This large spec­trum analy­sis requires a batch pro­cess­ing device, which we will now describe.

Batch processing

To analyse the tonal­i­ty of a large num­ber of musi­cal works, we need to cre­ate a Data page con­tain­ing the names of all the pages con­tain­ing the Bol Processor scores of these items. For exam­ple, the page “-da.index_preludes_book_I” is as follows:

// All Bach preludes

-se.Bach_preludes
-to.tryTunings

-da.Bach_1st_prelude
-da.Bach_2nd_prelude
-da.Bach_3d_prelude
-da.Bach_4th_prelude
-da.Bach_5th_prelude
-da.Bach_6th_prelude
-da.Bach_7th_prelude
-da.Bach_8th_prelude
-da.Bach_9th_prelude
-da.Bach_10th_prelude
-da.Bach_11th_prelude
-da.Bach_12th_prelude
-da.Bach_13th_prelude
-da.Bach_14th_prelude
-da.Bach_15th_prelude
-da.Bach_16th_prelude
-da.Bach_17th_prelude
-da.Bach_18th_prelude
-da.Bach_19th_prelude
-da.Bach_20th_prelude
-da.Bach_21st_prelude
-da.Bach_22nd_prelude
-da.Bach_23d_prelude
-da.Bach_24th_prelude

When read­ing this page, the Tonal analy­sis pro­ce­dure opens each data file and picks up the Bol Processor score it con­tains. To facil­i­tate this, the Batch pro­cess­ing option can be checked in the settings.

In the batch-processing mode, the machine will not dis­play the full set of scales for each piece of music analysed. If the score con­tains a spec­i­fi­ca­tion for a tonal scale — a _scale(some_scale, 0) instruc­tion — the list of pre­ferred scales will be dis­played down to the spec­i­fied one. If the spec­i­fied scale is the first in the rank­ing, then the next two fol­low­ing scales are list­ed. If no scale is giv­en, only the 10 best match­ing scales are listed:

Batch pro­cess­ing of “-da.index_preludes_book_I
Items #2 and #3 con­tain the spec­i­fi­ca­tions of tonal scales sauveur and Dbmaj respec­tive­ly.
This pref­er­ence is con­firmed by the analy­sis of item #2 but it is not the case with item #3.

At the bot­tom of the page, a SHOW RESULTS but­ton dis­plays a down­load­able HTML file con­tain­ing all the results:

End of batch pro­cess­ing. Clicking on SHOW RESULTS dis­plays the entire result set.

The HTML page also shows the set­tings for the analy­sis, and can be down­loaded, along with a CVS file of the same fig­ures, which is suit­able for sta­tis­ti­cal graphing.

The results of the analy­sis of all the pre­ludes and fugues of The Well-tempered Clavier are pub­lished and dis­cussed on the page Bach well-tempered tonal analy­sis.

Does it apply to western classical music?

The analy­sis of tonal inter­vals and their cor­re­spon­dence to doc­u­ment­ed tun­ing sys­tems (tem­pera­ments) makes sense in the con­text of Baroque music, assum­ing that com­posers and instru­ment tuners sought to achieve max­i­mum con­so­nance in the per­for­mance of their musi­cal reper­toire. The ques­tion remains whether it is equal­ly reli­able (and use­ful) for the analy­sis of musi­cal works from more recent periods.

Matching Beethoven’s Fugue in B flat major against doc­u­ment­ed scales

The best score — once again — is that of Sauveur's tem­pera­ment, main­ly because of the ascend­ing melod­ic inter­vals. If per­form­ers are try­ing to achieve ratios 9/8, 6/5, 5/4 and 3/2, then ‘sauveur’ may be the best rep­re­sen­ta­tion of the "tun­ing scheme" they have in mind.

The equal tem­pera­ment scale comes last, with scores of 3529, 1680 and 240 for ascend­ing melod­ic, descend­ing melod­ic and har­mon­ic inter­vals respec­tive­ly. Part of the expla­na­tion lies in the com­par­i­son of the two scales as a back­ground to the har­mon­ic intervals:

Comparison of the equal tem­pera­ment scale (left) and Sauveur's tem­pera­ment (right) for the per­for­mance of Beethoven's Fugue in B flat major.

The most obvi­ous dif­fer­ence is the use of almost per­fect har­mon­ic major thirds (ratio 5/4) on Sauveur's scale (see image) instead of Pythagorean major thirds (approx­i­mate­ly ratio 81/64) on the equal tem­pered scale (see image). The for­mer have been assigned weights (+1) and the lat­ter (-1). Yellow back­ground lines indi­cate that these inter­vals are used quite frequently.

Melodic inter­vals in Beethoven’s Fugue in B flat major

One draw­back of Sauveur's scale is the wolf fourth 'D#' - 'G#' (approx. 477 cents), but this inter­val does not occur fre­quent­ly in the score.

Many oth­er obser­va­tions could be made, com­par­ing the val­ues of the melod­ic inter­vals, and the whole process (which took almost 8 min­utes) could be start­ed again with dif­fer­ent set­tings of the weights, giv­ing more or less impor­tance to cer­tain inter­vals. After all, we do not know whether an expert play­er of a string instru­ment would play minor thirds at inter­vals of 6/5, 32/27, tem­pered, or some oth­er val­ue, and even more so, whether these val­ues depend on the harmonic/melodic con­text of each musi­cal phrase.

This sug­gests that we shouldn't get too excit­ed about a (still prim­i­tive) tonal analy­sis tool when it comes to sophis­ti­cat­ed tonal material…

Reference

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

Musicians inter­est­ed in con­tin­u­ing this research and relat­ed devel­op­ment can use the cur­rent ver­sion of Bol Processor BP3 to process musi­cal works and imple­ment fur­ther tun­ing pro­ce­dures. Follow the instruc­tions on the Bol Processor ‘BP3’ and its PHP inter­face page to install BP3 and learn its basic operation.

Time resolution and quantization

   

These para­me­ters are saved in '-se' set­tings files asso­ci­at­ed with gram­mars and data. They are expressed in milliseconds.

Time res­o­lu­tion is the min­i­mum dif­fer­ence of dates between two events sent to a MIDI device or writ­ten on a Csound score. By default is is set to 10 ms but in some cas­es it may be nec­es­sary to dimin­ish this val­ue. This is already a type of quan­ti­za­tion because sev­er­al events occur­ing with time off­sets low­er than the res­o­lu­tion will be sent or writ­ten with iden­ti­cal dates.

Time quan­ti­za­tion is an option allow­ing the poly­met­ric expan­sion algo­rithm to reduce the size of the phase dia­gram con­struct­ed to frame out the sym­bol­ic tim­ing of events — in fact, rela­tions of prece­dence or simul­tane­ity. Read page Complex ratios in poly­met­ric expres­sions for a detailed expla­na­tion. In brief, it is a method for sav­ing mem­o­ry space and speed­ing up the computation.

In many cas­es, the pro­duc­tion of a piece would sim­ply be impos­si­ble with a quan­ti­za­tion reduced to the time res­o­lu­tion. This is due to the fact that all Bol Processor time cal­cu­la­tions are per­formed with inte­ger ratios to reach the best accu­ra­cy com­pat­i­ble with lim­i­ta­tions of the machine. However, for instance, stor­ing two notes dis­tant by a few mil­lisec­onds requires two dis­tinct columns on the phase dia­gram although (in gen­er­al) this dif­fer­nce is not audible.

Even though it is pos­si­ble to set the time quan­ti­za­tion to a val­ue low­er than the time res­o­lu­tion, it would increase the size of the phase dia­gram (i.e. mem­o­ry and com­pu­ta­tion time) with no effect on the out­put because the time res­o­lu­tion is the low­est val­ue of the actu­al quan­ti­za­tion. This incon­sis­ten­cy is sig­naled on the Data or Grammar window:

👉  Be aware that using a very short quan­ti­za­tion (typ­i­cal­ly less than 10 ms) on a large item can increase mem­o­ry usage to the point where the MAMP or XAMPP dri­ver hangs with­out warning.

Randomisation of dates

The Bol Processor has a per­for­mance tool notat­ed "_rndtime(x)" for ran­dom­iz­ing the dates of events, in which 'x' is half the range in mil­lisec­onds. For instance, fol­low­ing "_rndtime(100)", all dates will be recal­cu­lat­ed with­in a ± 100 ms range.

Randomisation is often used by poor com­po­si­tion devices to "human­ize" computer-made pieces. This is a ridicu­lous approach based on the belief that human inter­preters must be will­ing­ly impre­cise in their per­for­mance… or that music is implic­it­ly a "fuzzy" construction.

The _rndtime tool may oth­er­wise be used to com­pen­sate unwant­ed effects when sev­er­al dig­i­tal­ly syn­the­sized sounds are super­posed, as explained on page Importing MusicXML scores. In this case, the range is very small and the val­ue of the time res­o­lu­tion may need to be adjust­ed accord­ing­ly. For instance, "_rndtime(20)" should be asso­ci­at­ed with a time res­o­lu­tion of 1 mil­lisec­ond so that 40 dif­fer­ent val­ues will be ran­dom­ly picked up in a ± 20 ms range. Note that this has no inci­dence on the time quan­ti­za­tion.

The effect of a ± 20 ms time ran­domi­sa­tion can be noticed by care­ful­ly lis­ten­ing to the fol­low­ing two examples:

Non-randomized begin­ning of “Les Ombres Errantes”
20 mil­lisec­ond ran­dom­ized begin­ning of “Les Ombres Errantes”

Flags in grammars

Flags can be used in gram­mars to activate/deactivate rules accord­ing to sim­ple numer­i­cal and log­i­cal evaluations.

Let us look at the ‘-gr.tryFlags’ gram­mar:

-al.abc
// First create string of ‘a’
gram#1[1] S --> X /Num_total = 20/
gram#1[2] /Num_total - 1/ X --> a X
--------
// Create flags counting 'a' and 'b'
gram#2[1] X --> lambda /Num_a = 20/ /Num_b = 0/
--------
// Now replace 'a' with 'b' until they are in equal numbers
gram#3[1] /Num_a > Num_b/ a --> b /Num_b + 1/ /Num_a - 1/

This gram­mar pro­duces a string of 20 ter­mi­nal sym­bols (Num_total) con­tain­ing an equal num­ber of (ran­dom­ly posi­tioned) 'a' and 'b'. For example:

b b a a a b a a b a b a b b b a b b a a

In a gram­mar rule, flags are enclosed in '/'. The first occur­rence of a flag usu­al­ly sets its ini­tial val­ue (an inte­ger num­ber), for exam­ple /Num_total = 20/.

Additive/subtractive oper­a­tions (on inte­gers) can then be per­formed to increase or decrease the val­ues of the flags, e.g. /Num_b + 1/ or /Num_a - 1/.

Flags that appear before the left argu­ment of a rule are eval­u­at­ed and used to con­trol the rule. For example,

/myflag/ X --> Y

will only be a can­di­date rule if 'myflag' is strict­ly pos­i­tive. This eval­u­a­tion can also be a check of the val­ues of two flags. For exam­ple, rule:

/flag1 > flag2/ /flag3 = flag2/ /flag4 = 50/ X --> Y

will only remain a can­di­date as long as the three con­di­tions are met.

This tech­nique can be com­bined with oth­er con­trol tech­niques, such as (positive/negative, proximate/remote, left/right) con­texts, rule weights etc. An exam­ple of the use of flags can be found in "-gr.trial.mohanam", com­bined with rule weights and pat­tern con­texts. Read the page Computing ‘ideas’.

Note that the oper­a­tors '≤', '≥' and '≠' are not yet accept­ed in the cur­rent ver­sion of BP3 as it does not han­dle multi-byte Unicode characters.