I have updated the code for the SIDshield, now it's actually useable to play some music in a relatively easy way. Here is the new library, and here is a simple player with a little melody. The player code is basically ported from the SIDcog, including the stored melody - so that remains copyright "Ahle2"! (Who deserves lots of respect for writing SIDcog)
The biggest problem with my code is that I didn't spend much effort in getting the timing correct so it's a bit wonky.
NOTE the Arduino environment puts static tables in RAM, which is very limited especially on the Atmega168. I would constantly get mysterious malfunctions, including the inability to upload new sketches - effecitvely "bricking" the Arduino. This can be fixed by carefully removing and resetting the power using the jumper and timing the upload of a new sketch. It took me quite a while to figure out the solution.
The solution is to ensure the music data is in program memory: using the PROGMEM keyword. Its use is a bit involved, since one can't simply access it as arrays but has to explicitly copy it using special functions. See the player app.
UPDATE: The files got moved to my homepage, I adjusted the links accordingly.
No comments:
Post a Comment