Equal temperament vs instrument harmonics in music

In summary, the app demonstrates how the fundamental frequencies of different notes on a musical instrument are related to each other in such a way as to allow them to get as close as possible to integer harmonics. It uses equal temperament tuning and shows how the traditional major scale has seven notes that are not harmonically related to each other. The app also demonstrates how the beat frequencies of different notes on a musical instrument can make them sound 'off'.
  • #1
Bob Walance
Insights Author
Gold Member
77
53
Our brains are apparently musically happy when different individual notes are harmonically related to each other.

In our music system, the fundamental frequencies of the different notes on a musical instrument such as the piano or the guitar are related to each other in such a way as to allow them to get as close as possible to the integer harmonics that occur in any given note of the instrument. This system uses what is called 'equal temperament' in the tuning of the different notes. The fundamental frequencies of the notes are separated by a factor of 2^(1/12), so every twelfth note the fundamental frequency of the note has exactly doubled.

I have written a web-based app that demonstrates some of these ideas. It is a work-in-progress.

The top two buttons allow us to hear the difference between an equal-temperament major chord with frequencies f + f*2^(4/12) + f*2^(7/12), and a major chord based on integer-related harmonics with frequencies of f + f*5/4 + f*6/4. To my ear the harmonically-related major chord sounds calmer and sweeter.

The middle button allows us to hear a sinusoidal tone and its seven harmonics separately (f, 2f, 3f, 4f, 5f, 6f, 7f and 8f).

The bottom left button plays an equal-temperament major scale starting at 8f. This scale also includes the dominant 7th for eight different notes (the ninth note is 16f). The bottom right button plays a harmonically-related scale based on tones of frequency 8f through 16f.

Note that I have only successfully tested this app on a Windows desktop pc. I haven't tried it on a Mac. It does not play properly on an iPhone or iPad.

https://bobwalance.github.io/
 
Science news on Phys.org
  • #2
The major scale doesn't have the right notes (not even the right number) and the pitch of some notes is incorrect, they should be as below.

EqualJust
880880
987.7666990
1108.7311100
1174.6591173.333
1318.511320
1479.9781466.667
1661.2191650
17601760

On the plus side the demonstration of the beating dissonance in the equal temperament major chord is good - I hope this is all due to the intonation and not rounding - even with the limitations of web audio.
 
  • #3
It's probably worth noting that music and maths and/or physics are often common interests and there are a lot of resources out there that investigate tuning systems and other aspects of music theory comprehensively and rigorously. I think that if you are to add anything to these you should set yourself a very high bar, but it's a promising start.
 
Last edited:
  • #4
pbuk said:
The major scale doesn't have the right notes (not even the right number) and the pitch of some notes is incorrect, they should be as below.

EqualJust
880880
987.7666990
1108.7311100
1174.6591173.333
1318.511320
1479.9781466.667
1661.2191650
17601760

On the plus side the demonstration of the beating dissonance in the equal temperament major chord is good - I hope this is all due to the intonation and not rounding - even with the limitations of web audio.

The traditional major scale has seven notes. The scale that is being played in the app has eight notes because I am including the dominant 7th note of the scale. This is done in order to directly compare it with the eight notes of the harmonics. I am also playing the octave note so there are nine notes total in both scales.

The frequencies are accurate to the level of the Math.pow javascript method. I am only displaying four digits of text in the app for simplicity. The tone-generating technique in the playScale() function is loading a buffer with sin(x) samples at 44,100 samples per second - with enough samples in the buffer to fill the full duration of the tone. I would bet that the tone accuracies are well below one cent.

const tOn = 0.5;
const tOff = 0.1;
const f1 = 2 * 440;
const f2 = f1 * Math.pow(2, 2 / 12);
const f3 = f1 * Math.pow(2, 4 / 12);
const f4 = f1 * Math.pow(2, 5 / 12);
const f5 = f1 * Math.pow(2, 7 / 12);
const f6 = f1 * Math.pow(2, 9 / 12);
const f7dom = f1 * Math.pow(2, 10 / 12);
const f7 = f1 * Math.pow(2, 11 / 12);
const f8 = f1 * Math.pow(2, 12 / 12);
playScale(tOn, tOff, f1, f2, f3, f4, f5, f6, f7dom, f7, f8);

