Hot answers tagged

74

The original IBM PC and later variants used an Intel 8253 or 8254 as a sound chip. The 8253 is a timer circuit, containing three timers able to generate timed interrupts or square-wave output with programmed frequencies. On the PC the third timer's output is, via an amplifier, connected to a simple speaker. As said before, calling a 'simple' timer a sound ...


54

As you already say, it was stored as "instructions to a sound chip". So it's not a simple blob of data for DA-converters, but a procedural storage. Think of it like music notes. Imagine someone playing a piano he doesn't need to hit some 44,000 keys per second but anywhere between two and eight, each with a certain duration and velocity and later release ...


50

Your assumptions about timing and interrupts are correct. Actually, it is surprisingly easy to add SID music to games because they tend to follow a basic pattern. Compose the tune in a C64 SID editor. There are many of these. The SID editor generates a SID file, which actually includes both the data and code for playback. This file is easily incorporated as ...


43

The PC speaker connected to the i8253 PIT (programmable interval timer) was only for beeping. For better sound you need to bypass the PIT and use the Speaker as an I/O port with a single on/off bit controlled by the CPU. That way you can generate any sound (even PCM using a nasty PWM technique). The problem was that at that time the CPU was too slow, and ...


40

I strongly expect that an RF modulator, which is needed to create the TV-style signal, would cost more if it had to handle sound too. A small speaker is very cheap, and often a useful device for debugging a circuit board or firmware. The Spectrum 128K+ did make sound output through the TV, and also had much more sophisticated sound hardware, with an AY-3-...


40

The ones you list are all S.A.M, from what is now SoftVoice Inc. It was developed first for the Apple II, Lisa, Atari 8-bit machines and the Commodore 64; based on awareness of those versions, the company was contracted directly to supply the bundled speech generators for the Macintosh and Amiga. So they all sound the same because they are ports of the same ...


32

Yes, it's possible to effectively change the volume if you're using Pulse Width Modulation (PWM), although the timbre of the note is also affected depending on playback hardware and psycho-acoustics. Dr. Blake Troise, who makes chiptunes under the moniker Protodome, describes how in a recent paper: The 1-Bit Instrument: The Fundamentals of 1-Bit Synthesis, ...


30

What is algorithms use for boot/start sound (when turn on computer) Algorithm? Well, yes, technically everything is an algorithm. In this case it's simply executing the beep subroutine during reset, which in turn toggles the speaker line 192 times over 0.1s resulting in a sound of roughly 1 kHz, which should be is close to b′′. Lets have a look into the ...


28

suppose it's possible that the PlayStation audio format does have the required instruments, and then they added the few repeated audio samples on top of that in the game engine There are no instruments "built into" the PlayStation. Games provide their own. The PlayStation sound chip is basically a 24-channel ADPCM playback with 512KB of sample ...


27

Fundamentally, the lack of a specialized Programmable Sound Generator (PSG) or Synthesizer led to game sound effects and music on the IBM PC that were far inferior to competitors' microcomputers and game consoles. The comparatively inexpensive Commodore 64 had a PSG known as the SID that was capable of synthesized multi-track music, game sound effects, and ...


27

