We Got Your Sega Chiptunes Right Here

Chiptunes are cool, but when you get into it, you realize you’re mostly dealing with Commodore SID tunes, Atari POKEY tracks for the cool kids, bleeps and bloops from a Game Boy, and maybe some NES tracks thrown in for good measure. There’s another option out there – the sound chip in the Sega Genesis. This thing could do drums, man, and [Aidan Lawrence] built the perfect player for the tuneful silicon tucked inside the classic 16-bit console.

[Aidan] had previously built a tiny little music player based on the YM3812 chip, the Yamaha chip found in SoundBlaster and Adlib sound cards. The chip inside the Sega Genesis, the Yamaha YM2612, is a bit different. The killer feature of this chip, PCM waveforms, aren’t stored as simple, small bits of code. These are massive blobs of binary data sent to the chip’s DAC. The SEGGGGAAAA intro of Sonic the Hedgehog, for example, used an eighth of the the cartridge space. You’re not going to build a Sega chiptune player with a tiny little microcontroller and 20kB of RAM.

The solution came in the form of an external SPI RAM device. The 23LC1024 is a full 1 Megabit in size, and since it’s SPI, it’s more than fast enough to keep up with the sample speed. The rest of the circuit including the mixer, preamp and power amp are based on the Genesis’ actual schematics, with an SD card and OLED thrown in for good measure. How does it sound? There’s a great video below the break and yes, the soundtrack from Sonic 3 sounds just as good as it did twenty years ago.

14 thoughts on “We Got Your Sega Chiptunes Right Here

  1. //”The SEGGGGAAAA intro of Sonic the Hedgehog, for example, used an eighth of the the cartridge space.”//
    Interesting..That was the crappiest sounding clip on the whole cartrage and yet it was huge. (sounded like it was clipping) Everything else sounded clear and wonderful. ….wierd.

    1. That’s because the SEGA chant is a PCM sample, meaning that it was a large collection of raw voltage values (represented as 8-bit numbers) sent to the YM2612’s DAC in order to produce a sound effect. This chant sample was highly compressed in order to fit on the cartridge, which is why it sounds pretty bad. Other sounds on the YM2612 are synthesized in real time using FM synthesis and that is why they sound so crisp and clear. FM Synthesis does not require a whole lot of data per second in order to function properly since you are just setting a few registers to change the waveform and tell the chip when there is a “key down/key up” event, but PCM samples require a constant stream of information in order to sound correct. That means that PCM samples usually take up a big chunk of the total data required to play a music track, even though the majority of the song is likely FM synth. PCM samples are also often used for drum sounds, voice clips, and sound effects.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.