Yes, the beat frequencies are what make the equal temperament chord sound so 'off' as compared with the harmonic version. It's really obvious here where the two chords can be quickly compared. Fortunately, in real music our brains don't get a chance to notice those nasty beat frequencies.
 
  • #5
It's what you call the "harmonic scale" that I have a problem with. You seem to have produced this by spanning the octave between 880Hz and 1760Hz in eight linear steps of 110Hz. That's not how acoustics, or music*, works.

What you are calling the "dominant 7th" is usually called the "minor 7th" and it doesn't belong in a major scale.

* Edit: here I am referring to 12-tone chromatic music as is the OP.
 
Last edited:
  • #6
His 8 note scale has both the just tuned 7th and the way flat 7th partial. The just intonation 7th is a 15:8 ratio (1.875, very close to the 1.888 equal tempered 7th in a major scale), while the 7th partial is 7/4 (a 31 cent flat Bb relative to C)

So just intonation is not really based on the harmonic series past the fifth partial

if you want to hear what real music sounds like using upper partials, there is a whole movement called spectralism, centered at IRCAM in France, which began in the late 70s, using computers to generate partials in the 20s or 30s (off of very low pitches)



 
  • #7
BWV said:
His 8 note scale has both the just tuned 7th and the way flat 7th partial.
No, his equal temperament "scale" has the correct frequencies for a major scale with a fundamental of A=880Hz with the addition of a minor 7th. Just intonation for a minor 7th is 16/9.
 
  • #8
pbuk said:
No, his equal temperament "scale" has the correct frequencies for a major scale with a fundamental of A=880Hz with the addition of a minor 7th. Just intonation for a minor 7th is 16/9.
in his scale at the bottom right, which is not just intonation, he has 1540 / 880 = 7/4 - that is the ratio for the 7th partial, the 31-cent flat minor 7th the note before that in the 6th degree is the 13/8 13th partial, which is roughly a quarter-sharp flat 6th
 
Last edited:
  • #9
I've been tweaking the the tuning of my own baby grand piano for many years and doing full tuning since March 2022 (because of Covid). It's way more complicated that one might think.

Equal temperament for the middle octave is easier than it used to be because one can use a phone app to check it; when I tuned a harpsichord at school 50 years go I made a list saying how many beats per minute each interval should be smaller or larger than the exact interval (and even what note to listen for the beats on).

The main problem is that the higher harmonics on higher piano strings are slightly flat and give an impression that the overall note is flat so one has to "stretch" the octaves to sound right when the notes are played separately, but if that is even slightly overdone they sound horrible when the notes are played together. I usually end up with a compromise where neither case sounds particularly good, although one of my past piano tuners used to tune it better than I can. My piano isn't particularly easy to tune either, as many of the pins do not turn smoothly, so they end up jumping up past the required pitch.
 
Last edited:
  • Like
Likes BWV
  • #10
pbuk said:
It's what you call the "harmonic scale" that I have a problem with. You seem to have produced this by spanning the octave between 880Hz and 1760Hz in eight linear steps of 110Hz. That's not how acoustics, or music*, works.

The tones in the harmonic scale for this app are shown in the code below. These are the tones that occur in nature (e.g., for a plucked string). The only human-created scale or chord that I am demonstrating is for equal temperament.

const tOn = 0.5;
const tOff = 0.1;
const fStart = 110;
const f1 = 8 * fStart;
const f2 = 9 * fStart;
const f3 = 10 * fStart;
const f4 = 11 * fStart;
const f5 = 12 * fStart;
const f6 = 13 * fStart;
const f7dom = 14 * fStart;
const f7 = 15 * fStart;
const f8 = 16 * fStart;
playScale(tOn, tOff, f1, f2, f3, f4, f5, f6, f7dom, f7, f8);
 
  • #11
BWV said:
in his scale at the bottom right, which is not just intonation, he has 1540 / 880 = 7/4 - that is the ratio for the 7th partial, the 31-cent flat minor 7th the note before that in the 6th degree is the 13/8 13th partial, which is roughly a quarter-sharp flat 6th
Agreed. My point is that in order to compare like with like it should be just intonation.
 
  • #12