You can think of the sound chip in devices such as this as a simple synthesizer, capable of emitting some basic waveforms at some designated frequency. Capabilities of these devices varied in the 8-bit era, fx on number of simultaneous voices, available waveforms, hardware envelopes, filters and special modulation techniques (such as ring modulation and ...


26

Here's typical audio from a PC speaker: https://youtu.be/ZLwri0J1S4E As you can hear, it's really only designed to make beeps of various frequencies, all the same volume level. But by quickly turning the speaker on and off, you can play 1-bit PCM audio. Here's what it sounds like: https://youtu.be/HstgfH9FWV4 And because it's unbuffered, it's very CPU-...


24

From your source code, it looks like you're expecting to be able to find individual songs as standalone assembly listings for a 'master' CPU (such as your 8086) that you can execute to play a song on a sound chip. Outside of very small examples, that's not a very useful way to use a sound chip, since unless the song code is designed like a coroutine, you won'...


24

Summary: Real ISA Sound Blaster cards don't need any drivers to initialise or support them. Later PNP Sound Blasters (SB16/AWE) and clones may need a driver that performs one-time initialisation. Exotic cards may need memory-resident translation layers. Games use a collection of per-card drivers to talk to the appropriate hardware interface of the sound ...


22

Short answer: If you are content with beeps, no. If you want arbitrary sound, yes. There's three ways to get sound out of the PC Speaker: Put the timer chip into square wave mode and send frequencies (actually countdowns) to the timer chip. This is cheap and what's used for most PC Speaker sound effects in games. 140Hz is a popular rate to do it at. Set up ...


21

Always hard to guess why something simple hasn't been done. In case of the Spectrum it might have been to save on component price. The modulator used is the same as for the ZX81, so Sinclair was for sure already at the optimum price point. On the down side it's a simple video modulator (*1) without a mixing stage for sound, after all, in its quest of ...


21

As documented by Jeffrey S. Lee, the AdLib simply provides raw programmatic access to its OPL2: The sound card is programmed by sending data to its internal registers via its two I/O ports: ... The sound card possesses an array of two hundred forty-four registers; to write to a particular register, send the register number (01-F5) to the address port, and ...


19

There is another angle complementing all these answers and even the question: The original PC was mainly designed and marketed as a boring but "reliable" business machine, building on top of 20-year-old technology on the line of CP/M hardware for lowering the production costs and being able to build machines with off-the-shelf, discrete TTL ...


19

I think the best you could do in some cases was alter the pulse width of the basic square wave the hardware could produce. That wouldn't really change the volume, but you could make the tone "thinner" or "fatter" at the same frequency. One advanced technique used by some composers and sound drivers was "dithering", in which high-frequency random noise was ...


19

That paragraph should be understood in the context of the preceding paragraph: The PC speaker was often used in very innovative ways to create the impression of polyphonic music or sound effects within computer games of its era Effects such as those used in Pinball Fantasies in particular involve very rapid changes to the sound output by the PC speaker, ...


16

The amplifier input is biased to about half supply voltage. The SID output is also biased to about half supply voltage. You have little or no bulk/bypass capacitance on the 9V supply pins, so abruptly disconnecting the 9V supply from amp also abruptly shuts down the amp input bias. But as you have the quite excessively large 22uF coupling capacitor between ...


16

Most PCI soundcards do not have hardware support for games and other applications that expect a SoundBlaster or AdLib to be present. Older cards made a special effort to provide what's known as "register level compatibility", so they could be used with a wide range of existing games. By the time PCI arrived, Windows had become the PC operating ...


15

May I recommend the TI SN76489, then? 3 channels + noise, clocked from a 4 MHz input. Small, cheap. Sounds like chiptunes. Simple to program. Easy to get surplus. Only drawbacks: it powers on producing a loud continuous tone. You need logic at startup to tell it to make some other noise, or preferably no noise at all. Hence the BBC Micro's two-tone startup ...


15

Random noise patterns were usually generated by one of two common methods back in the 80s when simple waveform generating sound chips were popular. One technique is the Linear Feedback Shift Register or LFSR. This is basically a shift register where some of the bits are fed from one part of the register to another using a simple logic function, typically ...


14

The output is analog, not 8-bit. Each channel has an 8-bit DAC inside to generate the selectable waveforms (sine was not one of them, square/pulse wave, triangle and saw). There were also volume and envelopes, so even at this point the audio can't faithfully be represented at 8 bits. There is also an analog filter through which channels can be sent. The ...


14

As another answer has said, the OPL2/3 chip on the AdLib is driven by directly writing the registers that control the pitch, volume, and tone of each channel. But how does a game (or other music player) know what values to send when? There are a few different approaches. Raw data. The IMF format used by Apogee and early Id titles is a typical example of ...


14

Mostly, the same way that embedded code still does it today. Embedded code doesn't use threads. In general, it also makes less use of stack and usually no use at all of dynamic memory allocation. Instead we make widespread use of global variables (or at least static variables) which are statically allocated. Reasons are twofold: firstly it's faster, and ...


14

If you're comfortable with programming microcontrollers already, I suggest you just use another microcontroller and adapt its output to be an audio signal. You can use a DSP-type with an audio output (Microchip dsPIC has stereo audio out off the top of my head, your favourite brand may have their own) if you want potential stereo, fine grained control with ...


12

Essentially, you implement a 1-bit DAC in software. There are (at least) two ways to do a 1-bit DAC. For tweaking the brightness of an LED on e.g. an Arduino, one can use pulse-width modulation (PWM) using the hardware support. This does not produce the best-quality output, for which delta-sigma modulation is preferable. It's about the same amount of code ...


11

Because of different TV sound IF frequencies around the world, modulating the sound on a subcarrier would mean different modulators would be needed in different regions. An internal speaker is cheaper and reduces the chances of sending the wrong unit to a different region.


Only top voted, non community-wiki answers of a minimum length are eligible