Relive the fun of early computer game music with an authentic 8-bit chiptune synthesizer, which you can control over MIDI from the comfort of any modern DAW software.
This simple circuit uses an Arduino to drive an AY-3-8910 programmable sound generator chip (or one of its many clones) to recreate that 1980's sound. Unlike the many designs that need specialised software to edit music, this looks like a standard USB MIDI device. The synthesizer has a clever algorithm which tries to keep the most musically-relevant notes playing; in many cases you can throw un-edited MIDI files straight at it and the tune comes right out. Total cost should be about £20.
The full parts list for this, as you see in the pictures, is as follows:
Prototyping board, 3" by 2" approx. I bought a bulk pack of these, again on Amazon.
You will also need a soldering iron, solder, wire cutters, pliers, and a wire stripper.
Alternative programmable sound generator chips
The YM2149 I used is a clone of the original General Instruments AY-3-8910 IC. (The first prototype used an AY-3-8910 I bought from eBay, but it turned out the white noise generator wasn't working. Sad face). You can use either for this project without any changes.
General Instruments also made AY-3-8912 and AY-3-8913 variants, which was the same silicon inside smaller packages, without some extra I/O pins. These pins aren't needed for any audio purposes, and this project doesn't use them. You can use an AY-3-8912 or -8913, just follow the pinouts shown above.
Alternative Arduinos
The "Pro Micro" I used is a copy of Sparkfun's Pro Micro board. If you're not confident with Arduino code it's best to stick with this; if you're happy to adapt the design, you'll need the following specifications
The Arduino Leonardo and Micro boards both fit the bill, although I haven't tried them.
Other components
The resistors and capacitors used here aren't particularly special. Any parts of (approximately) the right value should work.
To build the circuit, it's best to start by positioning the sockets, then add the resistors and capacitors. We'll cover wiring these together in the next step.
Using the picture above as a guide, position the 40-pin IC socket, turn the board over and just solder in two opposite corner pins first. If the socket isn't then lying flat against the board, it's easy to fix by resoldering one or other pin. When it's OK, solder the rest.
Position the two 12-pin sockets, then insert the Arduino into them to hold them vertical and steady during soldering. Again, soldering two pins at each end first will allow a check before final soldering.
For the audio output socket, I used a small drill to enlarge the PCB holes, as the mounting tags are rather large.
Once the major components are positioned, they can be wired up on the back of the board, following the circuit above.
The audio output components (R2, R3, C2, C3) and decoupling capacitors (C1, C4) can be connected up with solid-core wire (or off-cuts of component leads). The ground and power connections from the Arduino to the PSG chip (red and black wires, in the picture) can now be made.
The Pro Micro's various outputs are wired up to the AY-3-8910 as follows (see the hookup guide for pin assignments):
Signal Arduino AY-3-8910 pin DA0 D2 37 DA1 D3 36 DA2 D4 35 DA3 D5 34 DA4 D6 33 DA5 D7 32 DA6 D8 31 DA7 A0/D18 30 BC1 D10 29 BC2 MOSI/D16 28 BDIR MISO/D14 27 RESET# SCLK/D15 23 CLOCK D9 22 (via R1, 75 ohm)
If you're new to Arduino, I'd strongly recommend trying one of the many tutorials on the basics. Sparkfun's hookup guide gives full details. You can check that the basic programming is working by following the "Blinkies" tutorial. Arduinos can be a little tricky to persuade into 'bootloader' mode (where you can load new sketches), so a bit of practice with a simple example is useful.
Once you're happy, download the chiptunes.ino file attached to this page, and build and upload it. (I've found that using the "Arduino/Genuino Micro" board type is OK for this sketch, if you want to skip installing the Sparkfun board support).
Also, note that if you're on a Mac, the "Port" setting will need to be changed once you've loaded the sketch for the first time. With a 'blank' Arduino (or using the Blinky sketch) it will appear as something like /dev/cu.usbmodemXXXX, as shown in the picture above. When the USB MIDI device is active (as used by the chiptunes.ino sketch) it will be /dev/cu.usbmodemMID1.
Once the Arduino is programmed, your workstation should automatically recognise it as a USB MIDI device. It will appear with the name 'Arduino Micro' - you should be able to see this on Device Manager in Windows, or the "System Information" app in Mac OS.
On a Mac, you can use the Audio MIDI Setup app to run a basic test. Start the app, then choose Window -> Show MIDI Studio. This will bring up the MIDI Studio window - all your MIDI interfaces will appear in a slightly random arrangement - which hopefully will include the 'Arduino Micro' device. If you click the 'Test Setup' icon in the toolbar, and then click the down arrow (see picture) on the Arduino Micro device, the app will send MIDI notes to the synth. (These aren't particularly tuneful!) The synth should make some random sounds at this point.
You can then add 'Arduino Micro' as an output device to your Digital Audio Workstation's MIDI setup, and start to play!
https://www.midi.org/specifications-old/item/gm-level-1-sound-set) are accepted.
And that's about it. Have fun!
About the demo tune
The demo tune - Mozart's famous Queen Of The Night aria - was created reasonably quickly from a MIDI file I found on the Internet (https://www.midiworld.com/mozart.htm). Someone else did all the hard work!
I'm using Presonus Studio One on a Mac, and the MIDI file was imported to four separate tracks. A small amount of editing was needed where the accompaniment notes are higher than the main tune, and to remove some of the more objectionable glitching between notes.
The audio you hear on the clip is straight from the synth, with just a touch of EQ and saturation to give it a bit of an 'arcade machine' low-fi feel.