• Please review our updated Terms and Rules here

Demo of digitized audio through PC speaker

I read that Google Groups doesn't archive binaries. Was this program recently posted on USENET? Could you tell us what group it was on?

Thanks,
Sean
Someone posted it to "alt.test.group" in 1996 as a "just testing, ignore" message, but by the file name and download size I knew it was exactly what I was looking for!

http://groups.google.com/group/alt.test.group/msg/f421db1ad4f4bbb9

I think Google Groups may block USENET groups that are explicitly for binaries, but if you happen to come across a binary post in a non-binaries group, you can download it.
 
The C64 sound chip (!) is also memory-mapped, which tends to speed up operation quite a bit compared to I/O based solutions.

Indeed!


Very impressive! But I have to point out that one of the "breakthroughs" was ignoring interrupts and just polling in a tight loop. On PC, we can't do that, because PCs are all different speeds and architectures. So on PC we have to use interrupts, and an interrupt call wastes 70 cycles, so that's why PC has worse performance in this area. Also, C64 has 4 timers, PC only has two (three, but one is needed to refresh DRAM so you can't use it) and, of the two, only one is wired to the PC speaker...
 
Four timers; two CIA, one raster beam, one NMI?

By the way, wouldn't it be possible to write a tightly polling program for the 4.77 MHz IBM PC 5150 that will work on that model but perhaps no other? Yes, people would bitch about it not being compatible with other vintage PCs but the point would be to prove how many samples you could pull from the CPU if it has nothing other to attend to. Compatibility is overrated anyhow. ;-)
 
Four timers; two CIA, one raster beam, one NMI?

Still better than PC. PC has three timers: One for firing off program code at an interval, one for refreshing DMA (users can't use this), and one for use as an actual timer that can be read and tied to the speaker and stuff. No video interrupt; no NMI (unless on 286 and higher).

By the way, wouldn't it be possible to write a tightly polling program for the 4.77 MHz IBM PC 5150 that will work on that model but perhaps no other? Yes, people would bitch about it not being compatible with other vintage PCs but the point would be to prove how many samples you could pull from the CPU if it has nothing other to attend to. Compatibility is overrated anyhow. ;-)

Sure, there are very many music programs, at least five completely different techniques for making multi-channel audio through the PC speaker. Most only work on original PC though, so where's the fun in that if others can't run/hear your work?

Also, I'm not sure polling would work on 4.77MHz 8088 through the speaker... I laid in bed last night thinking about it :) and came to the conclusion that I'm not sure it could be useful, because the addressable timer in the PC is very fast (compare to the speed of a program) and many hundreds of ticks could go by while the program is doing its thing. Each program instruction costs 2-13 cycles to execute -- and another 4-20 cycles just to read from memory! -- so it wouldn't even be a case of polling, it would be a tight loop with custom "for->next loop"-style waiting instructions for timing.

I have ideas on multi-channel sound generation that I'd like to add to MONOTONE someday; the simplest one, and it should be compatible across all platforms, is to use three registers as square-wave generators; inc each reg by the period, and take the most-significant bit as the state of the speaker. With all three going at once, the speaker will output three simultaneous square waves.

Someday I hope to figure out what Tim Follin was doing on the spectrum -- some of the multi-channel "phasor" output I have STILL not figured out 20 years later...
 
The C64 sound chip (!) is also memory-mapped, which tends to speed up operation quite a bit compared to I/O based solutions.

This assumes that the 6502 can access memory in a C64 faster than an Intel 8088 in an 5150. In the 5150, I/O is accessed just as fast or almost as fast as memory, since both busses are set to the same speed.

There was an extremely obscure sound card called the Innovation Sound Standard which mapped its SID's registers directly to 31 separate I/O addresses. That is a lot of addresses to use when the 5150 had only 1024 total that were to be used.
 
If you map the registers to so many I/O addresses, isn't it the same thing as making the chip memory-mapped except that you'll have a different way to access it? I was thinking of the typical setup with one-two I/O ports to a sound chip with 4-24 registers, where you have to send multiple commands in serial. Often one command to choose register and then another command for the data.
 
I used to have a program which let you program Tandy-style 3-voice music using BASIC "PLAY" commands and then play it through a regular PC speaker
I found it! "Polyphonic Music 1.20: Three voice music on PC":

http://ftp.arnes.si/simtel.net/msdos/music-pre.html

Also somewhere deep in my collection I have a program which shows a living room with a Christmas tree, fireplace, and grandfather clock, and plays Christmas carols through the PC speaker (single voice) while clicking the IBM PC cassette motor relay on and off to simulate the ticking of the clock! That's perhaps the most unused "sound effect" source on a PC! :)
 
By the way, wouldn't it be possible to write a tightly polling program for the 4.77 MHz IBM PC 5150 that will work on that model but perhaps no other? Yes, people would bitch about it not being compatible with other vintage PCs but the point would be to prove how many samples you could pull from the CPU if it has nothing other to attend to. Compatibility is overrated anyhow. ;-)

I've seen it done on 3.5Mhz 8-bit computers. The cpu is used 100% during the process, but the result is impressive (for such machines). I also heard impressive 4-bit digitized music on the MSX, but it was done through the YM chip.
 
I have ideas on multi-channel sound generation that I'd like to add to MONOTONE someday; the simplest one, and it should be compatible across all platforms, is to use three registers as square-wave generators; inc each reg by the period, and take the most-significant bit as the state of the speaker. With all three going at once, the speaker will output three simultaneous square waves.

This sounds a lot like the principle behind playing digitized samples on Spectrums with the AY chip. :)

Someday I hope to figure out what Tim Follin was doing on the spectrum -- some of the multi-channel "phasor" output I have STILL not figured out 20 years later...

If you have questions about 1-bit music on the Spectrum, try talking to Mr. Beep, Gasman or Yerzmyey. All of them can be found on WOS.
 
I found it! "Polyphonic Music 1.20: Three voice music on PC":

http://ftp.arnes.si/simtel.net/msdos/music-pre.html

Also somewhere deep in my collection I have a program which shows a living room with a Christmas tree, fireplace, and grandfather clock, and plays Christmas carols through the PC speaker (single voice) while clicking the IBM PC cassette motor relay on and off to simulate the ticking of the clock! That's perhaps the most unused "sound effect" source on a PC! :)

I remember early on that there were some "pianoman" polyphonic-on-a-PC bit bangers. Not in the same class as voice, but entertaining enough.

Right now, I can think of two desktops that I have hooked up that will play the sound card output through the PC internal speaker (absent an external speaker connection); a Compaq Deskpro PIII and an HP Vectra PII system. So they weren't all that uncommon.

Moving a little off-topic, I was into making music on my Altair 8800 by executing EI/DI instructions in a loop--the 8080 interrupt status is fed to a front-panel LED--just hook a capacitor to it and feed it to an amplifier. Lots of fun, even at 2MHz.
 
Back
Top