The audio capabilities of this console are somewhat unorthodox, to say the least. On one side, the Mega Drive incorporates audio technology from the previous generation. On the other hand, it introduces a novel (yet complex) synthesis technique. So, in some ways, you get two generations in a single console.
That being said, the Mega Drive is equipped with two sound chips: A Yamaha YM2612 and a Texas Instruments SN76489.
Functionality
Let's now see what each chip offers, as they are very different.
Yamaha YM2612
Sonic The Hedgehog (1991).The Yamaha YM2612 is an FM synthesiser that provides six FM channels, one of which can play Pulse-Code Modulation (PCM) samples instead. It operates at one-sixth of the 68000's clock speed and outputs one channel at a time, but it alternates between each channel every four cycles to create the illusion of generating all six channels at once . For this reason, the Yamaha YM2612's sampling rate is ~53 kHz. Furthermore, it accepts PCM samples with a resolution of nine bits . Yet, the ninth bit was never officially documented so commercial games only sent 8-bit samples. Apart from that, its bus is connected exclusively to the Z80.
Frequency Modulation (FM) synthesis is one of many professional techniques used for producing sound. It significantly rose in popularity during the 80s and made way to completely new sounds, many of which you can find by listening to the pop hits from that era (I would give you a list but my music taste is a bit experimental).
In an incredibly simplified nutshell, the FM algorithm takes a single waveform (carrier) and alters its frequency using another waveform (modulator). The result is a new waveform with a different sound. The carrier-modulator combination is called operator and multiple operators can be chained together to form the final waveform. Different combinations achieve different results. The YM2612 allows four operators per channel.
Compared to traditional PSG synthesisers, this was a drastic improvement: You were no longer stuck with predefined waveforms.
Texas Instruments SN76489

Video - PSG Channels.
Sonic The Hedgehog (1991).
The Texas Instruments SN76489 is a Programmable Sound Generator (PSG) capable of producing three pulse waves and one noise channel.
This is actually the original sound chip from the Master System, now embedded within the VDP. It runs at the speed of the Z80.
Programming the PSG involves writing to a single 8-bit location (called PSG port ), and both CPUs can do so. Behind the scenes, its bus is connected only to the 68000, but the Bus Arbiter seamlessly manages access when the Z80 writes to it.
Notice in this example, the 'Pulse 3' channel remains muted. This is because the game activates a mode that reserves the third pulse for modulating the noise channel , a function featured on the Master System as well.
Mixed

Video - All audio channels.
Sonic The Hedgehog (1991).
Both chips can output sound at the same time, then an extra component called Audio Mixer is responsible for receiving and combining both signals.
Finally, the resulting analogue signal is transmitted through the audio output line.
The conductor
The Z80 is an independent processor by itself, so it needs its own program (stored in the 8 KB of available RAM) to interpret the music data received from the 68000 or the cartridge ROM and effectively manipulate the two sound chips accordingly. This program is referred to as a sequencer or driver.
Nevertheless, the design of a sound driver is not completely dependent on the Z80 CPU. While the Z80's memory map suggests that this is the only processor capable of commanding the two audio chips in unison (which may be a relief for the 68000, as it is already fed up with other tasks), the Bus Arbiter can still shut down the Z80 to grant the 68000 access to the YM2612 . This is not as efficient but it's still another option for programmers to consider. For instance, the first Sonic The Hedgehog implemented its sound driver on the 68000, whereas later entries offloaded this task to the Z80 .
Cracking sampling
Rather than sticking with ordinary drum kits, there have been occasions where music composers pushed the PCM channel to produce more natural sounds. Since this could only be implemented through software, games had to continuously sequence and stream their music without exceeding the Z80's limits. The main constraint was that, to fill its RAM during sequencing, the main bus had to be blocked first (preventing commands or samples from being sent to the audio chips during that timeframe). Otherwise, sound anomalies such as muting, frozen notes, or low sample rates could appear.
While an unaffordable challenge at first, certain games overcame this with the help of creative techniques. For instance, Traveller's Tales' Toy Story (1995) allocated the 68000 for sequencing the music . This was a highly intensive task, meaning it could only be executed at very particular points of the game, such as the main menu.
Oscilloscope view of Sonic The Hedgehog 3 (1994). Its soundtrack was rumoured to have been co-authored by Michael Jackson.
(Video) Oscilloscope view of Toy Story (1995).
While one can argue it's still miles ahead from achieving CD-quality (16-bit at 44.1 kHz), the advancements made compared to its predecessors certainly deserve recognition. And it is always this type of skill what pushes the boundaries of music in the next generation of consoles.
Assisted FM Composition
Programming an FM synthesiser was already considered complicated using the Yamaha DX7's dashboard - now imagine the headaches of composing music with only 68k/Z80 assembly...
Fortunately, Sega later distributed a piece of software for MS-DOS PCs called GEMS to simplify the composition (and debugging) of Mega Drive music . This comprehensive tool included numerous patches (pre-configured operators) to choose from, which may explain why some games have very similar sounds.
Moreover, their audio driver enabled games to instantiate more channels than the hardware allowed. With the use of priority values, the console played the music by dynamically dispatching channels to the available slots. Additionally, channels with high priority but no music were automatically skipped.
Channels also incorporated some logic by embedding conditionals within their data, allowing music to 'evolve' based on the player's progress in the game.
(Bonus) Mega CD Sound
Here is an interesting fact, the Mega CD add-on provided two extra channels for Audio CD (among other things). One of its most famous games, Sonic CD, featured very impressive compositions but, like all games, it had to loop. The problem was that looping tracks on a 1x CD reader exposed noticeable gaps. So, the game included loop fillers that were executed from another PCM chip while the CD head was returning to the start.
For some reason, these fillers are only found on early betas of the game and they didn't make it for the release. However, the 2011 remake finally included them.
Click to listen
Audio - MegaCD version (1993).
Click to listen
Audio - Remastered version (2011).