Bob Walance said:
The tones in the harmonic scale for this app are shown in the code below. These are the tones that occur in nature (e.g., for a plucked string).
No, these tones do not appear in nature for a string with a fundamental of 880Hz.
 
  • #13
pbuk said:
No, these tones do not appear in nature for a string with a fundamental of 880Hz.
They are for a fundamental of 110Hz. You have to go up some octaves before the harmonic series covers enough notes for a major scale.
 
  • #14
Jonathan Scott said:
They are for a fundamental of 110Hz.
Then they don't belong in a scale with a fundamental of 880Hz.
 
  • #15
The idea that somehow 'natural' scales are superior is fallacious. We have 32 Beethoven piano sonatas that would not work on any other piano tuning, so whatever you come up with it has to outweigh Ludwig Van, so good luck with that

The whole idea of temperament in western music stems from the desire to move away from a single root note Just intonation, which does not employ higher partials than the minor 3rd, just uses these intervals, so the just intoned maj 7 is a just 5th plus a just Maj3rd.
 
  • #16
pbuk said:
Then they don't belong in a scale with a fundamental of 880Hz.
The harmonic series consists of all frequencies that are integer multiples of the fundamental. This is for example the set of notes that can be played on a brass instrument with the valves or slide in a specific position. They first jump an octave, then a fifth, then a fourth, then thirds in the third octave, then finally by the fourth octave the notes are close enough to play a scale, and that is for example the range in which a natural trumpet becomes fully usable. However, the notes only partially match up with the major scale.
 
  • #17
BWV said:
We have 32 Beethoven piano sonatas that would not work on any other piano tuning,
Er, Beethoven did not write for an even-tempered instrument. The sonatas still work pretty well, although compare

to


BWV said:
The whole idea of temperament in western music stems from the desire to move away from a single root note
I would put it slightly differently: if we want to play music in different keys on a single instrument with notes of fixed pitches then we have to find some way to deal with the fact that the circle of fifths is not a perfect circle, or in mathematical terms ## \left ( \frac 3 2 \right )^{12} \approx 129.75 \ne 2^7 ##.

BWV said:
the just intoned maj 7 is a just 5th plus a just Maj3rd.
At least we agree on something :biggrin:
 
  • #18
pbuk said:
Er, Beethoven did not write for an even-tempered instrument. The sonatas still work pretty well, although compare

to
I would put it slightly differently: if we want to play music in different keys on a single instrument with notes of fixed pitches then we have to find some way to deal with the fact that the circle of fifths is not a perfect circle, or in mathematical terms ## \left ( \frac 3 2 \right )^{12} \approx 129.75 \ne 2^7 ##.At least we agree on something :biggrin:

Not sure what that 'pure tuning; is, the tuning of the period was not quite equal temperament, but was close

https://www.danieladammaltz.com/tcp/historical-tuning-rediscover-classical-sound-world

https://en.wikipedia.org/wiki/Well_temperament

point being, you can't modulate to the mediant in just intonation
 
  • #19
Jonathan Scott said:
The harmonic series consists of all frequencies that are integer multiples of the fundamental. This is for example the set of notes that can be played on a brass instrument with the valves or slide in a specific position. They first jump an octave, then a fifth, then a fourth, then thirds in the third octave, then finally by the fourth octave the notes are close enough to play a scale, and that is for example the range in which a natural trumpet becomes fully usable. However, the notes only partially match up with the major scale.
Yes: in particular the perfect fourth, which in just temperament is a simple 4/3 ratio is about a quarter tone sharp.

Which is why I can't understand why the OP has used this intonation for his "major scale" - it contradicts the point he makes so well with the major triad (that equal temperament causes dissonance everywhere).

Compare with just intonation like this https://pb-uk.github.io/temper/(cobbled together quickly).
 
Last edited:
  • #20
pbuk said:
cobbled together quickly
Has an internal link, not connected to the web.
 
  • #21
Vanadium 50 said:
Has an internal link, not connected to the web.
Oops, fixed
 
  • Like
Likes Vanadium 50
  • #22
