Sometimes limitations are opportunities in disguise. Just think about the archaic hardware that powered your favorite video game consoles of yesteryear. The Atari 2600 had a measly 128 bytes of RAM and no video buffer, making it necessary for programmers to define graphical elements in sync with a television’s cathode-ray tube as it traced across the screen. Yet wizard-level programmers created games like Pitfall! and Space Shuttle despite the constraints.
Consider also the console that millions of gamers cut their teeth on — the NES. It may have had a pretty wonky and imprecise sound chip, but no one that has ever played Super Mario Brothers will forget Ground Theme. And who would want to? These classics are so catchy that a large community of enthusiasts is obsessed with making chiptunes in the style of vintage games to this day.
An ATtiny85 interfaces the keyboard with an NES (📷: Linus Åkesson)
Swedish hacker Linus Åkesson is counted among this group of enthusiasts. But while some chiptunes aficionados are perfectly content to code up their music in assembly language, Åkesson was looking for something more interactive. So he decided to make a piano-like instrument out of an NES so it would be possible to interactively explore what is possible with the machine — and maybe even do some performing.
As a first step, Åkesson jumped into the wonderful world of NES programming. After a bit of coding, he had a ROM image that could be executed on physical NES hardware. Using this program, one can select a note with the D-pad of a controller, then press a button to play it. It worked, but this is obviously a terrible interface that is slow and cumbersome to use. A controller may be fine for gaming, but it just can’t cut it as an instrument.
After doing some research, Åkesson came across the 72-key Family BASIC keyboard. That should do quite nicely! But there was just one little problem — it was only released for the Japanese version of the NES, and the connector could not directly interface with Åkesson’s European version of the console.
Fortunately, the keyboard’s communication protocol is well understood, which enabled Åkesson to make an adapter so that it can be plugged right into a standard controller port. This was accomplished by using an ATtiny85 microcontroller to receive and interpret the signals generated by the keyboard, then forward them into controller inputs that can be interpreted by software custom-designed for this purpose. Since the keyboard has several more pins than controllers, data was converted into a serial format by the microcontroller before sending it to the NES.
With this far superior input device ready to go, Åkesson redesigned the software so that each key on the keyboard was mapped to a note, allowing it to be played much like a piano. There’s nothing quite like some interactive chiptune playing to start the day off right! Since building this NES-based instrument, Åkesson has been busy composing music. Be sure to check out his original song, Platform Hopping, in the video below.