rolandshacks / vs64

C64 Development Environment for Visual Studio Code
Other
97 stars 16 forks source link

Missing audio example #37

Closed gpaluk closed 1 year ago

gpaluk commented 1 year ago

I set up this cross compiler today as I saw the reference to the audio features. I am keen to create a simple audio player for my own C64 music. After setting everything up I was very pleased with this amazing library. I have the full C example working with starfield and bouncing sprites etc but I was a little disappointed to discover that there was no example for the Audio library. I wonder if anyone knows of any existing example or if there were plans to add an example for the C audio library any time soon? Regards,

rolandshacks commented 1 year ago

Hi. I am not sure whether I correctly understand your question - vs64 is an add-on for Visual Studio Code. It comes with a few tiny examples and that is it. There no "audio library". Maybe you are referring to another repository, which is "c64hacks" - which contains audio playback based on a SID file. SID files aren't just audio data, they are full blown C65/6502 executables to set registers, etc. If you're interested, I recommend looking for SID and maybe for tooling have a look at GoatTracker2 - which has also been used to generate the SID file used in the demo.

gpaluk commented 1 year ago

Hi. I am not sure whether I correctly understand your question - vs64 is an add-on for Visual Studio Code. It comes with a few tiny examples and that is it. There no "audio library". Maybe you are referring to another repository, which is "c64hacks" - which contains audio playback based on a SID file. SID files aren't just audio data, they are full blown C65/6502 executables to set registers, etc. If you're interested, I recommend looking for SID and maybe for tooling have a look at GoatTracker2 - which has also been used to generate the SID file used in the demo.

I meant here... You even seem to have added a placeholder:

rolandshacks commented 1 year ago

Ah, I see. You're right, this is indeed a placeholder - but there never was a plan to add music playback. Maybe I could in the future, but it wasn't a priority. If you're interested, look at https://github.com/rolandshacks/c64hacks - that's the full version of the demo, including audio playback. It is in C++, but that audio part is a tiny thing which you could take over to get started. For the rest, it is what I mentioned above: look at the SID format, look at GoatTracker2, have a bit of fun with raster interrupts and assembly code, that is it. You will find plenty of (better) code on the internet on how to playback music on the C64...