Actions

SCHG

Mega Drive Audio

From Sonic Retro

The purpose of this page is to give a basic overview of how the Mega Drive handles audio, to help aid in understanding how music and sound effects work in a Sonic game.

YM2612/FM

The Yamaha YM2612 is the Mega Drive's primary sound chip. It is capable of outputting 6 audio channels using frequency modulation (FM) synthesis. Each channel gets 4 operators that output a sine wave. An operator can be configured to output its sound into another operator to modulate the sound further and create more complex waveforms. There are 8 "algorithms" set up that configures which operators feed into which and which operators get added together and get outputted through the channel ("slot" operators as they are called).

MDFMFeed.gif

How feeding from one operator affects a another operator's waveform. The intensity of the feeding is dependent on the volume of the feeder. Animation shows the volume incrementing over time.

MDFMSelfFeed.gif

The first operator can also feed back into itself with 8 feedback intensities.

MDFMAlgorithms.png

The YM2612's algorithm configurations. Shaded operators are slot operators.

Other properties that each operator have include an attack rate (the rate in which it goes from silence to max volume), sustain level (after attack, it will go back down in volume to this level), decay rate (the rate in which it takes to get to the sustain level), sustain rate (the rate it in which it goes to silence after sustain), and release rate (the rate in which it goes to silence after it gets released at any point (like if you lifted your finger off a piano key)). These properties make up an "ADSR envelope" (attack, decay, sustain, release), which describes the overall volume flow of an operator.

MDFMADSREnvelope.png

There's also total level (the overall volume of the operator), multiple (frequency multiplier, the higher the value, the higher the pitch), detune, rate scaline (the rate in which the ADSR envelope become shorter the higher the frequency is), and SSG-EG. SSG-EG basically allows you to repeat the decay and sustain parts of the ADSR envelope after the volume reaches 0 in the initial cycle in an operator in 8 different ways. (Note this only works properly if the attack rate is at max, otherwise, there will be undefined behavior. Not only that, but emulators commonly don't emulate this correctly, either!)

MDFMSSGEG.png

Each channel can also be panned and also have some simple vibrato (amplitude modulation, modulates volume) and tremolo (frequency/phase modulation, modulates pitch) effects using the low frequency oscillator/LFO applied to it. There are 8 available LFO frequencies/intensities, alongside 4 amplitude modulation sensitivities (AMS) and 8 frequency/phase modulation sensitivities (FMS/PMS).

The 6th FM channel can also be swapped for a basic 8-bit sampling channel in which you manually stream sample data. This is commonly referred to as the "DAC" or "PCM" channel. This is mostly used by the Sonic games to play drum samples.

SN76489/PSG

Alongside the YM2612 is none other than the Master System's sound chip, the Texas Instruments SN76489. This chip is often referred to as the "PSG" chip and is a lot simpler than the YM2612. It has 3 square wave channels and 1 noise channel, all with basic volume settings.

The square wave channels are pretty self explanatory, but the noise channel has a few key features. For one thing it has 2 noise types, white noise (like what you hear when you see TV static) and periodic noise (which outputs more of a pulse wave like sound). This channel unlike the other 3 doesn't have a "proper" frequency setting. Instead it has 4 frequency modes. First mode being a higher pitched noise, second being in the middle, and the third being a lower pitched noise. The fourth mode has the third square wave channel share its frequency value with this channel.

MDPSGNoise.png

Mega Drive Sonic Community Hacking Guide
Introduction
Beginner Mistakes | Mega Drive Graphics | Mega Drive Audio | Mega Drive Processing