Update on the SID/MIDI/whatever box

Weeell, here’s the update. I have been working on this project for exactly 2 weeks now… The software end of things anyways.

Since last time, the PCB has been fully assembled, all the hardware has been debugged/tested/working except the USB part (been lazy on that). Been a whirlwind week of SD cards and FAT file systems and LCD displays!

As it stands, it will boot any SD card I stuff into it, load the firmware off the card into RAM, then run it. The firmware right now can load/display the directory of the card, lets you step through it including subdirs, etc and then load/play SID tunes.

You’d think sorting a directory list would be fairly easy- I spent more time than I want to admit on that piece of code. The unit can load up to 1023 directory entries off the card and then sort/display then in just a few seconds. Most directories are pretty much instantanious. I figured 1000+ entries would be more than good enough for this project. Who will wanna hit “page down” 200 times to see all 1000 files? hehe.

I made a custom font last night that allows me to cram 5 lines of text on the LCD, with kearning so that the text is packed in nice and close without wasting pixels. It can show about 30-40 characters on a line this way.

Also I bought one of those $30 CVS “one time use” camcorders and made it a bit more than one time use by making up a cable and then unlocking it. For more info on the CVS camera thing, check out HERE.

I will include a pic or two some time about my cable I made. Anyways, I mention the videocamera because I used it to make a small video of me looking and sounding like an idiot describing the device 🙂 You can watch me make a fool of myself on Youtube:


[application/x-shockwave-flash]

And here’s a few pics of the thinger (clicky for bigger)

That’s it for now, enjoy 🙂

PCB Prototype of the SID Filter / Sound Board

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.

On board are a Cylcone 3C25, 16Mbytes of RAM, a PIC micro, USB, SD card, dual 1/4″ jacks for audio out, a 1/8″ stereo headphone jack (not on the board yet), MIDI in, and a bunch of debug/programming connectors and the 20 pin display connector. There’s dual analog SID filters, 4 24 bit audio DACs, digital volume controls and other analog goodies.

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.

current version 20 filter test.

SID Filter

I dinked around some more on the filter circuit, totally redoing part of it again. I think I have the framework down now for the “could be final” version. Time will tell. Anyways, here’s some more pics and sounds and things. I know the Fc curve isn’t correct just yet, but now I have the power to correct this in software I think. I have to make up a table and some other shiznit, but now that FC can easily be manipulated I am not too worried.

Here’s the lashup as it stands:

with the flash on


and with the flash off

Aaand here’s some audio:

Analog

Gloria

Hard Track

Mechanicus

Miami Vice

Needledrop

Poseidon: Planet Eleven

Spijkerhoek

Walking Home

Zamzara, tracks 3 and 4 (track 4 is “hidden” and is not shown as playable in the SID file)

More SID Filter Work

Well, I dorked around with the filter some more. I boosted the gain up going into it and this seems to have produced some of the characteristic distortion, but it’s still not as distorty as I want. However it does seem to be sorta kinda somewhat getting a bit closer maybe to sounding like a real SID. I think.

Anyways enough of that. Here are the MP3s:

After the War

Alrite! (PRI)

Analog

Gloria

Hard Track

Mechanicus tune 3

Snake Disco

Spijkerhoek (hey I spelled it right this time!)

Major SID Filter Progress!

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:

Gloria (uses some heavy duty distortion from the filter!)

Hard Track (from the distortion page)

Spijerhoek (god, I hope I spelled that right. 🙂 This one might have minor resonance issues, not sure)

Agent X: The Mad Professor’s Back (a classic Folin tune, makes insane use of alot of filter modes)

Brain Artifice tune #10 (This makes heavy use of the filters also).

Miami Vice. 100% filtered all the time.

Poseidon: Planet Eleven ( uses odd filterage)

Aaand, that’s all for now.

The SID Filter Lives!

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.

Gloria (filtered/unfiltered)
Gloria (mixed, mono)

Spijkerhoek(filtered/unfiltered)

Procession (filtered/unfiltered)
Procession (mixed, mono)

More SID Tunes of Fun!

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.

Here’s what it sounds like right now:

R-type (Chris H.)

Qualm of Zulu (Zyron)

Tube Madness (Stefan Hartwig)

More SID Work

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.

Soo, give it a listen:

Rambo, set of tunes (10 mins)

Tetroid, a “scene tune” that abuses the SID.

More SID tunes!

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.

Listen to it!