3 ms·
When using sine waves in a single chord the tuning is much more obvious. I looked at the code and for the major chord it uses: [f * 1, f * 1.2599388379204892,
by zaxomi 9y ago
When using sine waves in a single chord the tuning is much more obvious.
I looked at the code and for the major chord it uses:
[f * 1, f * 1.2599388379204892, f * 1.4984709480122322]
With f = 440Hz it will be [440.000, 554.373, 659.327].
Equal temperament (12-TET) would be:
[f * 1, f * 1,25992104989487, f * 1,49830707687668]
With f = 440Hz it will be [440.000, 554.365, 659.255].
Since it isn't pure it will wobbly a little bit.
In this case it would be better to use "just intonation":
[f * 1, f * 1.25, f * 1.5]
With f = 440Hz it will be [ 440, 550, 660 ].
- joshwcomeau 9y ago(creator here) Thanks for this! To be honest, my music theory isn't that deep; I had never heard of equal temperament or just intonation. I think I just did the math based on a note-to-frequency table I googled. Clearly I have some research to do! I did find the chord a little "off", but I thought that was just me. Originally, the audible frequencies for the other bits were completely outside the western music scale, and so the chord sounded _really_ off.
- zaxomi 9y agoGreat, you found my comment! That explains why I didn't find what tuning you where using. By the way, there is no contact information on the page (if there is, I didn't see it when I was looking for it.)
- joshwcomeau 9y agoYeah, at the very bottom there's a link to my twitter, but you're right, it's not the most approachable way to collect feedback. Sorry about that!
- elihu 9y agoFor what it's worth, it's easy to generate the 12-tone equal tempered scale by starting with 440 and repeatedly multiplying by the 12th root of 2. For a just scale, it's a bit more complicated because there are sometimes multiple options. For instance, a minor seventh might be 9/5, 16/9, 12/7, or 7/4 depending on context. In general, a pretty good "default" 12-note chromatic scale if you want to use JI in a way that works with most normal western music is 1/1, 16/15, 9/8, 6/5, 5/4, 4/3, 45/32, 3/2, 8/5, 5/3, 9/5, and 15/8. (Just multiply the fraction by the frequency of the root note to get the frequency.) 2/1 would be an octave above the root. Just major chords are three tones that make a 4:5:6 ratio, such as 4/3, 5/3, and 2/1. You can think of a major chord as the 4th, 5th, and 6th harmonic of a note two octaves below the root. (1:3:5 or other octave-equivalents are also major chords.) If you add on the 7th harmonic to make a 4:5:6:7 chord (and for this you'll need at least one note not on the scale I provided above), you get a barbershop dominant seventh chord. Just minor chords make a ratio of 10:12:15, which you could also think of as 4/4 : 4/5 : 4/6. The advantages of just tuning are that it sounds very stable and allows precise distinctions between very similar notes. Equal temperament is an approximation of just intervals and has been dominant for the last few hundred years largely because it allows instruments with a moderate number of fixed pitch notes to play in any arbitrary key and with each other.