You don’t need fancy ICs and DACs to build a sound card for a PC. As [serdef]’s build over on hackaday.io shows, all you really need is a bunch of resistors. [serdef] built a clone of a sound card released for PC in the 80s, but with a few improvements. This mess of resistors features the best 8-bit sound you can get with a low-pass filter, volume divider, and a handy DB-25 connector.
The design of this LPT0 sound card is pretty much the same as when it was introduced to the world as the Covox Speech Thing. This ‘sound card’ was designed to clip onto the parallel port of a computer and send the 8-bit I/O of this port through a resistor ladder. Plug a pair of speakers into this thing, and you have a sound card that is completely made out of resistors. It was cheap, and in the demoscene it was popular.
There are a lot of amazing demos out there using this resistor DAC thing, and [serdef] has videos of his project playing a lot of them. You can check that out below.
Very cool, and a creative solution indeed.
Though I’ll bet with a few 555s, op-amps, and logic gates, you could do multi-channel FM synthesis just as cheaply. I’ve been working on a homebrew microcomputer, and if my FM synthesis sound card doesn’t work out, I will keep this solution in mind.
Doing musical FM in the analog domain is *really* hard due to drift. You’re not going to get reliable synthesis out of a bunch of 555 oscillators. Plus, FMing square waves isn’t pleasant, but you could try using the triangle-ish waveform with a diff amp across the capacitor.
It might be interesting anyway.
If you meant you’re going to build a digital synthesizer from chips and just use the 555 as a clock, well, why not have something stable provide the clock?
That’s why when you tweak it just right, you lay down the riff on a reel to reel tape and loop it, then use the rest of the day setting up the next one…
Then when you’ve got your collection on shuffle you know you’re in for a treat of a banging 80s synthpop classic when it starts SSSSSSSSSSSSSSSS
reel to reel tape? We have digital recording these days.
But analog musicians are keeping it reel.
Yep FM essentially requires sine waves to work right. As in I’m not sure the math works right without it and using even a triangle wave would limit you to a small subset of the sounds available. It fits FPGAs pretty well though. I bet someone could cream a couple notes with into even an ICE40. I’ll have a better idea on resource usage once I’m done with my current class project. If you want a synth that uses square waves subtractive synth make work better, if you can build yourself some programmable band-cut filters to shape your sound.
Well, depends on your definitions of “FM” and “work right”. Some Yamaha FM synths (TX81Z and DX11 for example) provide non-sinusoidal waveforms and can use them to produce musical sounds, math notwithstanding.
I am really interested in homebrew computers so I clicked on your link hoping it might go to your web site Damn!!!
I am also building a homebrew and I am going to use CPLD / FPGA for sound to give it new features like holophonics.
Neva guna …
Homebrew computers are amazing, and there’s a ton of them on Hackaday.io.
This is one of my favorites, though: http://imgur.com/gallery/hfG6e
The thing is really small! Nice work. If you want a little smaller or less soldering I found these SMT resistor networks that I have used on my Arduino Laser Show DAC project. https://www.digikey.com/products/en?keywords=EXB38V They are a little on the small side but do save a heck of a lot of soldering.
from the look of it the ones on digikey are only ±5% and he needs ±0.1%
Good point!
They dont have to be .1% but they need to be all the same value as they are used as divider.
With these arrays they come from the same production run, chances are they are all pretty close in value to each other. Their value howevrr can be 5% of the advertized value..
I would not rely on this, if the project is of any importance. You can probably expect some tracking in temperature variations but not in the laser trimming of the resistors. And you need more than 4 matched resistors, so you would need to select (measure) them. Better buy the right stuff upfront.
What you really need is https://www.digikey.com/products/en/resistors/resistor-networks-arrays/50?k=&pkeyword=&pv9=39&FV=ffe00032&mnonly=0&newproducts=0&ColumnSort=0&page=1&quantity=0&ptm=0&fid=0&pageSize=25
Wow, I didn’t know these existed (and I use the normal types). Thanks for the link.
They used to be omnipresent. Look at an old sound card like a Gravis Ultrasound and you’ll see some familiar brown SIP packages. Now there seems to be just that one manufacturer left. Hence the $1 per, for a part that’s just a bunch of passives.
Yes, and as far as I can tell they’re also all 2% so your probably better off using discreet passives anyway. At least then you can get down to 1% or even 0.1%
doing a search for high precision resistor array results in a number of different suppliers and manufacturers going down to .025% precision! For instance Vishay and Caddock’s. There are more suppliers than digikey out there.
@[ThisGuy]
Paste some links please. I couldn’t find anything decent. I probably doesn’t matter too much for me (I am just curious) because I use CPLD/FPGA and single bit DtoA – saves on pins.
Tolerance only paints a partial picture. An overlooked property is the tracking. Resistor networks are going to track extremely close compared to most discrete packages due to their shared mass alone, and are indeed available in tolerances 0.1% and lower. Temperature coefficients themselves are important, too. For this, you really need to know what your acceptable temperature range is, so you can figure out whether your error rates are acceptable for a given application. Also, you need to take into account relative tolerance. A resistor array could have a part-to-part tolerance of 0.1%, but a relative tolerance (precision between the in-network resistors) of +/-0.05%, which grants you that much more precision compared to, say, a few individual resistors rated at +/-0.1%. Suddenly the lowly resistor gets really complicated given some applications :)
Side note, it looks like Digikey filters out some useful results if you select “R2R”.
Nice emoji URL – no stop it! :-)
I agree. I had to do a double-take when I saw it.
do hackaday allow emoji urls in the comments? https://hackaday.com/2017/04/25/error-lp0-on-????
It’s wordpress. WordPress is ????
is that an aubergine? I’m confused
@haydn jones yes it is, we call them eggplants. A penis emoji does not exist, so 99 percent of the time you see the eggplant emoji it’s acting as a stand in for a penis. Brian is saying WordPress is dicked up. For any other questions you have about emojis please consult the nearest teenager.
TIL you can emoji in URLs…
Damned emojis… Back in my day, we called emoji’s “emoticons”, and they were made with the lower 7 bits of the ASCII character set… Plain text… None of this fancy ????… Oh, and why is the danged shit pile so happy! It’s crap!
It’s what all the millennials are doing these days, fam.
BRB changing my custom hackaday.io URL
Noooo, not in my hackaday!
Emoji are the harbinger of the apocalypse.
But they can’t beat Z̨͕̣̤͕͎̋̀̐̐̍ͮ̓ͥ͊͗́͟a̠̳̠̜̓̊̄̇ͧ̆̐͘l̗̟̭͙̠̲̝͉̘̉ͦ̾ͫͮ̓͛͘͠g̷͕̯͕̳̽̇̽̑̉̍̿̎͑̆ͪ̂ͭ͛͜o̫̾̾̿͟͜͜͞.̶̡̹̼͔̝̼̫̣̻̉͆̿͌ͫͨ͆̾ͨ̽̄̒̒ͣͫ̚̕͜, Illuminati (◬) and the Uni-Konami-code: ▲▲▼▼◄►◄►ⓑⓐ.
Obviously, there are unwanted characters, too: ☭ is one of those.
I made one of these for a Raspberry Pi last year for my Operating Systems class. I should get around to recording a demo video and uploading my source code. I had a workflow problem that gave me bad sound files and in the process of trying to debug I test-benched my ridiculous breadboard R-2R ladder wrong and tore it up to replace with an Analog Devices thing. But the principle is the same and the code should work with any parallel DAC.
I used to have one of these in my way at the time outdated computer … makes sense that it was just a simple R2R ladder
Honest question here: Why is it only 8 bit? Couldn’t you get up to 16 bits or is that to much to pump quickly on these old machines?
the port has only 8 data out pins, so they work to that limit. otherwise it would have to add ic’s
And also one needs super-accurate (0.001 % tolerance) resistors to make a 16-bit R2R DAC.
From memory there was a version that had two 8-bit latches but that was to provide stereo rather than 16 bits/channel.
The argument about the required accuracy (tolerance) if R2R resistors has come up a number of times.
My claim has been that, not as much accuracy is needed as others claim because it’s ratio that is being created with two Parallel networks of resistors – one network to logic ‘1’ and one network to logic ‘0’.
I did start a proof of concept in JavaScript so perhaps I should go and revisit that.
i would of thought you could get away with looser tolerances, at least on the lower bits. any links to info on this?
If you don’t have resistors that match precisely enough to get you your lowest positive value you can’t guarantee where the values of your numbers will lie. If you just throw imprecise resistors together you could end up with a situation where say 128 produces a lower value than 127 pretty easily. I think if you sort the resistors by measured value (I don’t wanna do the algebra to figure out which direction) you can at least ensure the values keep the right order which is probably good enough for audio.
@[Steven Clark]
To get 128 to be lower than 127 then you need 66% tolerance resistors in the worst case scenario.
Is that how the math works out? That sounds like you’re just counting the next resistor down. If you sum up the errors among all the bits in the same direction they build up pretty fast. Here’s a worst case with 5% error by my guess of how the math works:
(1*0.95) < (0.5*1.05) + (0.25*1.05) + (0.125*1.05) + (0.0625*1.05) which means 5%s only work to 4 bits if they are lined up wrong.
@[Steven Clark]
No, I made a mistake. You actually need a tolerance of over 600% to create your scenario.
Imagine a 2 bit DAC. What tolerance do you need for the voltage of 01 to be above the voltage of 10
If that doesn’t make sense them imagine a 1 bit DAC. What tolerance do you need for 0 to be above 1
Ahhh. So the other pins are not IO they are input line then? Makes sense. And I didn’t know you needed super tight tolerances to do the 16bit sections.
Actually you have 12 pins you could use for output. Pin 1, Pin 14, Pin 16, Pin 17 are all output ports.
Addressing those additional four bits would make the output code a lot more complex however. The 8-bit output is done in a single operation.
How do you figure it would be a lot more complex?
Just split up a 12 bit, send 8 bits to address 0x378 and the remaining 4 to 0x37A.
Of course thou, you would have to create your own demo to use 12 bits instead of 8.
Found this: http://techdoc.kvindesland.no/radio/ymse3/20081009164052553.pdf
Quote [Benchoff]: “and in the demoscene it was popular”
That’s probably because you had to be a demo scene super coder to conger up the magic MIPS to drive this thing with assembly code.
I wonder how it is being done in the above video’s. As far as I can remember, direct Port/IRQ access wasn’t available after Windows, XP or Win98.
How it’s done? Running on MSDOS, those are DOS demos after all. Hook the timer interrupt, reprogram it to occur at the wanted sample rate and output a byte on the LPT port. Playing a sample is easy, mixing samples could be a bit harder.
To use something like this in Windows one have to have a driver, I assume the Covox was supported.
In DOS you can even access the DMA controller, and there should be DMA assisted parallel port output modes.
Support for either this or Disney’s Sound Source (a stereo version) was actually pretty common in DOS games. Wolfenstein 3d for example could send sound effects to one. Music probably took quite a bit more effort as RAM limitations would have limited the length of a sample that could be played, and FM synthesis would have required some serious sine calculation for an interrupt routine. Some games did have Speech thing music (Pinball Fantasies for example) but it was probably MOD based which would have required a completely different production pipeline from the FM music used by most DOS (and Sega Genesis) developers. I’m guessing almost only stuff by Amiga game houses had MOD music produced.
MOD files are sort of like a MIDI file using a wavetable, but with the samples embedded in the file.
The Disney Sound Source was NOT stereo. It also had different internal hardware from the Covox Speech Thing. https://en.wikipedia.org/wiki/Covox_Speech_Thing, http://www.vogons.org/viewtopic.php?f=46&t=42250
So the FIFO was just for double-buffering to normalize the output frequency (and probably reduce the noise floor)?
I actually made one of these back in the day! It was my first time reading a schematic (of sorts), I think it was a text file I downloaded from some BBS along with the command line software to play sound files. Wasn’t really much more than a novelty, but still neat nonetheless!
Way back when, I had a COVOX Sound Master II. It was a Speech Thing (their parallel DAC) combined with an Adlib clone and something else COVOX made- while deleting the two Atari 2600 DE-9 joystick ports the SoundMaster had.
Using the LPT DAC meant LPT1 had to be moved to LPT2 because the resources on the Sound Master II couldn’t be changed. They did make Windows 3.1 drivers to make the card emulate an 8 bit Soundblaster.
Would it be possible to use two LPT DACs on two ports and mix data to both of them to create a 16 bit mono or 8 bit stereo output? Join the analog outs and span the bytes across the two for 16 bit mono.
https://en.wikipedia.org/wiki/Covox_Speech_Thing The Disney version was A. Cheaper, and B. slightly more complex than the Speech Thing.
The sound card I wanted in the 90’s was a Media Vision ProZonic. I don’t know if any were actually made but the advert I remember said it was SoundBlaster 8 and 16 bit, Pro Audio Spectrum 16, COVOX/Disney LPT DAC, Adlib and I forget what all else in a single card. One card and you had the best sound option for most any game for DOS and Windows. ISTR it must have been before 1992, I’ve never been able to find a thing about it on the web. The ads I saw were most likely in PC Magazine or Computer Shopper.
I just googled Mediavision prozonic and turned up various sites claiming to have drivers, and a couple other people mentioning the card, so they must have shipped some – but who actually has one to get the lowdown on what, precisely, a ProZonic *is*?
While I understand it was just a bit of fun, please do not use emoji in the title again.
Here’s a mod player for the PC that supports parallel output…
http://www.awe.com/mark/dev/modplay.html
Mods still available all over, big directory on Aminet mirrors.
There used to be a sound driver for Linux that supported them too, but not sure if it got left behind. Was module parsp.o and associated to mount point /dev/dsp so anything that output to that worked. Just what you needed with the ascii video4linux drivers so you could watch movies on a mono monitor. Think mplayer does it now.
Here’s some deets for linux, this is probably really out of date, lot got changed, or if you like messed up, when the kernel went to 2.6.xx http://linuxgazette.net/109/john.html
So you don’t have a native parallel port and want to play, didn’t stop this guy, http://yeokhengmeng.com/2017/01/a-science-project-bringing-the-covox-speech-thing-to-2017/
It’s a bit of a more refined version also. Eyeballing the site index, won’t be surprised if he gets some stuff featured here soon.
Oh very cool, my CVX4 prototype made it on the hackaday page already !!
You can pre-order a fully assembled board here : http://www.serdashop.com/CVX4
I have ordered one small ‘limited edition’ batch from an assembly factory here in Belgium, it will look better than the prototype. I was planning to record better demos this weekend…
My friend made those by the boxful, he had a really nice design, and collected tons of mod files for playing. He hawked them at computer shows all over the northeast for a few bucks a pop. The good old days..