Hacker News new | ask | show | jobs
Show HN: Modern music is slightly off tune, here is an instrument that isn't (mhauru.org)
19 points by mhauru 1901 days ago
7 comments

"off tune" seems harsh. It's just a different frequency standard, and that's granting standards are even a valuable to music in general. They might be valuable to specific genres or styles, but listening a lot to electronica (on the synth, dark, experimental side) almost anything can sound good if you make it sound good. Noise and general sounds are common and are incorporated pretty well, so I'm on the fence about picking the frequencies to match across instruments or songs.
agreed. modern music is "off tune" relative to just intonation - which is barely used largely because we have evolved to appreciate the aesthetics of modulation, something that is extremely limited in just intonation. it's perfectly in tune relative to equal intonation.
Weellll, yes and no. Yes, modern music is (mostly) in tune with respect to the chosen tuning system. However, there really is a sense in which just intonation is the harmonically most pure tuning system. The reason musical harmony is a thing at all for human ears is that frequencies related by simple ratios have a special sound to them when played together, which we call harmonious or consonant. geofft does an excellent job explaining why this is the case in one of the comments below, and I provide my own complementary explanation in that thread as well. And just intonation preserves this consonance, these simple ratios, exactly. Sure, it comes at the cost of things like modulation that composers and listeners enjoy, I am not contesting that. Nor am I saying that just intonation sounds prettier, that depends on your taste. But for having a chord sound as resonant and consonant as possible, something I think can be fairly described as being "in tune" without reference to a particular tuning system but only to the physics of sound waves, just intonation is the real deal, and everything else is approximating it.

Also, while I agree that things like aesthetics of modulation are one reason why just intonation is such a marginal thing, another big reason is the difficulty of making and tuning instruments for just intonation, when there's in principle an infinity of tones within an interval, and the whole system changes when you change key. I thought this latter reason is an unfortunate one, and something we could try to overcome with digital technology, hence Jintone.

Musical harmony is all about sound frequencies related to each other by simple ratios, like 3/2 and 5/4. For the past few hundred years Western music has been using a tuning system in which these simple fractions are approximated by powers of the twelfth root of 2. This brings some practical musical advantages, but even the average listener can hear the difference, the loss of purity of harmony. I made an instrument that instead uses a tuning system called just intonation, that uses pure, exact fractions only.

The link opens with the help overlay of the instrument. It reads like a blog text explaining tuning systems and just intonation. If you would rather poke at things than read, then click the X on top left to close the overlay and just play with the thing.

Source code is at github.com/mhauru/Jintone. Comments are very welcome.

would love to hear some justification as to why you feel the average listener - who has been totally conditioned by listening to music in equal temperament for their entire lives - would have sensitivity to what you refer to as "loss of purity in harmony". especially non-musical average listeners.

or are you referring to the idea that people can be trained to hear these kinds of differences?

It's a pretty defensible claim on its own for one simple reason - overtones.

A string, pipe, or other resonating component of a musical instrument, if it resonates at some frequency X, will also resonate at frequencies 2X, 3X, 4X, etc. (Picture a taut string: you can get a standing wave where the whole thing vibrates back and forth, or you can get a standing wave where there's a node in the middle and it looks like the left and right sides are vibrating in opposite directions, or you can get a standing wave where there are two nodes and three components, or so forth.)

These frequencies are exact pitches in just intonation. Let's say that you play a C at octave 3. Its overtones are C at octave 4 (twice the pitch), G at octave 4 (3x the pitch, or 3/2 the pitch of C4), C at octave 5 (4x the pitch), E at octave 5 (5x the pitch, or 5/2 the pitch of C5).

When you play a note on any instrument except a pure sine generator, there are natural overtones because of the construction of the instrument. A guitar or a piano basically introduces random noise into the string when you pluck/hammer it, and the standing waves stay around and resonate, producing the "bright" sound of these instruments from their overtones.

If you play a chord on an instrument, the overtones of the various notes in the chord will line up - if you play a C3 major chord, both the C3 and the G3 have overtones at G4, both the C3 and the E3 have overtones at E5, etc. If you're playing an instrument in C-major just intonation, those notes will line up perfectly. (Moreover, for e.g. a piano with the sustain pedal down, the strings for those upper keys will resonate by receiving the vibrations in the air, even if you're not playing them!) If the instrument is in equal temperament, they won't exactly line up. That is perceptible, even if only slightly, to the non-musical listener.

Of course, the tradeoff is that if you play a C# major chord on an instrument tuned to C major just intonation, they'll line up even worse than they would in equal temperament. Which is why "modern" instruments - which is to say, from at least around Bach's time - have avoided tuning to a just intonation.

geofft gives an excellent answer to this, but I'll try to complement it a bit.