Bob Walance said:
I haven't tried it on a Mac.
It seems to work fine on my Mac in Chrome, but not in Safari: The two major chords work, but the harmonics only plays 110 hz while the animation continues silently after that. The two "major scales" only play the first two notes, and then stop.

Others have mentioned the 9 note octave problem.

The two major chords at the top do definitely sound different to me.
 
  • #23
Algr said:
It seems to work fine on my Mac in Chrome, but not in Safari: The two major chords work, but the harmonics only plays 110 hz while the animation continues silently after that. The two "major scales" only play the first two notes, and then stop.
Thanks for trying it on a Mac. Are you saying that all of the buttons work properly and play all of the tones in the Chrome browser?
 
  • #24
Bob Walance said:
. Are you saying that all of the buttons work properly and play all of the tones in the Chrome browser
Yes. The only problems were the same as what everyone else was pointing out: 9 notes per octave and so on.
 
  • #25
Algr said:
The only problems were the same as what everyone else was pointing out: 9 notes per octave and so on.
Thanks, Algr. The word 'nonanive' might be appropriate for a diatonic scale that has eight different notes. We would just have to change the layout of the piano - and that is absolutely okay by me. :wink:
 
  • #26
This is a quite good video that explains the whole issue with different kinds of tuning:



I wonder if instead of trying to use 19-tet or other strange solutions, one could deal with the wolf interval by programming synths to change from one tuning to another as soon as the problematic chord was about to be played. What would we call that? Super-Pithagroian tuning?
 
Last edited:
  • #27
Bob Walance said:
Our brains are apparently musically happy when different individual notes are harmonically related to each other.

In our music system, the fundamental frequencies of the different notes on a musical instrument such as the piano or the guitar are related to each other in such a way as to allow them to get as close as possible to the integer harmonics that occur in any given note of the instrument. This system uses what is called 'equal temperament' in the tuning of the different notes. The fundamental frequencies of the notes are separated by a factor of 2^(1/12), so every twelfth note the fundamental frequency of the note has exactly doubled.

I have written a web-based app that demonstrates some of these ideas. It is a work-in-progress.

The top two buttons allow us to hear the difference between an equal-temperament major chord with frequencies f + f*2^(4/12) + f*2^(7/12), and a major chord based on integer-related harmonics with frequencies of f + f*5/4 + f*6/4. To my ear the harmonically-related major chord sounds calmer and sweeter.

The middle button allows us to hear a sinusoidal tone and its seven harmonics separately (f, 2f, 3f, 4f, 5f, 6f, 7f and 8f).

The bottom left button plays an equal-temperament major scale starting at 8f. This scale also includes the dominant 7th for eight different notes (the ninth note is 16f). The bottom right button plays a harmonically-related scale based on tones of frequency 8f through 16f.

Note that I have only successfully tested this app on a Windows desktop pc. I haven't tried it on a Mac. It does not play properly on an iPhone or iPad.

https://bobwalance.github.io/
Algr said:
This is a quite good video that explains the whole issue with different kinds of tuning:



I wonder if instead of trying to use 19-tet or other strange solutions, one could deal with the wolf interval by programming synths to change from one tuning to another as soon as the problematic chord was about to be played. What would we call that? Super-Pithagroian tuning?

I had a student in high school who was really into music find a program that played short sets of notes in normal tempered scale and the "same" set in a perfect mathematical set of notes (or whatever frequencies she typed). The audiences she tested liked the perfect set better, getting her a "most creative" award in the science fair she entered.

ANYWAY, the problems with imperfection introduced by tempering have been "solved" somewhat by two musical forms that have been traditionally followed by rabid fans: String quartets and Barbershop quartets (quartets due to the dominance of four-part chords that really bring out the overtones...in the case of Barbershop, street corner symphony-type doo-wop and other forms of a capella also get four--or more--part chords frequently and also move the frequencies toward mathematical rather than tempered scales.

I remember singing in a quartet and my written notes changed from a, say, Bflat to Csharp. I valiantly held the same frequency during the key change and heard the chord SUCK. Then the lead, a music teacher, told me that for true mathematical harmony I should actually LOWED my frequency during the key change. That resulted in the typical reactions to great overtones: arem hair going up, my mind reacting in enjoyment, and the housecat running around trying to find the bird).

