without an e

the turcanator [09/26/2006 00:20:04]

I'm trying to stick to one project at a time. I really am. Last week I worked out a whole plan for the webappworkshop site and what needs to be done to get my framework set up, and spent endless hours wondering if it's even worth it to publish yet another framework. Short answer: probably not, but the habit I'm trying to cultivate of sticking to things and doing what I say I'm going to do rather than following one idea after another and getting nowhere. So I'm sticking with the workshop framework.

But between all that thinking, and being sick in bed the past few days, and having my iBook and my midi keyboard close to the bed, and having that other goal of learning to play Rondo Alla Turca... And since I had some old pyrex code lying around from an earlier experiment that wrapped apple's CoreMIDI library... Well, I wrote a little app to help me learn piano. I call it the turcanator.

turcanator 0.1 screenshot

The interface is modeled after a piano keyboard. The light and dark vertical stripes correspond to the white and black keys on the piano. One row at a time is highlighted, representing a point in time. The dark blue squares indicate which notes ought to be playing (or which keys ought to be pressed) at that moment. The lighter blue squares are for longer notes. This screenshot is showing a bunch of eighth and sixteenth notes. The conversion from midi isn't perfect yet (for example, some of the eighth notes are incorrectly split into sixteenth notes), but what you're seeing is an approximation of the first four measures of Rondo Alla Turca. Even with bugs, this matrix or piano roll view is a whole lot easier for me to understand than the traditional notation:

turcanator 0.1 screenshot

I can read simple melodies just fine, and I can deal with chords where the notes are the same length, but once I start trying to cope with notes of different lengths happening at the same time, my brain just kind of locks up. There are at least two separate skills here. One skill is decoding the music to figure out what happens when, and the other is getting your hands and fingers into the right place. I'd much rather deal with these issues separately.

The piano roll view handles the first problem: simplifying the notation. Lots of music programs offer this view, though it's usually turned 90° counterclockwise, so that time flows left to right as with normal sheet music. I found a nice midi player for the mac called rondo that rotates the view the way I want it. But like I said, this only handles the notation problem.

Turcanator addresses the notation problem, but it also addresses the fingering problem, because it actually hooks up to a midi keyboard and gives you feedback on your playing.

The highlighted row can contain red and green boxes as well as the normal blue boxes. Here, the blue boxes still represent keys that ought to be pressed, but when they actually are pressed, they turn green. The red boxes represent keys that are pressed but should not be. The colors change in real time, so you don't have to look at the keyboard to see if your hands are in the right place. So in the screenshot, I've hit an F when I should have hit the E right next to it.

Whenever the keys that you have pressed match the keys you should have pressed, the highlight bar moves down to the next row. There's no timing mechanism yet, so you can't check your tempo. I may hack that in at some point, but it's actually quite usable already. I'm slow and I make a lot of mistakes, but I'm able to make it through the first section. (I broke the piece up into separate midi files for each repeating section, and just haven't worked with the others yet.)

The latest feature is the orange bar on the left. Normally, when you reach the end of the screen (the section I'm working on fits on one screen, so I haven't had to mess with scrolling), you loop back to the top. The orange bar lets you narrow this looping behavior so you can focus on practicing only certain notes. You just use the up and down keys to position the highlight bar, and the left and right bracket keys to mark the beginning and end of the loop.

So, that's the turcanator. I haven't decided what I'm going to do with it yet, other than practice learning that song. I actually found the idea for this in a book many years ago. It was the main reason I bought the MIDI keyboard, and that was maybe seven years ago. Anyway, the code is really ugly, and I'm not ready to give it away. I might even make a shareware product out of this next year if it proves useful. We'll see.

(new comments disabled for now)