There are reasons grounded in the physics of soundwaves for why frequencies related by simple ratios sound "special" when played together. As geofft explained, they naturally arise in any physical instrument due to how things like strings (guitar, piano, etc.) or air in a tube (wind instruments, etc.) vibrate. Another way to look at this is to think of two waves with wavelenghts that are related in say a 3/2 ratio (wavelength of a wave is essentially just 1 over the frequency of the wave, so you can think in terms of either, but wavelengths are easier to visualise). If you combine two sine waves with such wavelenghts by summing them up, they form a very clear repeating structure, where the crests and valleys of the sum-wave have a regular pattern to them that repeats: https://www.wolframalpha.com/input/?i=plot+sin%28x%29+%2B+si... Whereas if the wavelenghts of the two waves being combined are not related to each other by a simple ratio, the crests and valleys of the sum-wave keep moving and changing instead of repeating: https://www.wolframalpha.com/input/?i=plot+sin%28x%29+%2B+si... When heard as sound, the fixed repeating structure of the combined wave when the two component waves "line up" with each other has a special quality to it, that we would call harmonious or consonant.

So in the above sense, and because of overtones as explained by geofft, just intonation really is special among various tuning systems. Of course there's still the separate question of if the difference between just intonation and 12-EDO (what most music uses) is big enough for the average listener to notice. This you can test for yourself by playing on Jintone e.g. a just intonation major chord, for instance 1/1, 5/4, and 3/2 together, and then the same chord in 12-EDO by clicking the piano keys directly below the tones you just played, so C, E, and G. The difference isn't like night and day, but the latter pretty clearly has an unstable wobbliness in it that's not there in the just intonation version, a difference that I think most people would detect. If you want to make the difference super obvious, click the gear icon on top right and choose the sawtooth waveform, and repeat the exercise. The timbre of the sawtooth waveform makes the difference more obvious for exactly the reason geofft was talking about: It's a waveform that has a lot of very strong overtones in it (kinda the opposite of a pure sine wave), and in the just intonation chord the overtones of the three tones in the chord match exactly.

thanks and this isn't what I'm asking about, I'm aware of all of this (background in physics and in music performance).

of course people can hear and distinguish mathematically pure intervals especially if demonstrated in these ways.

you said,

> This brings some practical musical advantages, but even the average listener can hear the difference, the loss of purity of harmony

which I interpreted as meaning that average listeners are both hearing and actively aware of this difference in their day-to-day exposure to equal-tempered music.

I am very skeptical of this claim, but perhaps this is not what you intended to imply? I can understand why my question would lead to yours and geofft's answers.

Ah, I see. Indeed, I did not mean to imply that the average listener is aware of the short-comings of equal temperament without somebody explicitly providing the contrasting example of just intonation. I merely meant to say that the difference between just intonation and 12-EDO is large enough that even an untrained ear can spot it, when e.g. the same chord is played in both tunings back-to-back. Something that probably wouldn't be the case if for instance all of the 12-EDO approximations would be as close to the just intonation interval as perfect fifths and fourths are.

I would hypothesise that even the average listener might enjoy some pieces of music somewhat more if they were played in just intonation (depends of course massively on the piece whether this is even realistic or a good idea, but given a suitable piece), but I doubt they would be concious of what's making the difference. Not saying I have any evidence of this, but that's my guesstimate of what the answer to the question "how much of a difference would just intonation vs 12-EDO make for the average listener" would look like.

More precisely, modern keyed instruments are slightly off tune. :) I'm pretty sure unaccompanied voices (either solo or in groups) tend naturally towards just intonation in the current key, because you don't think of it so much as "E to G#," you think of it as "up a major third." I'd sort of assume that players of continuous-pitch instruments like violins and trombones also do that instinctively, but I only have firsthand experience with singing.
I play piano, guitar (classical music), and trumpet (jazz).

The guitar is aspirationally tuned in equal temperament — note that one can transpose a piece up by playing in a higher position and it ought to sound the same. In practice, though, I would find myself often bending notes to make them sound better (closer to just), especially major 3rds. Sometimes depending on the key of the piece I was playing, I might even tune a string slightly off so that the major 3rd would sound better. E.g. when playing a piece in D, I might tune the top E string so that the F# (the major 3rd) on the second fret sounded good.

The trumpet is definitely not tuned to equal temperament — but it's sort-of "continuous-pitch" because the player can bend ("lip") notes slightly flat or sharp, depending on the skill of the player and the properties of the instrument and mouthpiece. In practice, I'd find myself lipping to a greater or lesser extend depending on the key I was playing in, which has more to do with the trumpet's physical limitations (it's impossible to actually make it perfectly in tune in all keys) than the details of which tuning system was chosen. Once I know I have to lip notes into tune anyway, I choose the tuning based on what sounds good, rather than aiming for 2^(7/12) or whatever.

