Tag: sound

Well, after working on it for 2 months, I have finished design of the hardware and have made a PCB, then stuffed it. I am missing 4 or 5 parts though so I haven’t fired it up just yet. First the pictures:

Now that those are out of the way, what the hell am I looking at? Well, it’s evolved into alot more than just a simple SID emulator. It’s turned into a small portable hand held battalion of FPGA and audio goodness.

The plans for this beast are simple: a programmable MIDI box that lets you “play” nearly any kind of classic videogame or computer sound you wish. The second function is a full inclusive chiptune playing “engine” that reads tunes off the SD card and then plays them.

There’s a 132*32 pixel LCD with backlight that connects up to the 20 pin connector, and the 4 mounting holes at the top receive it. I do not have it mounted just yet since I was busy soldering it all up. I need get some hardware to mount it at the exact right height for my box, too. The box has a holder for 4 AA cells, which will be nicads or NiMh more likely, and will power the works.

The USB and SD card will act together as a standard windows/linux/etc. mass storage device to allow you to plug it in and drag/drop tunes to/from it. The USB will also provide recharging power to charge the batteries up. A DC power jack will be provided too for running it at a gig if you don’t want to use batteries.

Well, that’s about it for now. Here’s a sample of what the current hardware sounded like before I made the PCB. It’s about as good as can be done using standard parts. The filter’s offset and span can be tweaked in software now though, so I can change the response greatly.

Well I spent the weekend hacking my new idea for the SID filter, and I think it’s kinda sort of a success. Maybe. Here’s what it looks like:

The board in the background is my FPGA dev unit, and the board in the foreground is the analog filter/volume section. The FPGA is of course handling all the digital end while the board in front is doing the filter, volume control, and other analog functions.

It’s 10 chips, but to add a second SID will only take another 5. I got the controls down to 4 pots, but I can ditch those once I figure out the proper settings. I have totally redesigned the silly thing 8 times now, and I think I might possibly have a winner- time will tell. So far however I am very impressed with the output of it. It sounds like an R2 and/or an R3 SID. I have been using the SOASC MP3s for comparason purposes (and the SIDMan to a lesser extent). You can hit up the SOASC HERE.

I did a few tunes off of the “SID distortion” page (you can find that here) for your comparason pleasure. NOTE: He uses a Catweasel board and an R4 SID for his testing, which I believe to be a poor combination. The capacitors on the board are just as important as the SID when it comes to how the filter will sound! What value caps are on the Catweasel board? I cannot find that info anywhere. My friend has one and he can’t figure it out either.

Anyways, I believe a real stock C64 is the best test bed for how the SID “should” sound, since it will have the exact set of circuitry that is needed; this includes the specific output circuitry in the computer- an NPN transistor, 0.1uF cap and some resistors. These parts will add/change the sound somewhat (the .1uF cap in particular) and should really be taken into concideration.

The only problem I’ve found so far on my SID recreation is that the audio is too clean (there’s no bus noise) and there’s a slight resonance issue with my filter, but I am not 100% sure if this is due to my end or not. I am going to perform some more testing on this to find out.

Sooo, without further ado, here are the samples of my thinger in action:

OK, I just fired up my latest incarnation of the SID filter I’m working on and initial results seem fairly promising. Here’s the goods. NOTE: I am manually adjusting filter cutoff and depth here, I do not have it under SID control at this time. As such, it won’t sound exactly like the tune’s filter program, but eh it’s a test.

I tested some of the harder tunes to emulate, specifically Gloria which sounds cool when the filter distorts. Well it seems to sound pretty distorty to me.

NOTE: there’s some high frequency whistle in the filtered channel, this is due to aliasing between the DAC and the soundcard I think. I am investigating. It does not appear to be due to the filter oscillating.

LEFT channel is unfiltered, RIGHT channel is filtered. I have included two versions of two songs- one with filtered/unfiltered split, and one that is mono with both mixed together as if it were a real SID.

I’ve been working here and there on the SID thing again, and got a bit farther. Ring modulation and all that jazz works, and I have split channels into filtered/unfiltered streams in preparation for feeding it into my hardware filter. There’s still some popping or something and I’m not quite sure why. It may be “normal”, but I don’t hear it on a regular SID so I will have to check it out. My ADSR gen might be having issues creating a DC bias of some form that I will have to kill.

Well, I’ve been hard at work tweaking my SID implementation. So far, I have moved all control functions over to a second 6502, added a bunch of hardware (bankswitching, display control, etc) and finally loaded some REAL SID tunes into it. I quickly ran into a ton of bugs with the envelope unit, which have been fixed now. I also worked on the combined waveform thinger too, and figured out pretty much how that works. There’s still a few issues left that I have to solve, like some aliasing between the SID output and the sample rate of my DAC. This is no surprise, however, since the NES has a similar problem with the periodic noise. I already have a 256th order FIR filter for the NES stuff, so I may just drop that in. On these following two demos you will probably hear the aliasing issues if you know what to listen for.

Also note that I know the pitch is slightly off on my demos- I am using 1.02MHz (NTSC rate) while most of these tunes are designed for PAL rate (0.98MHz). you can slow them down 4% or so if you wish to hear them at the correct pitch, tho it will be 4% slower. I was thinking of speeding the timer up and then slowing it down to compensate but I’m kinda lazy.

I’ve run 20 SID tunes through it so far and found a few minor bugs but I think they are supposed to be there. I’ve been listening to a real SID to determine which is the case. The jury’s still out- if nothing else, it’s just more noticable here for some reason and I will have to fix that.

Well I converted my other SID player code I wrote ages ago so that it can write to my SID that is sitting at a rather unorthodox 06000h. I tweaked a few things and got all the distortion and crap out. I found out that my noise on channels 1 and 2 was dead though. Noise on channel 0 worked fine, however. This is because when in reset, the state machine is reset too, which can only init the first LFSR. whoops. I manually poked the test bits which loaded the goodies into the remaining 2 channels and they worked fine after that.

Anyways, if you want about 9 minutes of SID bliss, from the editor “Studio 64”, this is your lucky day. Tune #4 is an amusing rendition of “Sweet Dreams”. giggle.

Here’s after a few more hours of progress. This is pretty much how it’s supposed to sound. If I did a double blind between this and a SID, I probably couldn’t tell the difference. It’s playing back at the correct speed now.

So far, the SID enveloper, waveform generator (with “invalid” bit combinations), and some other goodies are done. For starters, I am outputting the straight and filtered audio separately, so that it can run to my filter circuit.

Unlike all the other FPGA SID implementations out there, mine’s gonna use a real live filter! I have designed and made the filter, and it seems to mostly work. It’s made similar to the filter on the real chip, using MOS transistors and such, so it should accurately model it. I hope. I passed some waveforms through it while I dinked around with the cutoff freq and all that jazz and it sounded pretty decent. We’ll know when I hook it up to the FPGA if I got it or not.

All in all not a bad deal for about 1 day of work. Hopefully tonight I will have a proper “SID core” set up and running. We’ll see.