Show HN: Just intonation keyboard – play music without knowing music (ad8e.pages.dev)
You can play without knowing any music theory. Hit arbitrary notes with the rhythm you want, and the pitches will work. Not understanding the buttons is fine. Even rolling your elbow around your keyboard is fine.
If you are a musician and press the wrong key while playing a song, it will still fit. It will sound like you made an intelligent, conscious choice to play another note, even though you know in your heart it was an accident. Beginner jazz musicians rejoice.
It's not an AI making choices for you; it's just a very elegant interface. What makes this possible is several new discoveries in psychoacoustics about how harmony works. While a piano lays out notes in pitch space, this keyboard is able to lay out notes in consonance space. When you play random notes, they tend to be "close together" on the physical keyboard. Distance on the keyboard maps well to distance in consonance space, so those random notes are close together in consonance space and sound good together.
According to Miles Davis, a "wrong" note becomes correct in the right context. If you try to play a wrong note, the purple buttons you press will automatically land you in the right context, even if you don't know what that context is yourself. So you can stumble your way through an improv and the keyboard will offer the right notes without needing you to think about it.
Harmonic consonance of chords can be read directly off the numbers in the keyboard, which implies that these numbers are a good language to think about music with. It doesn't take years of training, just reading the rules. The key harmony insight that you can do on this keyboard, and not on a piano, is to add frequencies linearly (like 400 Hz + 300 Hz). The reason this matters is that linear combinations of frequencies are a major factor of harmony, in lattice tones. So to see how dissonant or consonant a chord is, you want to check how distant it is from a sum or arithmetic progression. On a piano, to do the same, you'd have to memorize fractional approximations of 2^(N/12), then add and subtract these fractions, which is very difficult. For example, how far is 6/5 + 4/3 from 5/2? Hard to say! But if denominators are cleared, it's easy to compare 36 40 45: they're off by 1 from an arithmetic progression. This also applies to overlapping notes, not just chords. Having all the keys accessible on a piano is very convenient, but this translation layer of 2^(N/12) approximation + fractional arithmetic makes it hard to see harmony beyond the pairwise ratios.
The subset of playable songs is different from a piano, which means that songs in your existing piano repertoire will snip off some notes. Hardware for thumb keys would fix this, so you could play your existing piano songs in full, plus other songs a piano can't play. I don't have such hardware so I haven't implemented this. The other way is to have two keyboards and a partner.
The remaining issue is that there is no sheet music in just intonation. Unfortunately, I have had no success in finding piano sheet music in a common, interpretable format. So while I do have a converter from 12 equal temperament to just intonation, there are no input files to use it with...
62 comments
[ 3.9 ms ] story [ 118 ms ] threadReload the page
Type .,;m
You’ll notice that m is not the “right” temperament as the dom7 in that arpegio
The first is, yes, some of the notes from Debussy are actually poorly playable on the piano. One is this: https://i.imgur.com/K0Wuu3Q.png. This is a visualization I built (and which can't be ported to web easily, so unfortunately it's just something I have for now). It's like a scrolling player piano with rising notes, and the numbers next to the bars are what the numerators are. Note there are two 7s in the middle, and pianos are not good at 7s. I've verified these numbers are correct manually, so it's supposed to sound like that and the piano has an inaccurate approximation. This corresponds to this location in the score: https://i.imgur.com/24XY8vR.png
The second is, I suspect there is a mistake near the end. This visualization overlaps the original with the twelve-tone version: https://i.imgur.com/tS7WzRg.png. Note how some of the bars are separated from each other. I'm currently in the process of checking these notes. My original 12ET -> Just Intonation conversion was automatic and I fixed up all the errors I could find, but I could have missed one. EDIT: yes, there was. I fixed it now.
The third doesn't happen in this example, but sometimes composers want to deliberately round, such as in the Circle of Fifths. That would create unpleasant commas. I'm kind of lucky that it didn't happen in the demo I chose. The Circle of Fifths is not actually an issue; first, you can't keep old notes persistent across the whole circle; they will interfere. And second, thanks to Diana Deutsch's experiments on pitch memory, we know that if there are more than 16 notes between the old and new note, you shouldn't be able to discern the comma. However, although the Circle is not a big deal, other rounding intervals can become an issue, like 63/64, where the composer would like the rounding to occur somewhere other than the exact pitch repeat. Listeners are effective at detecting when an exact pitch repeat is slightly inexact, while they have a harder time discerning slightly-off harmonies.
I think the example also highlights why equal temperament is pretty good if you can't change tuning on the fly. Certain keys (the musical theory kind, not the keyboard kind) will sound completely different. At least equal temperament is equally out of tune from just intonation (how singers and instruments with variable pitch tune chords) for every key.
Something from the well-tempered clavier by Bach would likely work a lot better as a demonstration because it doesn't stray nearly as far from the home key. You could also make it work better by maybe adding in some keybindings to adjust the key like harps use. You probably wouldn't even need to add in 12 modes for it since harmonically related keys still work pretty well. Keys like F and Bb work well together because they are close on the circle of fifths, but F and B (natural) will not since they are basically as far apart as possible.
1: http://www.shapeofmusic.com/note-pattern.php
I gave it a shot but found it difficult to unlearn a decade of traditional piano training. Also, unlike typing in Dvorak, you can't just use software to change the layouts of existing instruments. That said, if anyone knows where to find a high-quality piano with a chromatic layout, I'd love play it!
https://www.lumatone.io/
Check the table in 12 tone equal temperament > Comparison with just intonation section here [1].
Major 7th and major 3rd are both harmonics of the root frequency, so larger differences between JI tuning and 12TET tuning for them cause noise.
In JI, theres a sense where both major 3rd and major 7th are both perfectly in tune with the root frequency. If you play the 3rd two octaves up, all of the harmonics match with all of the harmonics in the root frequency. Same if you play major 7th three octaves up.
The 2 octaves up major 3rds harmonics are 5,10,15,20,… multiples of root. 3 octaves up major 7th are 15,30,45,… multiples of root. The roots harmonics are just 2,3,4,5,6,7,8,9,… so there’s no new frequencies.
If you play square waves with these notes, in a sense you aren’t even playing a chord, just changing the timbre from a square wave to something else.
Kind of tongue in cheek cuz there are other ways of looking at dissonance. This is just an illustration of some ways you might not have seen before!
[1] https://en.m.wikipedia.org/wiki/Equal_temperament
It would be awesome to be able to record the notes to a sequencer, and then play them back, optionally sending via Web MIDI API[1], so that one could control an external synthesizer or VST.
[1]https://developer.mozilla.org/en-US/docs/Web/API/Web_MIDI_AP...
This isn't a fancy keyboard layout over the standard equal temperament notes / frequencies. If I understand it correctly, this is a generator of just intonation frequencies. This will not sound "in tune" of played next to a regular synth I think.
However, it would be hard for me to implement this feature, since I have no midi devices, no midi experience, and my browser (Firefox) also doesn't support WebMIDI.
I'm thinking about implementing record-and-replay, since the playback and storage-format are already done, but midi will likely be deprioritized unless there is significant interest.
This works with micro-semitones, and/or negative values. So for example, if we want to know what 1.5 steps above 432 Hz is we would plug in the variables:
In the case where you know frequencies, and want to get the semitone steps, you're taking the base 2 log. So, Now you'll have the note value of the exact frequency, and you can use the decimal part to set your pre-bend.With the two directions' functions defined it's not so hard to go between frequencies and "notes". And no, you won't be in tune with most gear unless you're using 12TET A5=440Hz
Of course the instrument having hidden state makes all this far more complicated. Would be neat if the key labels would also indicate the absolute note so I wouldn't need to do mental arithmetic here.
EDIT: thanks to your feedback, I added a textbox below the keyboard. It will show how to play things if you can write the ratios of the notes. This may be a helpful map for turning 12 ET into just intonation:
C 16/15 D9/8 6/5 E5/4 F4/3 7/5 G3/2 8/5 A5/3 16/9 B15/8 2
In equal temperament, you can find the frequency ratio of two notes in an interval by raising 2 to the power of X/12, where X is the number of semitones.
Once you know that, you can look for some green numbers that, when divided, would have that same ratio.
So to make a chord, you figure out the ratios. Here's an example for major triads. First, some math to go from equal temperament to ratios. A major third is 4 semitones, so that's 2*(4/12), and a perfect fifth is 7 semitones, so that's 2*(7/12). Those work out to 1.2599 and 1.4983.
They're really "supposed"[1] to be 1.25 and 1.5, i.e. 5/4 and 3/2.
So now that you know these ratios, you can look for 3 numbers that satisfy the two ratios. If you change 3/2 into 4/6, then it becomes pretty clear that 4 and 5 will satisfy the 5/4 ratio (giving you a major third) and that 4 and 6 will satisfy the 6/4 ratio (giving you a perfect fifth). So to get a major triad, you can play 4, 5, and 6.
With similar reasoning, you can figure out that 10, 12, and 15 form a minor triad.
----
[1] If you look at equal temperament as a compromise that doesn't get quite the "right" ratios.
That's supposed to be 2**(4/12) and 2**(7/12) above. I forgot to escape the asterisks. (It's exponentiation, not multiplication.)
Once you understand the basic principles, you're good. But no one has figured out how to explain things to a new person.
The harmonic series or overtones goes:
You could play 1,3,5 to play C1,G2,E3 but this gives notes from three different octaves. What you usually want is C3,E3,G3, and fortunately it's right there: play 4,5,6.That being said I have a few constructive critiques.
First is I wouldn't say it's intuitive. Having the harmonics ascending from right-to-left breaks my brain. Wait, on second look they are kind of scattered about in a somewhat random way? Why are 5 and 3 so far from each other? I might like it if this was laid out in a lattice or some kind of regular structure. I don't doubt that with practice and reading I could learn it but, IMO, if I have to read an instruction manual I'm already checked out..
Second, there needs to be some kind of indication at where I'm at in terms of the internal state of the multiplied ratios. So if I've stacked on 3 consecutive 2/3, the only feedback I get is when I hit a note.. and I might forget where I'm at in the "pitch space". You could just have a simple "stack" at the top that shows the last applied ratio, and maybe the final product or quotient next to it.
The three necessary primes to represent on the organized lattice are 2, 3, and 5. Given a key like 16, each of these primes should be represented in its adjacent buttons, hopefully in an axis-like manner, because these are the consonant notes to it. Left of 16 is 5/4, right is 3/4, and up-down is 2 and 1/2. But why this way?
Consonant pitches stay within a range - so large leaps in pitch are the least common. That means next to any number, the adjacent keys must have close by numbers. That's why the three primes 2, 3, 5, are converted to 2, 3/4, 5/4 - because these are the closest numbers to 1, after multiplying by a power of 2.
Your hand has a harder time reaching vertically than horizontally. 2 is the largest of these three numbers, which is why 2x is on one of the 4 vertical directions, and 3/4 and 5/4 are on the horizontal directions. Furthermore, it means that 2x must be on the 5/4 side, not the 3/4 side - because this keeps pitch distances the smallest.
There's only one remaining decision - why right to left? Your hand has an easier time turning inward than outward. And, whichever way it turns, the horizontal notes should have pitches as close as possible. Thus, 5/4 must be to the left direction.
Luckily, divisors don't exist, so the fact that the 3/4 axis and 5/4 axis are on the same line - rather than 3/4 turning to 4/3 on the opposite side - is perfectly fine.
So thanks to the above, the keyboard is forced to be this way, and every note is in its logical and rightful place, with no subjective choices. Except not, because there's not enough space. And because 7 and 15 can't be on the lattice, so they are just placed wherever there's room. 2 should really be below 1, and 3 should be where 2 is. 30 should be 40, etc. I tried to maintain the structure as much as possible but had to make things fit.
Edit: There are decent guides to designing and hand-wiring keyboards using computer keycaps. I haven't looked far, but something like this https://medium.com/cracked-the-code/a-complete-guide-to-buil... .
The linked layout editor (http://www.keyboard-layout-editor.com) allows pretty wild layouts. Try loading the ErgoDox layout. While you might want to go farther still, it does nicely showcase rotated thumb clusters.
The plate & case builder tool can then generate some basic CAD files for a sandwich keyboard build to fit your keys. This can then be laser cut or something.
Because most designs use a Teensy with USB connection, you might even be able to make the keyboard output MIDI, so it could easily plug into a DAW, or whatever.
The musician probably wants his feet for other things like sustain pedal and effect pedals. I won't be too greedy :)
Though, one possible use of foot pedals is to select the instrument timbre. Since with this layout, you can take the role of two musicians, playing two different timbres, and you might as well have the flexibility to change one instrument out while the other is playing. All your fingers are occupied so it'd be hard to ask them to press extra buttons.
Edit: Interestingly, above were also the result of an experimental musical instrument. See https://kbd.news/0xC-0x33-1525.html
(nothing there now!)
It's not like instruments are totally consistent from one to another in how that sort of thing works. It's not breaking your brain, you just aren't familiar with it yet.
> if I have to read an instruction manual I'm already checked out
Not saying learning this keyboard is necessarily a worthwhile pursuit, but that reads less like criticism and more like an admission that "this just isn't for me". And it raises the question: what kind of instrument would you learn that didn't involve understanding how it works and acquiring muscle memory?
I didn't find a good way to implement absolute frequency without the rest of the visualization too, since it has to store and show "what were the last notes I just played", so the user can compare their frequencies to the current note options. So I don't have an idea for an easy-to-implement design here.
I'm an indie game developer who can do everything other than music, so I often wonder about generating it.
[1] https://teropa.info/musicmouse/
A small suggestion: when you press the purple buttons, it would be neat to see the green numbers change by the multiplier (or have an option to do so). This would let you easily see parts of the keyboard transpose correctly vs not, and what new pitches you get access to. Even sweeter would be a quick animation to show "where the numbers went".
I would also like to be able to have the purple buttons be active only when pressing the keys, so that I could quickly modulate up a just fourth and back. Having to remember where I am in the modulation state is a bit much, and very different from typical musical instruments.
But I've been playing with this for a good while, trying to recreate basic stuff like V7 -> I etc and it's very cool, thanks again.
In the original design, temporary harmony changes (hold-and-release) was the feature of the thumb keys, but there are no thumb keys here, huh.
It's necessary to have stateful harmonic changes, to be able to transition more than a little at a time. But I will add your option too, since it's also useful. I'll need to think about the interface a little bit, since I would either have to add ` or Shift to the keyboard, which will widen it a bit.
When you press these new temporary keys (after they're done), I'll make them change the green numbers. That is hard to do with the permanent purple keys, since they need to keep a base state.
I also like his drone work and have lots of fun with paulstretch.
As a nice touch, you can listen to it before you buy—which I did (and I did): https://robertrich.bandcamp.com/album/neurogenesis
[1] https://www.youtube.com/watch?v=1RS4giQHAUg