The 8-bit Guy on Youtube has an excellent video covering how early computers and game consoles played sound and music 1.
He has split up his video into 3 sections:
The beeper speaker is a very simple speaker controller by the CPU which can produce clicking noises. The CPU would have to time the clicking noises exactly right to produce the required tone. As it runs all the logic on the cpu it slows down the game and the audio produced is CPU limited.
Used in:
In the early 1980s computers started coming with dedicated audio chips to take away the load from the CPU.
Each system would have a different number of Voices/Channels. Basically this allows multiple notes to be plays at the same time as each voice/channel can only do one note.
System | Voices/Channels |
---|---|
NES | 5 Voices |
Commodore 64 | 3 Voices |
The first 2 voices were only capable of producing square waves. The 3rd voice can only produce a triangle and is used for bass notes. The 4th voice can only produce random noise. The 5th voice was for PCM sample sounds but apparently rarely used.
You can see a visualisation of the wave in a play though of Mario bros 3 in the video by Bizqwit below 2:
Although the C64 only had 3 voices, each one could use whatever waveform it wanted out of the following options:
Here are a few of the sound cards developed for the IBM-PC:
Notice that they both use the same audio chip inside (Yamaha YM3812).
9 Voices were available in this chip and similar to the C64 they were independently programmable so each voice could have its own waveform. Unlike the NES where each voice could only use one waveform.
Audio would be built up of small audio clips called “samples”. The concept of a “Mod Tracker” was developed to take advantage of this capability.