Harmonicon v0.0.11, or, the harmonica I made up
I tagged v0.0.11. Most of it I already wrote about, so this one is mostly about the chromatic harmonica I shipped, which turns out to be an instrument that does not exist and never has.
I tagged v0.0.11 last night. Or this morning. I’ve stopped keeping track of which side of midnight things happen on.
Most of what’s in this tag I already went on about on Monday, in the weekly update: the harp swapping, the Guitar Pro files, the pitch detectors that turn out not to hear chords. Go read that one if you want the long version, and it is a long version, I checked. This is only about the four things that landed after I wrote it.
Four things. Well. Three things, because one of them was me deleting a line out of a TODO file, and I’m not going to make you read a paragraph about that.
The harmonica I made up
So there was this line in my TODO list, and it said my chromatic harmonica was modelled as reaching less of its range than a diatonic, which is backwards. Chromatics are the ones that get all the notes. That’s the deal with a chromatic. You press the little button on the side and you get the notes in between, that is the entire pitch of the instrument, that’s why it costs four times as much as the other one.
So I went in to fix it, expecting to add a missing technique somewhere, and what I found instead was that the layout in my code was not a chromatic harmonica. It was not a harmonica at all. It was a C major scale going up one note per hole. C D E F G A B C D E F G, straight up, like somebody had typed a scale into an array and gone to lunch, which, in fairness, is exactly what happened, and the somebody was me.
A real 12-hole chromatic is solo tuned. It goes C E G C, then D F A B, and that four hole group repeats up the instrument for three octaves. That repeating is the whole point of it. That’s what makes one fingering work in every octave, that’s the thing you’re buying. Mine repeated nothing. Mine also stopped at A5 instead of C7, so fourteen of the thirty seven semitones between C4 and C7 weren’t reachable at all, on an instrument whose one job is reaching all of them.
Fourteen out of thirty seven. On the chromatic. The one that gets all the notes.
Nobody noticed, and here’s the bad part
Now you’d think somebody would have noticed, and here is why nobody did, and it’s the part that actually bothers me.
Both of the chromatic charts I ship had the made up layout copied into them. Both of them. So they agreed with the code perfectly, and the code agreed with them, and everybody in there was consistent and confident and describing an instrument nobody owns.
One of those two charts, and I want you to appreciate this with me, one of those two charts is the lesson that teaches you the chromatic slide.
So if you had gone out and bought a real chromatic harmonica, an actual physical one, made of metal, by a company, and you’d sat down to learn the slide from my game, the hole numbers would have been wrong. Every one of them. And nothing anywhere would have told you why, and you would have assumed the problem was you, because when you’re learning an instrument you always assume the problem is you, and about nine times in ten you’re right, and this was the tenth time.
Both charts are re-fingered onto the real instrument now. The music didn’t change, and it couldn’t, because every event already recorded the pitch it sounds and those pitches were fine. It was only ever the hole numbers that were imaginary. So I re-resolved each event from its note instead of its hole: thirty three of them in Für Elise, sixteen in the lesson. Not one note moved.
The slide lesson does now teach ten slides instead of fourteen, because on a real solo tuned harmonica more of those notes just sit on a plain reed and don’t need the button. Which is fine. Ten slides is plenty of slides.
And the test that would have caught this doesn’t compare the charts to themselves, because as established they were extremely happy with themselves. It compares them against a tuning this codebase can actually build.
The staff was lying too, only quietly
Two smaller ones, both in the notation strip along the top.
Accidentals were drawn per note instead of per bar. So if a tune leans on one altered note, and blues tunes do, a second position blues leans on its F# all day long, you got the same sharp redrawn in front of every single note. Which looks silly, but it’s worse than silly, because each one is about eleven pixels wide and an eighth note only has seventeen pixels to give in the first place.
They hold for the rest of the bar now, like they do on paper. And every note that cancels one gets a real natural sign, because just skipping the repeats would have left a later plain F in that bar reading as an F#, and I’d have gone from drawing something redundant to drawing something false, which is a worse trade than it sounds.
The staff itself was a fixed thirty four pixels per beat, and a notehead plus the accidental in front of it wants about twenty one, and a sixteenth note was getting eight and a half. They overlapped. Of course they overlapped. It works out the spacing from each song’s own density now, with a cap on it, because otherwise one busy bar shrinks how far ahead you can see down to about a bar and a half, and then you can’t read the thing at all.
That’s v0.0.11. Still 0.0.x, still early, still on GitHub, still, as of this week, no longer shipping an instrument that does not exist.