Ten or fifteen years ago I started to shop my idea around of a keyboard that would do what you are suggesting: simply make the same frequency adjustments "on the fly" that singers and string players have made forever in quartets etc. NO takers yet, despite me guaranteeing them millions.
 
  • Like
Likes Algr and berkeman
  • #28
When I was at Harvard in 1977 there was a prototype keyboard like that. I never heard it played though.
 
  • #29
My ageing synthesizer - Yamaha DX7-II - has a choice for the tuning of each patch. You can choose equal temperament, just temperament , Werckmeister and som others I do not recall. I remember changing the tuning of a piano patch to just temperament - and I had to specify which key the just temperament should work in. I specified C, which made the C major chord sound very sweet. But playing a B major chord in C key just temperament sounded horrible!
By the way, a Norwegian composer (Eivind Groven) had special organ made that analyzed the chords and changed the just temperament base to match the chords. Since it was built using electromechanical relays, you could not play very fast on it, but it was an interesting experiment for its time.
 
  • #30
Svein said:
My ageing synthesizer - Yamaha DX7-II - has a choice for the tuning of each patch. You can choose equal temperament, just temperament , Werckmeister and som others I do not recall. I remember changing the tuning of a piano patch to just temperament - and I had to specify which key the just temperament should work in. I specified C, which made the C major chord sound very sweet. But playing a B major chord in C key just temperament sounded horrible!
By the way, a Norwegian composer (Eivind Groven) had special organ made that analyzed the chords and changed the just temperament base to match the chords. Since it was built using electromechanical relays, you could not play very fast on it, but it was an interesting experiment for its time.
It's so cool to hear of these. So if today's processor speeds were applied, there is no reason not to have every chord sound as good on a keyboard as it does on a string
 
  • #31
Laughner said:
It's so cool to hear of these. So if today's processor speeds were applied, there is no reason not to have every chord sound as good on a keyboard as it does on a string quartet or sung by barbershoppers or a cappela groups. I'd buy one.
 
  • #32
Laughner said:
It's so cool to hear of these. So if today's processor speeds were applied, there is no reason not to have every chord sound as good on a keyboard as it does on a string
Don’t see how that would work for traditional classical music - the processor would need to keep track of the key and harmonic context - for example a Gr A6 chord in C major is different than a G#7 chord in C# minor, but the keys on a piano are the same.
 
  • Like
Likes pbuk
  • #33
BWV said:
Don’t see how that would work for traditional classical music
Or for any music. For instance imagine the intro. to Pinball Wizard with microtonal adjustments to the F# drone bass note.

Edit: it's tempting to demonstrate it, but it's also bedtime here.
 
Last edited:
  • Like
Likes BWV
  • #34
BWV said:
Don’t see how that would work for traditional classical music - the processor would need to keep track of the key and harmonic context - for example a Gr A6 chord in C major is different than a G#7 chord in C# minor, but the keys on a piano are the same.
Well, I do not know that classical music will suffer too much - I have analyzed and transcribed a lot of jazz music (mainly "big band") and a lot of the harmonies there sound terrible in any kind of temperament. Examples: Cmaj7 when the arranger adds the octave, Cmi9 when the arranger drops the 9 down one octave etc.
 
  • Like
Likes BWV
  • #35
BWV said:
Don’t see how that would work for traditional classical music - the processor would need to keep track of the key and harmonic context - for example a Gr A6 chord in C major is different than a G#7 chord in C# minor, but the keys on a piano are the same.
The composer/transcriber would have to choose which version of the chord is intended each time. A tune using both versions of the chord in different contexts could highlight something that can't be done in equal temperament.
 

Similar threads

  • Art, Music, History, and Linguistics
Replies
18
Views
2K
Replies
13
Views
2K
  • Art, Music, History, and Linguistics
Replies
12
Views
2K
Replies
8
Views
555
  • Introductory Physics Homework Help
Replies
3
Views
206
  • Introductory Physics Homework Help
Replies
11
Views
3K
  • Art, Music, History, and Linguistics
Replies
13
Views
4K
  • Introductory Physics Homework Help
Replies
5
Views
1K
Replies
58
Views
6K
Replies
11
Views
3K
Back
Top