Tuesday, July 7, 2015

The First Sound Card

The Ad Lib Music Synthesizer Card may not have been the first add-on expansion board for a PC compatible computer that could generate sound, but it was undoubtedly the most important sound card ever made. In this blog entry, I will give an overview of the hardware and software that made Ad Lib synonymous with good PC sound.

Hardware

The Ad Lib came in two revisions, the 1987 version and the 1990 version. The 1987 version has a 6.35mm or 1/4" phono jack connector and the 1990 version has a 3.5mm mini-jack. The 1990 version also has two extra decoupling capacitors to reduce the effects of noise. The audio out can drive passive speakers and lower-impedance headphones.

The card itself was made entirely from off the shelf parts and a pair of specialized sound integrated circuits. All of the 1987 cards and some of the 1990 cards have he part numbers scratched off the Yamaha chips, but some 1990 cards have the part numbers on them. The larger chip is the Yamaha YM-3812 FM Operator Type-L II (OPL2). It is responsible for all audio generation. In FM Synthesis, sound is produced when one sine wave, the modulator wave, modulates another sine wave, the carrier wave. Each sine wave is called an operator and there are eighteen operators in a YM-3812. In the default mode, each pair of operators is assigned a channel, so you have 9 channels available. Each operator can have various settings assigned like Vibrato, Tremolo, ASDR and output level. The settings for each operator pair can be called an instrument. In the alternative mode, twelve pairs of operators are assigned to 6 channels and the rest are used to produce 5 percussion instruments. The smaller chip is the Yamaha YM-3014 Serial Input Floating D/A Converter (DAC-SS). It turns the digital audio output from the YM-3812 into an analog signal suitable for amplification.

Ad Lib's attempt at secrecy was short-lived. By the end of 1989, its competitor Creative Technologies was already advertising its "Killer Card" (which would become the Sound Blaster), which included full Ad Lib compatibility. Ad Lib clones appeared fairly quickly because the card was easy to clone once you figured out what the mystery chips were. Ad Lib released programming information giving the abilities and register specifications for the chips. Because the chips were not custom components (otherwise why scratch the part numbers off?), and it used FM Synthesis, it had almost certainly to come from Yamaha. The price point and chip packaging must have narrowed down Yamaha's IC line considerably. It was only a matter of time before the secret was out, and Ad Lib, a small French-Canadian company at the time, was in no position to obtain exclusive rights to use the chips from Yamaha.

When you look at either genuine board, you instantly notice the Ad Lib company logo. I do not recall seeing an earlier PC expansion card printed circuit board with so striking a design. Most PC expansion boards just have the name of the product labeled in ordinary text somewhere on the card, and many do not even have that, leaving someone to have to deduce the card's identity and function. It would be a long time until we saw something as equally stylish (even though you would only see it when you opened the computer.)

However, you will also notice two sets of solder pads. The first, with the "3 5 2" numbers above it, was to assign an IRQ to the card. The card would fire off an IRQ when after one of the timers had reached zero. None of these three pads are connected and no software would ever expect them to be connected, so this functionality was in practice never used. The timers were typically used polled to auto-detect the card.

The second set of pads, "A B C D", allowed the user to change the I/O address from 388/389H. This allowed the user to put four cards in a single system. The other addresses were 218/219H, 288/289H and 318/319H. Very little software ever supported the Ad Lib at an address other than the default. The days when hardware hackers would routinely modify their hardware with a soldering iron was rapidly coming to a close during Ad Lib's early days.

The Path to Success

