Raspberry Pi Chiptune Player

I have been staring at a blank screen for whole minutes. There are no words for just how much I love this project. I’ve already been on eBay to find a General Instrument AY-3-8910 series sound chip so I can play with one myself. Before we get into details, feast your ears.

vmw ay-3-8910 ym player

Raspeberry Pi Driving an AY-3-8910 sound chip It’s playing “intro2.ym” by Surgeon (Aleksy Lutsenko) More details on the setup can be found here: http://www.deater.net/weave/vmwprod/hardware/ay-3-8910/

What’s going on here? The Raspberry Pi is playing chiptunes by serving the files directly on to a AY-3-8910 (brought direct to you from the 1980s), while doing some rather jolly LED visualisation too.

The AY-3-8910 is no longer made: it was a piece of kit you’d find in most arcade machines, games consoles and home computers in the 1980s (if you had a ZX Spectrum, an Amstrad CPC or an Apple II, you’ll be familiar with its gorgeously grungy bleeps and bloops). Nowadays there’s dwindling stock that goes to service old machines, or to make entirely new things that’ll play chiptunes – like this beast.

chiptune player

Vince Weaver, the maker, says:

The AY-3-8910 is fairly straightforward. Three channels of square waves plus various noise and envelope effects. Provide a clock (1MHz in our case) and there are 16 (well, 14) on-chip registers you write to. Just put the address then the 8 bit value on the bus, toggle the 3 bus control pins, and you are set. You’ll want to do this fairly fast. A typical YM music file wants you to write all 14 registers every 50Hz.

I use the Pi’s GPIOs to shift an 8 bit value into a shift register. Then I use a few more to drive the control bus.

Visualization is done with some i2c LED displays.

The amplifier is an LM386 design from the AY-3-8910 datasheet.

Vince has plans to make some improvements (adding stereo, printing a PCB, swapping out for a better amplifier, using SPI to drive the shift register instead of GPIO and refining the software), but even in this prototype version, this is a piece of kit I’d love to have on my desk. Fortunately, we can replicate the project: everything you need is on Vince’s website and on GitHub. Thanks Vince!