Saturday, July 12, 2014

Pushing the Limits : PC Sound Chip Digitized Sound

The PC Speaker was the most limited of all sound devices for the PC.  Unlike later dedicated sound chips, the timer-driven PC speaker had no programmable capability to change the volume.  The typical PC Speaker outputs a square wave.  A square wave is suitable for representing a musical note, but not digitized audio.  A square wave is notable because the voltage level spends the same amount of time high as it does low.  If the voltage period varies (it spends more time high than low, or vice versa), it is no longer a square wave.  Additionally, if the frequency changes faster than the speaker can cope, you can get intermediate positions in the speaker cone between full expansion and full contraction. The end result is something approximating 6-bit digitized sound.  The quality of the resulting audio varied considerably on the size of the speaker cone (IBM PC=big, Tandy = bigger, PCjr. and some PS/2s = tweeters (bad)).  Some good samples of the digitized PC Speaker can be found on my friend Trixter's page :

The first practical, widely supported digital audio devices in PC games were the Tandy digital sound chip, known as the PSSJ (parallel, serial, sound and joystick), and the Sound Blaster's DSP (Digital Signal Processor) chip.  Both had access to a hardware interrupt (7 for Tandy, 7 by default for Sound Blaster) and a DMA channel (1 for both) to feed a DAC without requiring much processing time.  There was also a parallel port sound device called the Covox Speech Thing, which required the CPU to feed data bytes to the a resistor network attached to the parallel port.  The result was a crude 8-bit DAC

Between the PC speaker and the DMA-driven Earlier music devices were generally programmable sound generators, essentially using variable frequency square waves and frequency modulated sine waves to produce sounds.  None of them had natural DAC functionality.  However, these could be tweaked to simulate the effect of a crude DAC.

The PCjr. and Tandy 3-Voice chip, the TI SN76496 and its clones, was quite a bit more capable than the PC Speaker.  It had three square wave generators as opposed to the single square wave of the PC Speaker.  Additionally, it had a 4-bit volume control for the chip's output.  This volume control, combined with one of the square waves, could be used as a DAC.  The Game Blaster SAA-1099 chips operated very similarly to the Tandy chip (but with six channels per chip instead of three) and thus were also capable of using this method.  The Adlib YM-3812 chip used two operator frequency modulated sine waves to produce sound.  There are eighteen operators in total, and each could be manipulated via multiple registers.  Each operator has a 6-bit volume control, giving 6-bit DAC functionality.  Similar methods could be used to produce digitized sound as with the less-advanced devices.

As a sidenote, these methods were also used for other, non-PC chips.  Programmgers for the Commodore 64 used such methods to allow the MOS 6581 SID chip to produce an approximation of human voice for the classic game "Impossible Mission" and others.  The impressive digitized sound effects of Dungeon Master for the Atari ST were produced solely by the high-clocked AY-3-8910 clone in that machine, the YM-2149.  The Atari TIA (Quadrun) and POKEY chips could also handle digitized sound.  All these chips have 4-bit volume controls like the TI and Phillips chips, so the same methods can be used to get digitized sound out of them.  The NES 2A03 had a 7-bit DAC that could be fed directly by the processor and could also employ a delta modulation technique for digitized sound.

There are several disadvantages to this method.  First, the result will definitely sound "lo-fi" and is often very quiet.  Second, it requires a lot of processor time, because the processor has to send a lot of data directly to the device to make it work faster than it should.  Third, it requires much more space to store a sample than a chiptune, and in the era of 360KB and 720KB floppy disks, the room for digitized sound was limited.

As far as PC games go, outside digitized PC Speaker, the effect was seldom used.  An early use of the effect was in Imagic's Touchdown Football for the PCjr.  It's digitized voice only played back properly on a PCjr., the faster Tandy 1000 would make the voice sound like a chipmunk.  The game was later ported to Tandy 1000, and the voice played back at the correct speed.

Electronic Arts used Tandy digitized sound in several titles.  Among them are Kings of the Beach, 688 Attack Sub and Skate or Die.  My friend Cloudschatze has some comparison videos between the Tandy 3-voice sound and C64 SID sound on his Youtube Channel, see here :
Interplay used it for the sound effects in the original 16-color version of Battle Chess.  Epyx's Storm Strike uses for voice samples in at least two places.

Capstone's Bill and Ted's Excellent Adventure utilized it for the Adlib, as did Interplay's/Delphine Software's Another World/Out of this World.  Another World also supported the Sound Blaster, and the sampled sound effects sound far superior with the Sound Blaster.  GameTek's Super Jeopardy supports Adlib for digitized music and it may also support digitized playback with the Innovation SSI-2001, which also used a MOS 6581 SID chip.

Sir-Tech's Wizardry : Bane of the Cosmic Forge and Wizardry : Crusaders of the Dark Savant supports digitized sound through the Adlib, even if Sound Blaster is selected.  The game also supports digitized PC Speaker sound, and in DOSBox, you must select PC Speaker sound.  Crusaders allows you to select a music device independently of the sound device.  Some games, like Budokan, support digitized PC Speaker for sound effects regardless of sound device selected.  Dragon Wars is one of many games that supports digitized PC Speaker sound even though the Tandy 1000 and other sound cards were available by the time of its PC port's release.

Activision's OmniMusic driver, used in F-14 Tomcat, BattleTech: The Crescent Hawk's Revenge and Joe Montana Football, support digitized playback with Adlib, Tandy and Game Blaster.  BattleTech's PC Speaker digitized sound is more limited, because there is no voice in BattleTech whereas there is voice with every other sound chip.

While DOSBox can support digitized PC Speaker music reasonably well, it utterly fails to render digitized Tandy, Adlib or Game Blaster music.  Usually the result is muted, muffled or virtually inaudible.  This is one area where you still need real hardware to hear the music and sound effects as the creators intended.


badmojo said...

Interesting article thanks. The PC speaker has a bad name and perhaps rightfully so, but I quite like it for some games. The opening music for 'Street Rod' is a good example and I can still play it in my mind to this day. id's use of the PC speaker was also quite memorable (in wolf3d, etc).

I've also come across some games that use RealSound ( recently and it's an interesting effect too. That + a PAS16 (which intercepts and plays PC speaker sounds from the ISA bus) is not a bad way to experience what PC speaker has to offer.

notagain001 said...

i luv when u discuss tandy 1000

the pc of my early childhood.

Omer Mor said...

The game Zeliard used some PC Speaker magic to play polyphonic music with 3 simultaneous voices.

Omer Mor said...
This comment has been removed by the author.
Omer Mor said...

just noticed that I can't find any mention of this unique capability of Zeliard on he internet. So here goes:
Configure the game to use PC Speaker for music.
While running the game, the F1 key toggles between the following modes:
- Music On; Single Channel
- Music Off;
- Music On; Multiple Channels
- Music Off;

Brassic Gamer said...

The first time I was blown away by a PC speaker was when playing Pinball Fantasies for the first time, and also started my love affair with tracker music generally. I'd never heard actual music on the PC speaker before this.