When the Ad Lib was first released in 1987, it did not instantly set the PC world alight and inspire software developers with new visions of affordable music. The Ad Lib was marketed first as a music creation device using a program called Visual Composer to put notes on sheet music. It appears to have only come bundled with the Visual Composer software and cost $245.00. Music creation software was nothing new to the PC industry, Electronic Arts Music Construction Set and Mindscape's Bank Street Music Writer were already on the market and had done well. The former worked with a PC Speaker in 1-voice or 4-voice mode, the PCjr. or Tandy 3-voice chip and the latter came with a 6-voice sound board based off the Apple II Mockingboard design. IBM also had a MIDI interface based music card called the IBM Music Feature, but it was very expensive, and other companies like Roland produced MIDI interfaces to control their expensive synthesizers with computer software. Parents were far more likely to buy the cheapest Casio or Yamaha keyboard on sale at Radio Shack for their kids.

In 1988, the card and company's fortunes changed when Sierra Online was looking for good hardware to support in their latest adventure games, which were planned to support full musical scores. The Ad Lib was seen as more capable than the PSG-based solutions then available like the C64's SID chip, which simply did not sound impressive to U.S. composers. Sierra selected the Ad Lib card as its entry-level music solution and other companies followed. The first PC game to support the Ad Lib or any other external sound device (Roland MT-32 & IBM Music Feature) was Sierra's King's Quest IV: The Perils of Rosella. In fact, if you compare the boxes for the 1987 and 1990 versions, you can see that gaming had taken preference over music creation.

Once the Ad Lib became useful for games, a version of the card was released for $195.00 without the Visual Composer software. The price for the Ad Lib was now much more attractive and competitive. Often games would come with a $20 coupon for the card. The next nearest competitor was the Creative Music System/Game Blaster, which at $129.00 competed well in price but poorly in features. The Game Blaster may have had more voices (12 vs. 9 or 6/5) and stereo support, but its PSG-style music generation was not deemed by the press or the public as anywhere near the quality of the Ad Lib's FM Synthesis.

While the PSGs in the Game Blaster and the Tandy could output the same notes on the scale as the Ad Lib, the Ad Lib had sufficient capabilities to advertise to users that they could create something approximating actual instruments. It also sounded somewhat close to the music in most arcade games of the late 80s and early 90s, giving it an edge over devices that sounded like a C64 or a NES. If the Ad Lib had not gained popularity, perhaps it would have been the Game Blaster that fulfilled the PC gaming music niche, but the Ad Lib was supported in thousands of games while the Game Blaster never pushed above 100 games.

The Ad Lib had quite the appeal for people looking for a no-hassles upgrade. The Ad Lib did not require any setting up, there were no user-accessible jumpers or dipswitches on the card. It fit inside any system with a free 8-bit expansion slot. It rarely required you to load a driver before running an application or a game. PGA Tour Golf is one of the few examples I could find of a popular game that requires loading SOUND.COM before beginning the game. Even Ad Lib soon embedded its driver into its application programs. The most interaction people usually had with the card physically was with the volume control.

The Ad Lib was not designed to handle digitized sounds, but some companies were able to get around that by some careful timing writes to set up a level waveform, then feeding 6-bit values to the volume control registers. This in essence allowed the Ad Lib to function like a 6-bit DAC. Activision used it in Battle Tech : The Crescent Hawks' Revenge, Gametek in Super Jeopardy and Interplay in Out of this World. Because sending audio samples directly to the "DAC" required a lot of CPU time, it was seldom used. The rise of the Ad Lib compatible Sound Blaster, with its 8-bit DMA-assisted DAC, soon made this effectively obsolete.

From a programmer's standpoint, the Ad Lib was relatively simple to program for. Programs could automatically detect the card because it had a pair of readable timers on it. For 8088 systems, they could simply just send data to it, but faster systems required software delay loops of increasing length in order to have the card respond appropriately to address and data writes. Unfortunately, the basic Ad Lib and its clones tend to fail when older games are being run in fast 386 and 486 machines, requiring the use of slowdown utilities, cache disabling programs or turning off the turbo button. Eventually, virtually all audio would be handled by middleware drivers from companies like Miles Sound Design which would provide solid if unremarkable Ad Lib support for any system.

