For the past very long time I've been working on a little project while listening to the Scott Pilgrim: The Game soundtrack. It features amazing tracks by IMO the best chiptune-using band, Anamanaguchi. Listening to their songs kept me going on this ambitious endeavor to "use the NES CPU as a Sound Chip". Finally, after about 2 months of development, I've finished my Proof Of Concept. Presenting: The Sonik Unified NES Design for Euphonic Rhythm Experiments. Have a listen here: http://www.youtube.com/watch?v=Yui7YrLShsg&hd=1

It all started when I started playing Scott Pilgrim. An amazing game in its own right, the music just blew me away. I was hooked, and I wanted to know more about how the band made their distinctive chiptune sound. A lot of research led me to a site where they talked about their system in an interview, and I gathered that they used a tracker to compose their songs and then sent that data to the NES using a PowerPak for playback. Gif courtesy http://probertson.livejournal.com/33796.html .

This system is great for recording songs, but how do you play using this system live? You'd have to use your prerecorded tracks, but no one goes to a show to hear a band play EXACTLY what they played on the album. The little nuances, the improv, the 17 minute long solos are the reasons you go see a show. Since Anamanaguchi, and many other chiptune musicians, do play live, I set out to create an 8-bit music machine hat goes beyond emulating an NES -- in that it IS an NES.

First, I set off to try my hand at interfacing the 2A03 directly. Buying a lot of 5 As-Is NES's off ebay, I began my research one step at a time.

None of the NES's were actually broken; they just had bad 72Pin Connectors. After refurbing all the NES's to working order, I took the least healthy machine and gutted the CPU and essentials (crystals, caps, resistors along the audio path). My goal was to recreate all the parts of an NES needed to produce sound using a minimum of parts. After poring over about a hundred docs and websites on programming for the NES, I stumbled across nesdev.com, where I found a good number of very helpful NES gurus. After finding a schematic by kevtris and talking with skrasms, who had tried this idea before, I breadboarded the circuit.

So began my frustrating month of trial and error. Trying everything from different crystals to different support chips to different NES chips, I decided to take a step back and open another NES console. This time, instead of actually taking the parts out, I soldered machine pins into the essential areas of contact (namely the Data, Address, R/W, and reset pins. Plugging breadboard wires into those, and the other side into my Arduino Mega, I began banging the 2A03 with horribly written, poorly timed code. Noise was achieved within a few minutes, but actual notes from other channels were more challenging to produce. It wasn't until skrasms posted his test code that I had enough information to write the code needed, and I finally heard my first square wave.

With my breadboarded project complete and working, I spent the next few days drawing a schematic and laying out a circuit board. I posted the schematic, but not the board; I am doing this because I do not have faith that my board is the best it can be. Download the schematic, and try to layout the parts to make a better board. Because we're only working with ~1Mhz frequencies, I used an autorouter found at http://www.freerouting.net/. I highly recommend this site, and it's pretty fun to watch the applet route your board over and over again until it reaches the optimal design. After about half an hour of rerouting traces which might cause problems later on, I sent my board out to a fab house to be produced. I made my own 2A03 chip for this schematic, which you can get the lbr for here: http://www.soniktech.com/tsundere/nes.lbr. After you've installed that, the schematic can be found at http://www.soniktech.com/tsundere/nessynth.sch. The board the autorouter made in Eagle is here: http://www.soniktech.com/tsundere/nessynth.brd. However, I don't recommend using it, as it has way too many vias. The freerouter mentioned above solved the schematic with 0 vias!

Once I got my pcb in, I realized I made a grave mistake: I forgot to include a pin for the interrupt! I temporarily solved this problem by rerouting the interrupt pin using a wire going into one of the pins of a socketed chip, so that it is held firmly held in place by the chip itself. This mistake is already fixed this in the schematic I posted above.

Now my chip is happily chirping any note I send it from my Arduino Mega. From here on, the project branches out. First I will simply make an open source MidiNES with support for more than just MIDI. Building this project into a cartridge form factor and implementing MIDI is a matter of having a microcontroller translate MIDI into data and address values. Implementing further protocols (USB-based PC tracker?) can be added on with time. After I get that going, I want to flesh out the 'bare bones' nature of the TSUNDERE and implant it into a medium sized electric piano. Some would cringe at the thought of gutting an NES just for the valuable chip inside (if anyone knows of a place to buy bare 2A03 chips cheap in bulk, let me know!), but I feel the demand for a dedicated NES sound board is high enough to justify the work involved. Here is the source code for anyone looking to use an Arduino Mega, or just wants to know which addresses and what data to send to create these sqaure waves: http://soniktech.com/tsundere/nessynth.txt. Final Bill of Materials for this project is: 1x 2A03 CPU, 1x 21.47727 crystal, 2x 15pf capacitors, 1x 56kohm resistor, 2x 100ohm resistors, 7x .1uF capacitors, 1x 220uF capacitor, 1x 74HCT10 chip, 1x 74HCT04 chip, 1x 74HCT138 chip, 3x 74HCT245 chip, 1x 2N2222 transistor, 1x 1k ohm resistor, 1x Arduino Mega, IC sockets and headers. The CPU, crystals, caps and resistors can be scavanged from the NES mainboard, and the chips can be bought on digikey.

So no more iffy NES sound 'emulation'. Now you can truly have a live, playable instrument with a 2A03 at its core! As always if you have any gear (old NES's, MIDI pianos, electric pianos) or anything else that would help this project along, I wouldn't mind paying shipping for it. Contact me at jarek319(remove this part)(~at~)gmail(period)com and we can arrange something =) . Look for a cartridge based system in the coming weeks, and rock rock on!