C64 SID emulation

Topics related to the API, programming discussions & questions, coding tips, bugs, etc. should go here.
User avatar
D3thAdd3r
Posts: 3175
Joined: Wed Apr 29, 2009 10:00 am
Location: Minneapolis, United States

C64 SID emulation

Post by D3thAdd3r »

uze6666 wrote:As for the C64, yeah it's really a legendary piece of hardware. The graphics were nice but the sound really stole the show for me. It's unbelievable what they still manage to extract from it in the recent demo compos.
Can't resist it. I must agree beyond the ever hackable graphics, the SID was almost a magical chip for the time period and cost point it falls under. I don't think it is too rare an opinion that it was capable of, or at least was impressively utilized towards, things far beyond NES sound. To my ear I have heard plenty of tracks that surpass common SNES stuff as well on some "technical" sounding level. A while back I got interested in the possibility of emulating it, to play back the ridiculous amount of excellent C64 music that is available. All I did is see if someone had already done it so far and at least a couple projects have fairly well:





It's not possible to properly emulate the filters I suppose, but the SIDuino in particular makes me think Uzebox could give it a fair shake. Wouldn't run in a game and there might not be enough cycles to even render a basic display maybe, but does it seem possible?
User avatar
uze6666
Site Admin
Posts: 4778
Joined: Tue Aug 12, 2008 9:13 pm
Location: Montreal, Canada
Contact:

Re: C64 SID emulation

Post by uze6666 »

Well, without the filters, I say I could be done. I don't know the math involved for the filters but if that swinsid can do it, we probably can with no game running of course, the vsync mixer and a minimum overhead video mode.
User avatar
danboid
Posts: 1881
Joined: Sun Jun 14, 2020 12:14 am

Re: C64 SID emulation

Post by danboid »

It would be great to see a physical SID/swinSID hacked onto the UB and some games giving the option of using SID sound.
User avatar
danboid
Posts: 1881
Joined: Sun Jun 14, 2020 12:14 am

Re: C64 SID emulation

Post by danboid »

ARMSID is another supposedly more accurate alternative (more accurate than swinsid) to using a real SID.

https://www.retrocomp.cz/produkt?id=2
User avatar
Jubatian
Posts: 1560
Joined: Thu Oct 01, 2015 9:44 pm
Location: Hungary
Contact:

Re: C64 SID emulation

Post by Jubatian »

danboid wrote: Fri Jul 03, 2020 7:05 pm ARMSID is another supposedly more accurate alternative (more accurate than swinsid) to using a real SID.

https://www.retrocomp.cz/produkt?id=2
Certainly looks interesting! Though I think the AVR in the Uzebox could do fairly well to get similar sound with the right approach for programming it. I was already experimenting even with AM/PM synthesis, though I am just not anything really good when it comes to audio, it is rather video which I can do well.
User avatar
danboid
Posts: 1881
Joined: Sun Jun 14, 2020 12:14 am

Re: C64 SID emulation

Post by danboid »

It would be great to have an all new, all-software sound engine for UB but the SID and SID support is a thing unto itself. SID is like an audio platform of sorts and it seems only fitting the UB support SID as best it can.

I wouldn't know where to start coding anything like this at all! I'm a C newb, still grasping basics. It'd be great if UB had audio that could rival the C64 and NES or maybe the MD/SNES.
User avatar
D3thAdd3r
Posts: 3175
Joined: Wed Apr 29, 2009 10:00 am
Location: Minneapolis, United States

Re: C64 SID emulation

Post by D3thAdd3r »

I believe for the right scenario where one was willing to sacrifice something in graphics, you could update the sound more frequently(higher sample rate like SNES) and use more memory for advanced things. I guess the purpose of emulating the SID is more to use all the music already created for it, as something similar but not compatible would only get a few songs, if any, considering the complexity of creating good music in that style for such a limited audience.

The nice thing Uzebox sound is that it is pretty easy to take MIDI files and get them sounding good quickly. In my experience, this is not true with MODs. The sample rate at 15.7Khz is a bit low, but if the PWM speed was increased and the interrupt to feed a new byte happened twice as often(and also the video mode, disabling interrupts, updated sound mid-scanline) then it should work at 31.4khz?? Taking the old style buffered approach, you could really have a lot of cycles to work on sound and emulate different filters/etc. One of the biggest things would be then increasing the 256 byte waves to something larger which would avoid the characteristic aliasing sound. At that point you should theoretically be about in SNES territory, considering you have full blown 31Khz uncompressed(SNES was compressed waves) instruments to use. The SNES had 8 compressed PCM channels, and there is no reason that couldn't be done with the buffered sound mixer. You could probably even get a simple RPG or something to run simultaneously.
User avatar
danboid
Posts: 1881
Joined: Sun Jun 14, 2020 12:14 am

Re: C64 SID emulation

Post by danboid »

MODs as in Amiga mods?

I'm sure I read somewhere this was in development for UB. Is MOD playback possible now, is it WIP or is this a different type of MOD you're talking about?

EDIT

I can see MOD support is already in the kernel but I've not tried it yet. Does it only support 4 channels of samples? Can sfx be triggered whilst a mod is playing in a game and can you play mods from SD card, directly from the UB menu?
User avatar
danboid
Posts: 1881
Joined: Sun Jun 14, 2020 12:14 am

Re: C64 SID emulation

Post by danboid »

I've not seen anyone mention AtmegaSID on here. I wonder how hard it would be to port this to the UB and give it a nice menu to load SID files?

https://sourceforge.net/projects/atmegasid/

It seems it was originally written for the ATMEGA8 MCUs which have inferior spec to the ATMEGA644 so maybe?
Last edited by danboid on Thu Jan 12, 2023 11:07 am, edited 1 time in total.
User avatar
danboid
Posts: 1881
Joined: Sun Jun 14, 2020 12:14 am

Re: C64 SID emulation

Post by danboid »

AtmegaSID is GPL2 licensed like sidplay2 is so it might be possible to borrow some missing bits to create a Uzebox SID player based upon it.

sidplay2 is c++ but I'm sure it'd still be a useful reference as I don't think ATmegaSID can actually play sid files, you're supposed to bit bang it something.

https://sourceforge.net/projects/sidplay2/

https://sourceforge.net/projects/sidpla ... z/download
Post Reply