scieee Science in your language
[en] (orig)

Keyboard Temperament Estimation From Symbolic Data: A Case Study on Bach's Well-Tempered Clavier

Author: Peter Van Kranenburg (Utrecht University; Meertens Institute); Gerben Bisschop
Publisher: Zenodo
DOI: 10.5281/zenodo.17706496
Source: https://zenodo.org/records/17706496/files/000058.pdf
KEYBOARD TEMPERAMENT ESTIMATION FROM SYMBOLIC DATA: A
CASE STUDY ON BACH’S WELL-TEMPERED CLAVIER
Pe e an K anenbu g
U ech Uni e si y
[email p o ec ed]
Ge ben Bisschop
U ech Uni e si y
[email p o ec ed]
ABSTRACT
In his pape we add ess he ask o keyboa d empe a-
men es ima ion om symbolic da a. The aim is o ind a
keyboa d empe amen ha minimizes he de ia ions om
pu e in e als, gi en a co pus o music. The p oblem o
inding a sui able empe amen has been s udied o cen-
u ies. Many solu ions ha e been p oposed. By aking
a da a-d i en app oach, we con ibu e a me hod o his
ield. We de ine a loss unc ion ha measu es he de i-
a ion om pu e in e als, wi h a ewa d o exac ly pu e
in e als. Th ee op imiza ion me hods a e explo ed: Basin
Hopping, Di e en ial E olu ion, and Dual Annealing. We
alida e ou me hod wi h syn he ic da a, and by compa -
ing wi h c. 1,500 exis ing empe amen s, including equal
empe amen . Ou me hod imp o es on any exis ing em-
pe amen . As a case s udy, we apply he me hod o Bach’s
Well-Tempe ed Cla ie . Ou indings show in e es ing co -
espondence o exis ing p oposals in musicological li e a-
u e.
1. INTRODUCTION
Keyboa d ins umen s in he Wes e n musical adi ion, in-
cluding ha psicho ds, o gans, and pianos, ypically ea u e
wel e keys pe oc a e, each gene a ing a one wi h a dis-
inc , ixed undamen al equency. Consequen ly, hese
ins umen s can p oduce wel e unique equencies wi hin
each oc a e. Ye , Wes e n music heo y posi s ha mo e
han wel e equencies pe oc a e a e necessa y o achie e
in- une pe o mance ac oss all p e alen onali ies.
Figu e 1 shows he s anda d layou o one oc a e o
he keyboa d. The second black key (K3), o example,
is sha ed by D♯, E♭, and F♭♭. To play a majo hi d wi h a
B as oo , he D♯is needed, bu o a mino hi d on a C,
he E♭is needed. To play hese in e als pu e (in- une), we
need di e en equencies o he D♯and he E♭, bu hey
sha e he same key. The e o e, each choice o equencies
o he 12 keys (each empe amen ) is a comp omise. I is
impossible o chose he 12 equencies such ha all possi-
ble in e als a e pu e.
© P. an K anenbu g and G. Bisschop. Licensed unde a
C ea i e Commons A ibu ion 4.0 In e na ional License (CC BY 4.0).
A ibu ion: P. an K anenbu g and G. Bisschop, “Keyboa d Tempe -
amen Es ima ion om Symbolic Da a: A Case S udy on Bach’s Well-
Tempe ed Cla ie ”, in P oc. o he 26 h In . Socie y o Music In o ma-
ion Re ie al Con ., Daejeon, Sou h Ko ea, 2025.
B♯
C
D!
C"
D
E!
D"
E
F♭
E♯
F
G!
F"
G
A!
G"
A
B!
A"
B
C♭
B"
C♯
D♭
D♯
E♭
F!
E"
F♯
G♭
G♯
A♭
A♯
B♭
C!
K1K3
K5
K6K8K10
K0K2K4K7K9K11
Figu e 1. S anda d Wes e n keyboa d layou wi h key in-
dices (0-11).
This si ua ion has caused a as body o musicological
li e a u e, spanning many cen u ies [1]. Nume ous solu-
ions ha e been p oposed, and music heo is s go engaged
in o en hea ed deba es abou which solu ion o a o . A
simpli ied eading o music his o y ells us ha since he
nine een h cen u y equal empe amen has been in use.
This is a empe amen in which all in e als be ween he
successi e keys a e uned exac ly equal in size. As a con-
sequence o his ul ima e comp omise, all in e als a e ou -
o - une. Mode n musical hea ing o mode n music s yles
is ole an o ha . So, o much o con empo a y Wes -
e n music he ques ion seems se led. Howe e , o pe -
o ming ea ly music, non-equal empe amen s a e almos
always possible and o en c ucial, especially i he aim is
a his o ically in o med pe o mance. Compose s made use
o ension and elease pa e ns be ween less and mo e in-
une in e als, which a e los in equal empe amen .
The mode n pe o me ’s choice o a pa icula empe -
amen can be based on a ious sou ces. Many his o ic
ea ises ha e been p ese ed p o iding de ailed desc ip-
ions o uning sys ems, o en based on ma hema ical and
philosophical conside a ions. Ano he sou ce o knowl-
edge is he body o his o ic uning ins uc ions, which e-
lec s p ac i ione s’ app oaches h oughou he cen u ies.
To a limi ed ex en , su i ing his o ic ins umen s o e
some clues, bu hese emain o en specula i e.
503
So, bo h om p ac ical (ins umen builde s, une s,
pe o me s) and heo e ical (music his o ians, music he-
o is s) poin s o iew, he ques ion how o ind a sui able
empe amen is e y ac ual. Ins ead o a his o ic o he-
o e ic app oach, in his pape we employ a da a-d i en
me hod. The aim is o de i e a empe amen om he con-
en s o a co pus o composi ions. Gi en he in en o y o
all occu ing in e als, we minimize a loss unc ion ha
e lec s o wha ex en he in e als de ia e om pu e. We
explo e se e al op imiza ion algo i hms, and we de ine a -
ious possibili ies o a sui able loss unc ion.
No much wo k on empe amen s has been done wi hin
he ield o Music In o ma ion Re ie al. A ela ed Music
In o ma ion Re ie al ask is empe amen es ima ion om
audio eco dings [2–4]. Howe e , his is aimed a ecog-
nizing he ac ual empe amen o an ins umen om an
audio eco ding. Ra he , in mos MIR s udies ha deal
wi h pi ch, he ques ion is bypassed by e.g., binning o
pi ches in asks such as F0 de ec ion o ch oma ea u e ex-
ac ion, o by me hods ha a e simply no p ecise enough
o cap u e di e ences o a ew cen s. Musicological li e -
a u e ea u es se e al s udies ha employ s a is ical me h-
ods o deduce empe amen s [5–7]. Pa icula ly ele an
is he wo k o Ma ínez Ruiz [8, pp. 110 ], who ook a
simila app oach o ou s. We ex end hese e o s by in-
oducing an op imiza ion app oach ha iden i ies he op-
imum wi hin a con inuous space ins ead o pe o ming
b u e- o ce sea ches, and by o mula ing a loss unc ion
ha inco po a es an a bi a y se o in e als.
To explo e he a o dance o ou me hod, we ocus on
he wo books o Das Wohl empe i e Cla ie by Johann
Sebas ian Bach (1685–1750). Bach’s in ended empe a-
men emains unknown, which led o ex ensi e discussions
and specula ion in musicological li e a u e. We bo h assess
a huge numbe o his o ic empe amen s, and we examine
he solu ions o ou me hod.
In his pape , we illus a e ha ou p oposed me hod
se es no only as a MIR ool o de i ing an op imal em-
pe amen bu also as an expe imen al amewo k o in es-
iga ing di e se hypo heses abou wha cons i u es an op i-
mal empe amen . In his pape , we make a se o heu is-
ic choices o in e al a ios and o loss and ewa d cal-
cula ions, bu by manipula ing hese, and examining he
ou come, a p ocess o modeling is acili a ed ha has he
po en ial o deepen ou unde s anding o musical uning
sys ems and hei pe cep ual e ec s, po en ially leading o
u he e inemen s and inno a ions in bo h heo e ical and
p ac ical applica ions o empe amen design [9, Ch. 1].
2. METHOD
In his sec ion we p esen he me hod o compu a ionally
ind an op imal empe amen o a gi en co pus o music.
Fi s we de ine he ep esen a ion o a empe amen . Then
we p esen he ep esen a ion o a co pus o music. Nex ,
we p esen he objec i e unc ion, and we mo i a e he op-
imiza ion algo i hms we employ. Finally, we un se e al
es s wi h syn he ic da a o alida e he app oach.
2.1 Tempe amen ep esen a ion
We de ine a empe amen as a ec o p= (p0, p1, . . . , p11)
whe e piis he size o he in e al o key K0( he C) wi h
Kiin cen s. p0is always ze o ( he in e al o C wi h i sel ),
bu we keep i in he ec o o con enience.
The e a e di e en ways o ep esen ing he size o an
in e al: equency di e ences, equency a ios and cen
alues. In his pape we adop a ios and cen alues. The
equency a io is ha o he highe pi ch o he lowe . Fo
example, o a pu e pe ec i h his is 3/2. Cen s measu e
pi ch di e ences on a loga i hmic scale, whe e he oc a e
is di ided in 1200 equal s eps, each co esponding o 1¢.
Thus he size o an in e al in cen s is compu ed as:
Cen s = 1200 ·log2 2
1¢,
whe e 1is he equency o he lowes pi ch and 2 he
equency o he highes pi ch. Fo a pu e pe ec i h, his
esul s in 701.96¢. Using cen ep esen a ions, he size o
successi e in e als can be compu ed by simple addi ion
and sub ac ion
2.2 Co pus Rep esen a ion
In his sec ion, we discuss how o ep esen a co pus o
music. Because we assume pu e oc a es, i is su icien o
conside all wel e possible in e als on each o he wel e
keys wi hin he oc a e, esul ing in a se o 144 possible
in e als. As no a ion o such an in e al, we in oduce
Ij,k, indica ing an in e al o kkeys (semi ones) wi h Kj
as oo . E.g., I0,5is he in e al o 5 keys (mos ly a pe ec
ou h) wi h K0as oo , and I7,2is he in e al o wo keys
(mos ly a majo second) wi h K7as oo .
We ep esen a gi en co pus o music as he se o
weigh ed occu ence a es o hese 144 possible in e als.
In coun ing he occu ence a es, we include bo h melodic
in e als (be ween successi e ones), and ha monic in e -
als (be ween simul aneously sounding pi ches).
Fo he ex ac ion o he ha monic in e als, we make
use o he music21 [10] cho di y unc ion. This unc ion
slices he sco e such ha any change in any pa s a s
a new slice, and collapses all simul aneous pi ches o
each slice in a single cho d. We hen examine all dis-
inc ascending in e als in each esul ing cho d and up-
da e he coun s in ou in e al epe o y acco dingly. Fo
he melodic in e als, we simply ake all successi e in e -
als o all pa s.
We mul iply each coun wi h wo weigh s. Fi s o com-
pensa e o he di e en du a ions o he slices wi h ha -
monic in e als, we weigh he coun s by he du a ion o
he slice, measu ed in qua e no e leng hs. Fo melodic
in e als we ake he leng h o he sho es no e as weigh .
Second, we weigh by audi o y impac . To indica e wo ex-
emes, an in e al ha is o med by a passing 16 h no e on
a me ically insigni ican posi ion has a di e en audi o y
impac han an in e al in he inal cho d o a cadence. Fo
he passing one, he empe amen can be mo e ole able
han o he p ominen cho d. To cap u e his nuance, we
P oceedings o he 26 h ISMIR Con e ence, Daejeon, Ko ea, Sep embe 21-25, 2025
504
Size In e al a io cen s Size In e al a io cen s Size In e al a io cen s
0 P1 1 0 4 M3/d4 5/4 386.31 8 m6/A5 8/5 813.69
1 m2/A1 16/15 111.73 81/64 407.82 128/81 792.18
17/16 104.96 5 P4 4/3 498.04 11/7 782.49
27/25 133.24 6 d5/A4 45/32 590.22 9 M6 5/3 884.36
135/128 92.18 7/5 582.51 27/16 905.87
256/243 90.22 10/7 617.49 10 m7/A6 16/9 996.09
25/24 70.67 13/9 636.62 9/5 1017.6
2 M2/d3 9/8 203.91 18/13 563.38 11 M7 15/8 1088.27
10/9 182.4 25/18 568.72 50/27 1066.76
3 m3/A2 6/5 315.64 36/25 631.28 243/128 1109.78
19/16 297.51 64/45 609.78
32/27 294.13 7 P5 3/2 701.96
Table 1. In e als. Size is he size ko in e al Ij,k on he keyboa d, co esponding wi h he dis ance measu ed in
numbe o keys (semi ones). The column In e al shows some enha monically equi alen in e als ha a e ealized by
he co esponding key pai s (P: Pe ec , M: Majo , m: Mino , d: diminished, A: augmen ed). The a ios a e accep able
equency a ios o his in e al. The cen s column shows he size o hese a ios in cen s. The a ios in bold o m he se
Tjus , which a e he a ge a ios o he i e-limi jus in ona ion.
weigh he coun by he bea s eng h ∈(0,1], which is he
me ic weigh acco ding o music21’s me e model [11].
Fo ha monic in e als, we ake he bea s eng h o he
cho d, o melodic in e als, we ake he bea s eng h o he
second no e, since ha is hea d in ela ion o he p e ious
no e. As a inal s ep we no malize all weigh ed occu ence
a es in ou in en o y such ha he sum is 1.
2.3 Ta ge
To de ine he loss unc ion, we i s mus conside he a -
ge we a e looking o . The p ima y goal o a empe amen
is o ensu e all audible in e als a e pe cep ually accep -
able, while op imizing as many in e als as possible o ap-
p oach pu e consonance. The i s ques ion hen is wha
de e mines whe he an in e al is pu e. In gene al, in e -
als wi h a ios ha can be w i en as ac ions o low in-
ege s a e conside ed p e e able. Examples o such simple
ac ions a e he pe ec p ime (1/1), pe ec oc a e (2/1),
p e ec i h (3/2), and majo hi d (5/4). These ac ions
co espond wi h in e als be ween he lowes o e ones in
he ha monic se ies.
We assembled a se o accep able a ios o each o he
12 possible in e als wi hin an oc a e. Fo mos in e als,
se e al ac ions ha e been es ablished in li e a u e. Fo
example, o he majo hi d, nex o 5/4, also he ac ion
81/64 can occu . This is he majo hi d ha esul s om
s acking ou ascending i hs and wo descending oc a es
(3/2)4∗(1/2)2= 81/64. Simila ly, o o he in e als
he e a e mul iple possibili ies o de i e a a io. Table 1
shows all possible in e al sizes in semi ones on he key-
boa d wi hin an oc a e, wi h o each in e al a lis o ac-
cep able a ge a ios. A well-known subse is he i e-limi
jus in ona ion, in which only oc a es, i hs, and hi ds a e
used o cons uc he in e als. The a ios in bold a e a
common choice o his in ona ion. Th oughou he es o
his pape , we use wo se s o a ge s: Tall, including all
a ge s, and Tjus , including only he jus a ge a ios. We
deno e he se o a ge s o an in e al o ssemi ones as
Tall,s and Tjus ,s espec i ely.
2.4 Loss Func ion
As loss we ake he mean squa ed e o o he ac ual sizes
o he in e als Ij,k wi h hei nea es accep able a ge s in
cen s. This gi es us he ollowing loss unc ion:
LMSE(p) = X
i
i·[ min
∈Tx,s
|ci− |]2,
whe e iis he weigh ed occu ence a e o he i- h in-
e al in he co pus in en o y (see Sec ion 2.2), ci=
[(pk−pj) mod 1200] is he size in cen s o ha in e al
gi en empe amen p, ∈Tx,s is he size in cen s o he
closes a ge , whe e sis he size o in e al iin semi ones.
E.g., when using Tall, o any in e al o 2 semi ones he
se o a ge sizes is Tall,2={203.91,182.4}(see Table 1).
No e ha only in e als o which i= 0 con ibu e o he
loss alue.
To s imula e he in e als in he esul ing empe amen
o end up as close as possible o a jus in e al, we in o-
duce an addi ional exponen ial ewa d e m:
Rpu e =(αi·e−β·[min |ci− |]i ∈Tjus ,s,
0i /∈Tjus ,s.
which ewa ds alues close o a a ge alue, bu only i ha
closes a ge is in he se o jus in e als. The in en ion
is o ‘snap’ he in e al o a jus a io when explo ing he
solu ion space. αi egula es he magni ude o he ewa d,
and β he a e o decay. This ewa d e m has a high alue
a he a ge , d ops quickly o alues close o he a ge and
app oaches 0 o la ge alues. By se ing di e en alues
o αi o he di e en in e als, we can o example a o
pu e hi ds o e pu e i hs. In his pape we se all αi o
10 and β o 2, which gi es a ela i ely s eep slope close
o he a ge , and a maximum ewa d o 10. We sub ac
he ewa d alue om he squa ed e o , because he loss
unc ion will be minimized. Thus, ou ull loss unc ion is:
L(p) = X
i
i·([min
|ci− |]2−Rpu e).
Fo use wi h he Dual Annealing op imiza ion me hod
(see nex Sec ion), we add a u he e m ha con ols o
P oceedings o he 26 h ISMIR Con e ence, Daejeon, Ko ea, Sep embe 21-25, 2025
505
bounda ies o pe ec i hs. We wan o be able o se a
lowe and an uppe bounda y o he sizes o any o he
pe ec i hs ha occu in he co pus. This is achie ed
by in oducing a penal y o empe amen s ha c oss hese
bounda ies. This penal y e m is de ined as:
P7=γ·X
j1−e−δ j
whe e j ep esen s he iola ion o he j- h pe ec i h
beyond he bounds measu ed in cen s, only including he
i hs ha occu in he co pus. Fo example, suppose
we se he lowe limi o 696¢, and we ha e wo i hs
o 691¢ ha occu in he co pus, and he o he 10 i hs
wi hin he bounda ies, we hen ha e a penal y o P7=
γ·2·(1 −e−δ·5). Pa ame e γcon ols he heigh o he
‘pla eau’ o la ge de ia ions, and δcon ols he s eepness
o he unc ion. In his pape , we se γ o 100 and δ o 1.
No e ha in his way we could se bounds o any o he
wel e in e als, bu in his pape we only use bounds o
i hs. Including his penal y, he loss unc ion becomes:
Lbounded(p) = X
i
i·([min
|ci− |]2−Rpu e) + P7.
The alues o α,β, and γ, could p obably be u he
op imized. We did no do a ull sea ch, bu we choose
sensible alues, which p o e o deli e good esul s.
2.5 Op imiza ion Algo i hm
We employ h ee di e en app oaches o ind he global
minimum o he loss unc ion: Basin Hopping (BH) [12],
Di e en ial E olu ion (DE) [13], and Dual Annealing
(DA) [14]. These we e selec ed because o hei abili y
o handle non-linea p oblems in which he loss unc ion
is no con inuously di e en iable, as is he case in ou loss
unc ion because o he min ope a o . We use he imple-
men a ions as p o ided in he Py hon SciPy module [15].
BH explo es he ene gy landscape by pe u bing solu-
ions and accep ing mo es based on a Me opolis c i e ion.
A c ucial pa ame e is he ini ial s ep size, which we se
o 30¢ o allow a wide enough sea ch space o o e come
local minima. BH needs a local op imize , o which we
choose he COBYLA me hod [16] which is sui ed o ob-
jec i e unc ions ha a e no con inuously di e en iable.
DA combines simula ed annealing wi h a local sea ch, in-
oducing a gene alized empe a u e schedule o escape
local minima e icien ly. Fo DA, we make use o ou
P7 e m i we wan o cons ain he sizes o i hs, since
he implemen a ion in SciPy does no accep ex e nal con-
s ain s. A c ucial pa ame e o DA is he ini ial empe a-
u e, which egula es he p obabili y wi h which a p oposed
solu ion is accep ed. I we include he i hs cons ain P7,
we se he ini ial empe a u e o 150 o deal wi h he high
penal y γ o iola ing he bounds. I we do no cons ain
he i hs, we se i o 50. DE is a popula ion-based me hod.
I e ol es candida e solu ions h ough mu a ion, c osso e ,
and selec ion, excelling in con inuous op imiza ion wi h-
ou equi ing g adien in o ma ion. In ou applica ion, we
se he popula ion size o 100 [17].
2.6 Valida ion
We alida e ou me hod by compa ing he loss alue o
ou me hod wi h he loss alues o a collec ion o exis -
ing empe amen s, gi en wo syn he ic in e al in en o ies.
We gene a e an in e al in en o y CC ha is ep esen a-
i e o a piece in C majo ha includes modula ions o he
dominan , subdominan , and ela i e mino keys, and an
in en o y Cuni, which includes a uni o m dis ibu ion o e
all possible 144 in e als.
To gene a e CC, we adop he K umhansl-Kessle pi ch
p o iles [18, 19] o es ima e he p obabili y o occu ence
o scale ones. We in e p e he p o iles as p obabili y dis-
ibu ions, and we sample a la ge amoun pai s o pi ches
om he a ious scales in he p opo ion: 40% onic,
30% dominan , 20% subdominan , and 20% ela i e mino .
Wi hin each scale, we only sample dia onic scale ones,
aking he melodic mino scale o he ela i e mino . To
e lec he di e en p obabili ies o occu ence o he di -
e en ha monic in e als, we weigh each coun ed in e al
wi h a ha monic sco e, anging om 1 o he mino sec-
ond, o 10 o pe ec unisons and i hs.
We use he collec ion o exis ing empe amen s ha is
digi ally a ailable as pa o he Scala so wa e package. 1
This includes bo h his o ical and con empo a y empe a-
men s. F om he en i e se o o e i e housand empe -
amen s, we selec hose ha de ine 12 pi ches pe oc a e,
esul ing in a subse o c. 1,500. These can be conside ed
as solu ions ha al eady ha e been disco e ed. Fo each
empe amen , we calcula e he loss gi en ou syn he ic co -
po a, and we compa e he minium loss alue as disco e ed
by ou me hod. We do his o bo h a ge se s Tall and Tjus .
The esul s o 10 uns o each algo i hm a e shown
in Table 2. Ou me hod imp o es on all included exis -
ing empe amen s om he Scala collec ion, indica ing he
success o he op imiza ion. The disco e ed op ima a e
compa able among he h ee algo i hms. Di e en ial E o-
lu ion has he huge ad an age o a sho unning ime (low
µ ), while Dual Annealing is gene ally mo e consis en in
he op imum (lowe σL), and Basin Hopping is he wo s
pe o ming o he h ee me hods.
No ewo hy he e is ha o Cuni and Tall all esul ing
empe amen s show one na ow wol i h (686.21¢), one
equal empe ed i h (700¢), and wo i hs sligh ly lowe
han equal. This implies ha his empe amen is op imal
gi en he collec ion o a ios a he han gi en he co pus.
Fo Cuni and Tjus , no unexpec edly, we ind equal empe -
amen o all uns.
3. BACH’S “WOHLTEMPERIRTE CLAVIER”
One o he mos amous se s o composi ions ha cycles
h ough he ull se o 24 onali ies (one mino and one
majo piece o each o he 12 pi ches wi hin he oc a e) is
Johann Sebas ian Bach’s Wohl empe i e Cla ie (WTC),
consis ing o wo books (da ed 1722 and 1742), 48 pieces
in o al. The e is no his o ical eco d abou he p e e ed
1h ps://www.huygens- okke .o g/scala/
downloads.h ml#scales
P oceedings o he 26 h ISMIR Con e ence, Daejeon, Ko ea, Sep embe 21-25, 2025
506
CC,Tall:all a ge a ios CC,Tjus :only jus a ge a ios
emp. min(L)σLµ emp. min(L)σLµ
Dual Annealing -7.2274 0.00022 360 s Dual Annealing 27.7735 4.06e-6 204 s
Di . E olu ion -7.2274 0.00137 59.9 s Di . E olu ion 27.7735 5.98e-8 44.1 s
Basin Hopping -7.212 0.0235 317 s Basin Hopping 27.7823 0.00285 528 s
py h_12 -7.1467 - - smi hgw_well1 28.5731 - -
pa izek_jiw 2 -5.8116 - - spa schuh-442wide ench5 h-a 28.6816 - -
ain ee -5.3601 - - sco d1 28.7232 - -
Cuni,Tall:all a ge a ios Cuni,Tjus :only jus a ge a ios
emp. min(L)σLµ emp. min(L)σLµ
Dual Annealing 1.5571 1.874e-5 598 s Dual Annealing 105.23 0 172 s
Di . E olu ion 1.5571 0.0421 148 s Di . E olu ion 105.23 0 26.6 s
Basin Hopping 1.5726 0.0271 631 s Basin Hopping 105.23 0 1072 s
amis 1.6523 - - equal 105.23 - -
schiassi 1.7727 - - neidha d 4 105.23 - -
e langen2 1.7727 - - han ling-bumle 105.23 - -
Table 2. Resul s on he syn he ic in e al in en o ies CC(C majo ), and Cuni (uni o m dis ibu ion). Exis ing empe amen s
and ou me hods a e o de ed acco ding o loss alue o bo h Tall and Tjus .min(L)is he lowes loss alue ou o 10 uns,
σLis he s anda d de ia ion o he 10 loss alues, and µ is he a e age un ime o he op imiza ion algo i hm.
Tall Tall (bounded) Tjus
amis 0.47 kelle a 1 10.27 ma pu g-a 105.04
e langen 0.84 kelle a 10.78 emp12b2w 105.61
e langen2 1.13 so ge1 11.05 pyke _do se 105.87
schiassi 1.28 dudon_comp ine 11.12 handel2 106.19
ma pu g- 1 1.41 dudon_comp ine_h3 11.62 ellis_eb 106.3
ki nbe ge 1 1.41 sco d1 11.84 s e in 106.31
Table 3. Highes sco ing Scala empe amen s, gi en WTC,
using Tall,Tall wi h i hs bounded be ween 696 and 705¢,
and Tjus .
empe amen by Bach himsel . This caused ex ensi e spec-
ula ion in musicological li e a u e. We ake he ull WTC
as co pus o a case s udy o explo e ou me hod. We begin
by assessing exis ing empe amen s om he Scala collec-
ion, ollowed by he calcula ion o op imal empe amen s
using ou p oposed me hod. Then we discuss he expe i-
men al esul s in he con ex o musicological li e a u e
3.1 Expe imen 1: E alua ing Exis ing Tempe amen s
We compu e he loss alues o he exis ing empe amen s.
We do his, again, bo h o Tall and Tjus . The empe amen s
wi h he lowes alues a e shown in Table 3. An in-dep h
discussion o hese empe amen s would be highly in e es -
ing, bu is beyond he scope o his a icle. I u ns ou ha
all o he esul s o Tall a e a ian s o he his o ic empe -
amen o Ki nbe ge (1766). This amily o empe amen s
has one na ow i h (680¢), one schisma ic i h (700¢),
and 10 pu e i hs (701.96¢). They only di e in he loca-
ion o he empe ed i hs. Gi en ou esul o Cuni, his is
no su p ising. Aiming o a ‘ci cula ‘ empe amen , i.e.,
one wi hou wol in e als, we bind all i hs be ween 696
and 705¢. Using hese alues as cons ain s, we ind a em-
pe amen by He be Kelle a [20]. Kelle a ’s solu ion i s
he WTC e y well because he places he na owe i hs
on C, G, D, and A, which a e he leas equen i hs in
he WTC. Maybe su p isingly, he i hs on black keys a e
mos equen , wi h he i h E♭/D♯–B♭/A♯ oughly wice as
equen h oughou he WTC as he i h G-D.
3.2 Expe imen 2: Es ima ing Op imal Tempe amen
We un ou op imiza ion me hod gi en Bach’s WTC o
Tall (bo h bounded and unbounded i hs) and Tjus . The e-
sul ing op imal empe amen s a e shown in Figu e 2. We
ind o Tall a empe amen wi h one na ow wol i h on
G and wo schisma ic i hs on C and A ( op ow), o Tall
wi h bounded i hs a empe amen simila o Kelle a ’s,
which has empe ed i hs on F, C, G, D, and A (middle
ow), and o Tjus a nea ly equal empe amen (bo om
ow), wi h wo pu e i hs on D and A.
4. DISCUSSION
The esul we ob ained bo h o ou uni o mly dis ibu ed
collec ion o in e als Cuni, and o Bach’s WTC sugges s
ha he op imal WTC empe amen , gi en ou loss unc-
ion, and gi en ou choice o accep able a ios, is closely
ela ed o Johann Philipp Ki nbe ge ’s unequal empe a-
men om 1766, which, in a a ie y o a ian s, was used
ac oss Wes e n Eu ope o a cen u y. Could Bach’s WTC
indeed ha e been uned in Ki nbe ge ’s empe amen , as
He be Kelle a claimed in 1960 [20]?
The connec ion be ween Ki nbe ge ’s empe amen and
Bach’s uning da es back o he eigh een h cen u y. Since
Ki nbe ge , as Bach’s s uden , consis en ly p e e ed his
unequal empe amen o e equal empe amen s a ing in
1766 [22–24], la e au ho s ha e in e ed ha Ki nbe ge
ep esen ed Bach’s empe amen . In he pen ba le Ki n-
be ge waged in he 1770s wi h his con empo a y Wil-
helm F ied ich Ma pu g, Ma pu g a gued ha Bach’s em-
pe amen was equal, claiming ha Ki nbe ge himsel
s a ed Bach wan ed all hi ds uned uni o mly “high” [25].
Ma pu g e e ed o “equal empe amen ” in he adi-
ion o We ckmeis e -Neidha d -Rameau [26–28], and saw
his posi ion suppo ed by con empo a ies such as Johann
Nicolas Fo kel [29], Ca l Philipp Emanuel Bach [30], and
piano make Ba hold F i z [31] ( hough hei empe a-
men s, indi idually, la e p o ed no o be equal).
Based on Ma pu g’s widely accep ed iewpoin , i
P oceedings o he 26 h ISMIR Con e ence, Daejeon, Ko ea, Sep embe 21-25, 2025
507

Ab Eb Bb F C G D A E B F#C#
660
680
700
720
740
P5 Size (cen s)
P5 (701.96)
Ab Eb Bb F C G D A E B F#C#
360
380
400
420
440
M3 Size (cen s)
M3 (386.31,407.82)
Ab Eb Bb F C G D A E B F#C#
260
280
300
320
340
m3 Size (cen s)
m3 (315.64,297.51,294.13)
Ab Eb Bb F C G D A E B F#C#
160
180
200
220
240
M2 Size (cen s)
M2 (203.91,182.4)
Ab Eb Bb F C G D A E B F#C#
60
80
100
120
140
m2 Size (cen s)
m2 (111.73,104.96,133.24,92.18,90.22,70.67)
WTC - All Ra ios - Loss: -0.0124
Ab Eb Bb F C G D A E B F#C#
660
680
700
720
740
P5 Size (cen s)
P5 (701.96)
Ab Eb Bb F C G D A E B F#C#
360
380
400
420
440
M3 Size (cen s)
M3 (386.31,407.82)
Ab Eb Bb F C G D A E B F#C#
260
280
300
320
340
m3 Size (cen s)
m3 (315.64,297.51,294.13)
Ab Eb Bb F C G D A E B F#C#
160
180
200
220
240
M2 Size (cen s)
M2 (203.91,182.4)
Ab Eb Bb F C G D A E B F#C#
60
80
100
120
140
m2 Size (cen s)
m2 (111.73,104.96,133.24,92.18,90.22,70.67)
WTC - All Ra ios - Bounded Fi hs - Loss: 9.9024
Ab Eb Bb F C G D A E B F#C#
660
680
700
720
740
P5 Size (cen s)
P5 (701.96)
Ab Eb Bb F C G D A E B F#C#
360
380
400
420
440
M3 Size (cen s)
M3 (386.31)
Ab Eb Bb F C G D A E B F#C#
260
280
300
320
340
m3 Size (cen s)
m3 (315.64)
Ab Eb Bb F C G D A E B F#C#
160
180
200
220
240
M2 Size (cen s)
M2 (203.91)
Ab Eb Bb F C G D A E B F#C#
60
80
100
120
140
m2 Size (cen s)
m2 (111.73)
WTC - Fi e Limi Jus Ra ios - Loss: 104.5117
Figu e 2. Diag ams o he esul ing op imal empe amen s o WTC. Each ow ep esen s a empe amen . The diag ams
show he sizes o he a ious in e als gi en he oo o he in e al (inspi ed by Jos De Bie [21]). The dashed lines
show he size(s) o he accep able a io(s) acco ding o Table 1. The esul ing p- ec o s om op o bo om: Tall:(0
, 90.22, 182.4, 294.13, 384.36, 498.04, 588.27, 700, 792.18, 884.36, 996.09, 1086.31),Tall wi h bounded
i hs: (0, 93.02, 192, 296.93, 387.15, 500.85, 591.07, 696, 794.98, 888, 998.89, 1089.11), and Tjus :(0,
102.07, 200.05, 300.9, 403.96, 500.44, 602.71, 700.56, 801.53, 902.01, 1000.8, 1103.37).
was unanimously concluded un il he la e 19 h cen u y
ha Bach’s Well-Tempe ed Cla ie mus ha e designa ed
“equal empe amen .” Tha is, un il Bosanque sugges ed
in 1876 ha Bach’s uning could also ha e been ci cu-
la wi hou necessa ily being “gleichschwebend” (equal-
empe ed), a new de ini ion inc easingly adop ed by au-
ho s [32]. In 1960, He be Kelle a i s sugges ed Bach
used Ki nbe ge ’s unequal empe amen , backed by Hans
K üge ’s p e-1935 esea ch. [20].
John Ba nes began in 1979 wi h hypo heses abou
Bach’s ideal empe amen by calcula ing which in e als
occu mos equen ly in he WTC, a emp ing o de i e
he ideal WTC empe amen om his [5] [8, p. 108]. In
1999, Spa schuh claimed o ha e disco e ed Bach’s em-
pe amen in he callig aphed i le o WTC I [33]. A se ies
o subsequen au ho s examined Spa schuh’s indings by
u ning he callig aphic WTC i le page upside down o
in e p e ing i di e en ly [34–36], wi h B adley Lehman
gaining p ominence wi h his a icle in he Jou nal Ea ly
Music [37]. Fu he mo e, Ma k Lindley explo ed he WTC
in 1993 using ma hema ical models, and Claudio di Ve oli,
building on Ba nes, de eloped an algo i hm o sea ch all
pa i ions o he oc a e in disc e e s eps o 2¢ [7], esul -
ing in a empe amen wi h a loss alue o 67,147 acco ding
o ou loss unc ion using Tjus . Subsequen ly, hypo he ical
WTC empe amen s and analyses we e mo e o en ejec ed
because hey we e deemed di icul o jus i y om he
pe spec i e o his o ical pe o mance p ac ice. O he au-
ho s op ed o a speci ic empe amen o hei own [8, pp.
108 .], We ckmeis e [5, 38–40], Silbe mann [41, 42], o
o e ed a mul iple-choice app oach ega ding Bach’s em-
pe amen [8]. Su p isingly, no au ho chose Neidha d ’s
empe amen as he ideal WTC empe amen , despi e i s
equen his o ical link o Bach.
In seconda y li e a u e, mos au ho s ul ima ely chose a
Ki nbe ge ela ed empe amen as he bes candida e o
he ideal WTC empe amen [8, pp. 108 ., 119 .]. How-
e e , none o hese au ho s ha e so a explo ed he nu-
me ous 19 h-cen u y a ian s ha mus ha e made Ki n-
be ge ’s empe amen sound mo e ci cula , as desi ed o
he WTC. Ki nbe ge himsel w o e a second a ian in
1766 o dis ibu e he dissonan wol i h D-A o e wo
i hs: D-A-E. He aced c i icism om iolinis s ha he
wol i h D-A sounded ou o une wi h he open i hs
uning o he iolin’s ou s ings: (G-) D-A(-E). In a le e
o his iend Fo kel, he p o ided addi ional a ian s (Ki n-
be ge III/IV), in which he wol i h, sp ead ac oss ou
i hs, sounded e en less dissonan . By he ea ly 19 h cen-
u y, he name “Ki nbe ge ” became a ca ch-all e m o all
unequal empe amen s, and nume ous in e na ional a i-
an s (o en semi-Py hago ean) we e ci ed in sou ces, u -
he subdi iding he wol i h(s).
5. CONCLUSION AND FUTURE WORK
We p esen ed a amewo k o ind an op imal keyboa d
empe amen gi en a co pus o (symbolic) music, a se o
accep able equency a ios, and condi ions on he sizes o
he in e als. We alida ed he me hod on wo syn he ic
co po a. The op imiza ion esul s imp o e on c. 1,500 ex-
is ing empe amen s. Ou esul s on WTC suppo Ki n-
be ge ’s ele ance, in i ing a econside a ion o Kelle a ’s
1960s p oposal, nex o he s udy o applicabili y o he
many 19 h cen u y a ian s o Ki nbe ge ’s unequal em-
pe amen o une Bach’s WTC. Fu he u u e wo k in-
cludes dissonance-based loss unc ions, lis ening es s, and
a ho ough e alua ion o his o ic p oposals, including he
many a ian s on Ki nbe ge ’s empe amen .
P oceedings o he 26 h ISMIR Con e ence, Daejeon, Ko ea, Sep embe 21-25, 2025
508
Supplemen al ma e ial o his pape can be ound a :
h ps://gi hub.com/p ank anenbu g/ismi 2025. This in-
cludes he Py hon code, mo i a ions o he selec ed ac-
cep able a ios, selec ed syn hesized examples om he
WTC using he empe amen s discussed in his pape , and a
web applica ion o explo e empe amen s, including acous-
ic eedback.
6. REFERENCES
[1] O. Jo gensen, Tuning: Con aining he Pe ec ion
o Eigh een h-Cen u y Tempe amen , he Los A o
Nine een h-Cen u y Tempe amen , and he Science o
Equal Tempe amen . Eas Lansing, MI: Michigan
S a e Uni e si y P ess, 1991.
[2] S. Dixon, D. Tidha , and E. Bene os, “The empe -
amen police: he u h, he g ound u h, and no h-
ing bu he u h,” in P oceedings o he 12 h In e na-
ional Con e ence on Music In o ma ion Re ie al (IS-
MIR 2011), Miami, 2011, pp. 281–286.
[3] S. Dixon, M. Mauch, and D. Tidha , “Es ima ion o
ha psicho d inha monici y and empe amen om mu-
sical eco dings,” The Jou nal o he Acous ical Socie y
o Ame ica, ol. 131, no. 1, pp. 878–887, 2012.
[4] D. Tidha , S. Dixon, E. Bene os, and T. Weyde, “The
empe amen police,” Ea ly Music, ol. 42, no. 4, pp.
579–590, 2014.
[5] J. Ba nes, “Bach’s keyboa d empe amen ; in e nal e -
idence om he well- empe ed cla ie ,” Ea ly Music,
pp. 236–249, Ap il 1979.
[6] M. Lindley and R. Tu ne -Smi h, Ma hema ical Mod-
els o Musical Scales, M. Vogel, Ed. Bonn: Ve -
lag ü sys ema ische Musikwissenscha Gmbh, 1993,
ol. Band 66 de O pheus Sch i en eihe zu G und a-
gen de Musik.
[7] C. Di Ve oli, Unequal Tempe amen s: Theo y,
His o y and P ac ice, 3 d ed. B ay, I eland:
B ay Ba oque, 2013. [Online]. A ailable: h p:
// empe .b ayba oque.ie/
[8] S. Ma ínez Ruiz and J. Balles e i Gilbe , “Tempe a-
men in bach’s well- empe ed cla ie - a his o ical su -
ey and a new e alua ion acco ding o dissonance he-
o y,” July 2011.
[9] W. McCa y, Humani ies Compu ing. Basings oke:
Palg a e Macmillan, 2005.
[10] M. S. Cu hbe and C. A iza, “Music21: A oolki
o compu e -aided musicology and symbolic music
da a,” in P oceedings o he 11 h In e na ional
Socie y o Music In o ma ion Re ie al Con e ence
(ISMIR 2010), U ech , Ne he lands, 2010, pp. 637–
642. [Online]. A ailable: h p://ismi 2010.ismi .ne /
p oceedings/ISMIR2010.pd
[11] C. A iza and M. S. Cu hbe , “Modeling bea s,
accen s, beams, and ime signa u es hie a chically
wi h music21 me e objec s,” in P oceedings o
he In e na ional Compu e Music Con e ence, New
Yo k, 2010, pp. 216–223. [Online]. A ailable: h p:
//mi .edu/music21/pape s/2010Me e Objec s.pd
[12] D. J. Wales and J. P. Doye, “Global op imiza ion
by basin-hopping and he lowes ene gy s uc u es o
lenna d-jones clus e s con aining up o 110 a oms,”
The Jou nal o Physical Chemis y A, ol. 101, no. 28,
pp. 5111–5116, 1997.
[13] R. S o n and K. P ice, “Di e en ial e olu ion–a sim-
ple and e icien heu is ic o global op imiza ion o e
con inuous spaces,” Jou nal o global op imiza ion,
ol. 11, pp. 341–359, 1997.
[14] Y. Xiang, D. Sun, W. Fan, and X. Gong, “Gene alized
simula ed annealing algo i hm and i s applica ion o he
homson model,” Physics Le e s A, ol. 233, no. 3, pp.
216–220, 1997.
[15] P. Vi anen, R. Gomme s, T. E. Oliphan , M. Habe -
land, T. Reddy, D. Cou napeau, E. Bu o ski,
P. Pe e son, W. Weckesse , J. B igh , S. J. an de
Wal , M. B e , J. Wilson, K. J. Millman, N. Mayo o ,
A. R. J. Nelson, E. Jones, R. Ke n, E. La son,
C. J. Ca ey, ˙
I. Pola , Y. Feng, E. W. Moo e,
J. Vande Plas, D. Laxalde, J. Pe k old, R. Cim man,
I. Hen iksen, E. A. Quin e o, C. R. Ha is, A. M.
A chibald, A. H. Ribei o, F. Ped egosa, and P. an
Mulb eg , “Scipy 1.0: Fundamen al algo i hms o
scien i ic compu ing in py hon,” Na u e Me hods,
ol. 17, no. 3, pp. 261–272, 2020. [Online]. A ailable:
h ps://doi.o g/10.1038/s41592-019-0686-2
[16] M. J. D. Powell, “A di ec sea ch op imiza ion me hod
ha models he objec i e and cons ain unc ions by
linea in e pola ion,” in Ad ances in Op imiza ion and
Nume ical Analysis, S. Gomez and J.-P. Henna , Eds.
Do d ech : Sp inge , 1994, pp. 51–67.
[17] A. P. Pio owski, “Re iew o di e en ial e olu ion
popula ion size,” Swa m and E olu iona y Compu-
a ion, ol. 32, pp. 1–24, 2017. [Online]. A ail-
able: h ps://www.sciencedi ec .com/science/a icle/
pii/S2210650216300268
[18] C. L. K umhansl and E. J. Kessle , “T acing he dy-
namic changes in pe cei ed onal o ganiza ion in a spa-
ial ep esen a ion o musical keys,” Psychological Re-
iew, ol. 89, no. 4, pp. 334–368, 1982.
[19] C. L. K umhansl, Cogni i e Founda ions o Musical
Pi ch. New Yo k, NY: Ox o d Uni e si y P ess, 1990.
[20] H. Kelle a , Zu musikalischen Tempe a u insbeson-
de e bei Johann Sebas ian Bach. Kassel: J.G. Oncken
Ve lag, 1960.
P oceedings o he 26 h ISMIR Con e ence, Daejeon, Ko ea, Sep embe 21-25, 2025
509
[21] J. De Bie, “His o ische o gels emmingen: heo ie & e-
ali ei : Een onde zoek naa he geb uik an his o ische
o gels emmingen in laande en, me een algemeen
o e zich an de s emmings heo ie,” Diss. doc . kuns -
geschiedenis en oudheidkunde: musicologie, Uni e -
si ei Gen , Gen , Belgium, 2004. [Online]. A ailable:
h p://lib.ugen .be/ca alog/ ug01:002001538
[22] J. P. Ki nbe ge , Johann Philipp Ki nbe ge s
Cla ie übungen mi de Bachischen Applica u ,
in eine Folge on den leich es en bis zu den schwe s en
S ücken. Be lin: bey F ied ich Wilhelm Bi ns iel,
Königl. p i ilegi en Buchd ucke , 1766, ol. Vie e
Sammlung.
[23] ——, Die Kuns des einen Sa zes in de Musik, 1s ed.
Be lin: In Commission bey Ch is ian F ied ich Boß,
1771, ol. 1e Theil.
[24] J. P. Ki nbe ge and H. Belle mann, “B ie e on
ki nbe ge an o kel (mi ge heil on h. belle mann)
( o ze zung: Iii),” Allgemeine musikalische Zei ung,
ol. VI, no. 36, pp. 565–572, Sep embe 1871.
[25] H.-J. Schulze, Bach-Dokumen e, W. Neumann, Ed.
Leipzig: Bä en ei e Kassel, Basel, Tou s, London
VEB Deu sche Ve lag ü Musik Leipzig, 1972, ol.
Band III: Dokumen e zum nachwi ken Johann Sebas-
ian Bachs 1750-1800.
[26] A. We ckmeis e , Hypomnema a Musica ode mu-
sicalisches Memo ial. Quedlinbu g: In Ve -
legung Theod i Philippi Cal isii: Geo g Olms Ve lag,
Hildesheim, 2015 Ausg., 1697.
[27] J. G. Neidha d , Bes e und leich es e Tempe a u des
Monocho di. Jena: Bey Johann Bielcken, 1706.
[28] J. P. Rameau, Géné a ion ha monique. Pa is: Chez
P aul ils, 1737.
[29] J. N. Fo kel, Uebe Johann Sebas ian Bachs Lebens,
Kuns und Kuns we ke. Leipzig: Bey Ho meis e und
Kühnel, 1802.
[30] C. P. E. Bach, Ve such übe die wah e A das Cla ie
zu spielen, 1s ed. Be lin: Königl. Ho -Buchd ucke
Ch is ian F ied ich Henning, 1753.
[31] B. F i z, Anweisung, wie man Cla ie e, Cla ecins, und
O geln, nach eine mechanischen A , in allen zwöl
Tönen gleich ein s immen könne, daß aus solchen
allen sowohl du als moll wohlklingend zu spielen sey,
2nd ed. Leipzig: Johann Go lob Immanuel B ei kop ,
1757.
[32] R. H. M. Bosanque and R. Rasch, On he Ma hema -
ical Theo y o Tempe amen . Unknown, 1876, ci ed
as Bosanque & Rasch 1876, p. 29 .
[33] A. Spa schuh, “S imm-a i hme ik des wohl em-
pe ie en kla ie s on j.s. bach,” in Deu sche Ma he-
ma ike e einigung Jah es agung, 1999, pp. 154–155.
[34] R. Böß, Die ungleichschwebende O iginals immung
on Johann Sebas ian Bach: Das Wohl empe i e
Cla ie . F ank u am Main: Pe e Lang, 2009.
[35] E. Jobin, “Bach e le cla ie bien empé é, pa
emile jobin,” Re ie ed Ma ch 25, 2025, om h ps:
//www.cla ecin-en- ance.o g/spip.php?a icle52,
2020–2025.
[36] J. C. F ancis, “Bach’s well empe ed uning,” Re-
ie ed Ma ch 25, 2025, om h ps://www.eunomios.
o g/con ib/ ancis6/ ancis6.pd , Feb ua y 2011.
[37] B. Lehman, “Bach’s ex ao dina y empe amen : ou
ose a s one,” Ea ly Music, pp. 3–23 and 211–231,
Feb ua y and May 2005.
[38] H. A. Kellne , Wie s imme ich selbs mein Cembalo?,
3 d ed., se . Sch i en eihe Das Musikins umen , He
19. F ank u am Main: Ve lag E win Bochinsky,
1986.
[39] K. Wegscheide , “Mi einem he zen - eine
e zen,” Re ie ed Ma ch 25, 2025, om
h ps://www.wegscheide .eu/s o age/app/media/
Tannenbe g o ag%202004%20USA.pd , Ma ch
2004.
[40] J. Reinha d, Bach and Tuning, se . Sou ces and S udies
in Music His o y om An iqui y o he P esen , Vol-
ume 47, E. An okole z and M. Alb ech , Eds. F ank-
u am Main: Pe e Lang, 2016.
[41] M. Tessme , “Wie wa bachs wohl empe ie es kla ie
ges imm ?” Ac a O ganologica, p. 194, 1994.
[42] B. Bille e , Anweisung zum S immen on Tas enins u-
men en. Be lin, Kassel: Me sebu ge Ve lag, 2010.
P oceedings o he 26 h ISMIR Con e ence, Daejeon, Ko ea, Sep embe 21-25, 2025
510