An Ad Lib could work with just about any PC or XT with 256KB of RAM and a CGA or better card. However, in late 1988 that combination just was not doing it anymore for the latest games. While the Ad Lib can work with most early games on an 8088 or V20 machine, the results are often unplayably slow. The Ad Lib works much better with a 286 @ 8MHz or better, an EGA graphics card and 640KB of RAM. There were exceptions like Origin's Windwalker, which was programmed before the need to add software delays for faster systems was generally known. That game is best run on an 8088 or V20 machine.

The Ad Lib had something of a love-hate relationship with musicians. Computer musicians in the U.S. in the late 80s were usually thoroughly steeped using MIDI instruments. You could compose a song on a synthesizer keyboard a lot more naturally than in a computer program of the time. The Roland MT-32 and later the Roland Sound Canvas lines of PC MIDI devices were the preeminent external audio devices for PC gaming until digitized audio took over entirely. Most composers at big-box developers like Sierra and Electronic Arts composed with MIDI devices and then transported their music to the MT-32, SC-55 and Ad Lib, but the translation was far easier from MIDI to MIDI devices with built-in samples than MIDI to Ad Lib. So too often Ad Lib music playback paled in comparison to MT-32 and SCC-1 playback.

The Ad Lib did find early advocates at the shareware development houses. The guys at ID Software and Epic MegaGames were often technologically more innovative and more willing to explore the features of their hardware than the larger publishers. Shareware titles supported Ad Lib exclusively at first, then migrated to the Ultrasound and the Sound Canvas. The music in Commander Keen 4-6 and Jill of the Jungle 1-3 (which requires a Sound Blaster) is often very good and hard to imagine being as good on an MT-32. European programmers also were able to coax good music from the Ad Lib. They already had years of experience hacking away at the SID on the C64 and Paula on the Amiga, so this came easy to them. The music for Dune by Cyro Interactive does not loose its essential character on an OPL2 even though it was composed for an OPL3. The songs in Lemmings are very impressive, even compared to the Amiga original.

From a gamer's perspective, purchasing an Ad Lib in the first years following its release was a wise purchase because virtually every game that supported an expansion sound device supported the card. Companies like Sierra, Origin, LucasArts, Microprose, Spectrum Holobyte, Interplay, and Epyx soon followed suit and began supporting the card in more and more of their products. (Airball was a very rare example of a game that supported Innovation SID and Game Blaster but not Ad Lib.) If you look at an early story such as the one published in Computer Gaming World #63 (September, 1989) you can see that every company that was considering sound cards at the time of contact was considering the Ad Lib. When the Sound Blaster came with digitized sound support in 1990, digitized sound was slower to be adopted because the samples took up so much space on floppy disks. It had other features, such as the built-in game port, and a price that was very competitive with the less-featured Ad Lib card. Ad Lib's response to the coming of the Sound Blaster was to reduce its headphone jack to use a mini-jack connector.

Even when the Ad Lib Gold released the OPL3 chip, which has support for stereo output and double the number of FM operators and 4-operator FM Synthesis, game companies rarely supported the advanced features of the newer chip. Even though the OPL3 chip quickly replaced the OPL2 chip in 1992, most music was still designed for the basic OPL2 features.

The Ad Lib was the entry level music device for an astonishing seven years, from 1988 through 1994. Until CD-ROM drives and sample-based MIDI hardware became affordable, Ad Lib FM Synthesis was still the king of PC game music. Early CD-ROM music was far superior musically but extremely inflexible. Ad Lib music occupied little space and could be adjusted instantly to suit the needs of the program. CD-ROM music changing required sending track change or track repeat commands. There would be a pause while the new song was found or the old song was being repeated. CD-ROM also did not do well with short snippets of music. The iMUSE system from LucasArts, which dynamically changed the music according to room and scenes, was feasible with the Ad Lib but impossible with CD-ROM audio. Only with the arrival of Windows 95 was the hardware sufficiently powerful to manage multiple digital streams of voice and music that made the Ad Lib totally obsolete.