Finally I'll note that even the piano, the prototypical example of an equal-temperament instrument, is not tuned according to equal temperament, because the vibrating strings' stiffness means that the overtones are not harmonic. (They're slightly sharp relative to harmonic.) That means that for a piano to sound in tune with itself, pitches are slightly stretched (flat at the low end, sharp at the high end).

Agreed. Although as you point out, the singers being unaccompanied is important. Mixing keyed (or fretted, valved etc.) instruments into the ensemble quickly starts to push everyone towards 12-EDO.

I also wonder how much continuous pitch instruments do this, when playing pieces of music and with ensembles that would allow adjusting to just intonation. If I walk up to a good violinist and ask them to play a simple melody on a single string, do they gravitate towards just intonation, or does muscle memory make them place their fingers for 12-EDO? What about a superbly good violinist?

I'm a violinist! The answer is "it depends". There are so many complexities to tuning that relies on harmony which is continuously changing. Mostly it is done with careful listening and intuition. Even playing with a piano, we won't play in equal temperament 100% of the time.
I don't hear any different whatsoever. I fired up cubase and all of the tones of the keyboard matched exactly to what I was hearing from Serum.

Am I missing something? Do I need to get a spectrum analyzer to see the difference?

Sorry, I could have been clearer in explaining how to actually use the thing. So the keyboard at the bottom is in the regular 12-EDO tuning that we are all used to and cubase does as well. It's the red dots that are the just intonation tones.

To hear the difference, try playing a just intonation C major chord, by clicking the red dots labeled 1/1, 5/4, and 3/2 (hold Shift for sustain to have them ring at the same time), and then the same chord in 12-EDO by clicking the piano keys directly below the tones you just played, so C, E, and G. The difference isn't massive, but you can probably hear it. If you want to make it more obvious, click the gear icon on top right and choose the sawtooth waveform, and try the same thing again.

You can also try playing a 12-EDO E from the piano keys and a 5/4 from the just intonation dots. These are the same tone in the two different tuning systems, and you can hear the "beat" between them, the slow oscillation that comes from them not being quite at the same frequency.

It would really benefit from an instant toggle to some common tuning so you could hold a chord and go back and forth between them.
Are there any songs/tunes available for download in "Jintone" ?
Here's a version of a piece in just intonation—

https://www.youtube.com/watch?v=0i68ifRkitA

—and "modern" equal temperament:

https://www.youtube.com/watch?v=HEbi-7tPaqo

As much as people describe just intonation as pure, etc, at least in this example it just sounds wrong to me.

As far as I understand, just intonation requires instruments to be tuned differently for different keys and stops "working" if a piece strays from the key (which music from Bach's time will often do).

Equal temperament is our workaround for the physics which doesn't quite match the 12-tone system.

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

As far as I know, no one has so far made a piece using the Jintone instrument (it's admittedly quite clunky for actually playing rather than toying around), but there's plenty of music in the just intonation tuning system. To completement ivanmaeder's answer, and to counter balance the fact that most just intonation music tends towards experimental classical stuff, here's a chiptune game soundtrack mostly in just intonation: https://mayazimmerman.bandcamp.com/album/galactic-refugees-o...
This instrument can only play in tune in one key.
At any one time, yes, there's always a root tone and the tuning system is generated with respect to that root. Such is the nature of pure harmony. This is one of the reasons (I would say the main reason) why equal temperament tuning rather than just intonation is dominant in our culture.

You can change the frequency of the root tone in the settings though (gear icon, top right). You have to specify it in Hz which is a bit inconvenient, sorry about that. To compute the frequency in Hz for any tone on the usual piano keys, compute 2^(n/12) * 440, where n is the number of semitones above (n>0) or below (n<0) the mid A that you want the root tone to be. If that's not clear, let me know and I can give you list of frequencies for various tones.

> At any one time, yes,

And changing keys mid-song is kind of passé, at least in popular music, isn't it? At least, the common practice of modulating up a key for a repeat chorus is a cliché.

Edit: Then again, just now I was listening to a song that, while it doesn't have the clichéd upward key change, does move between two major keys. I'm guessing this song, as written, couldn't be played in just intonation. https://music.youtube.com/watch?v=ElsdmXU8dUw And yes, I know I have questionable taste in music.

But you can't even play a chord progression in tune without changing the root tone.

Not dissing this, it's a cool experiment and I like the visualization, but there's a reason strict just intonation hasn't been used for 500 years.

Not sure I see what you mean. Here's the infamous I – V – VI – III – IV – I – IV – V progression from Canon in D in just intonation, with square brackets marking tones that make up a chord (invert the chords to your taste): [1/1 5/4 3/2] – [3/2 15/8 9/8] – [5/3 1/1 5/4] – [5/4 3/2 15/8] – [4/3 5/3 1/1] – [1/1 5/4 3/2] – [4/3 5/3 1/1] – [3/2 15/8 9/8]

Of course, you can't do this for every progression you might enjoy playing, but as an example this one works out quite nicely, with no serious harmonic ambiguity or conflict.