ivop Posted June 11, 2012 Share Posted June 11, 2012 Hi, Instead of emulating the sid sound, here's a teaser of my latest coding session. It's running the real .sid player routine, just like atarisid3, but it sounds like Pokey instead. I'm pretty pleased with the results Works correctly in atari800, but there seems a bug in the gumby emulation of Altirra-2.0. 16-bit noise on AUDC3/4 on the second pokey doesn't seem to work. It keeps playing a pure tone. Or maybe I am doing something wrong, which is entirely possible It runs of the NMI and doesn't use nearly as much CPU time as atarisid3. Enjoy! Source will be posted later when I have them all cleaned up and ready for release. sid2gumby-ik.xex sid2gumby-cybernoid2.xex 3 Quote Link to comment Share on other sites More sharing options...
Rybags Posted June 11, 2012 Share Posted June 11, 2012 Yes, definately something going wrong in Altirra there. Showing .pokey state in the debugger indicates the registers are as you would expect but the sound isn't right. Seemed to work fine in Atari800Win+ How are you doing the frequency translations? Is it some big table-lookup or have you got some nice conversion algorithm for us? Quote Link to comment Share on other sites More sharing options...
+JAC! Posted June 11, 2012 Share Posted June 11, 2012 Really nice! Incredibly good results for my taste. Quote Link to comment Share on other sites More sharing options...
emkay Posted June 11, 2012 Share Posted June 11, 2012 (edited) Really nice! Incredibly good results for my taste. Why? 2 channels at 16 bit ... they only wait to be programmed as 16 bit Edited June 11, 2012 by emkay Quote Link to comment Share on other sites More sharing options...
ivop Posted June 11, 2012 Author Share Posted June 11, 2012 (edited) Yes, definately something going wrong in Altirra there. Showing .pokey state in the debugger indicates the registers are as you would expect but the sound isn't right. Seemed to work fine in Atari800Win+ Is somebody going to notify phaeron about this? How are you doing the frequency translations? Is it some big table-lookup or have you got some nice conversion algorithm for us? Depends on what you call big 65536 words would take a LUT of 128kB, which is not what I use. The formula needs either a division or a multiplication with 1/x (which needs a LUT, too) and both need to be done in floats or at least 24-bit fixed point. Way too slow for the 6502 to do three times in a frame. But I devised a way to compress the table in such a way that I can do look-ups directly. Right now, it takes about 18kB to convert a SID frequency value to a Pokey 16-bit divisor. The code btw is not really optimized yet, but it's fast enough. I just fixed the conversion of the noise waveform, which needs an extra divide by 16 on the divisor for distortion 8. Sounds better now IMHO. The previous version divided by 8. Division by 16 is faster, so that's a bonus, too. I'm almost inclined to say that some tunes sound better than the original Here are the .xex files, added a few more. sid2gumby-ik.xex sid2gumby-cybernoid2.xex sid2gumby-delta.xex sid2gumby-monty.xex sid2gumby-sanxion.xex Edited June 11, 2012 by ivop Quote Link to comment Share on other sites More sharing options...
emkay Posted June 12, 2012 Share Posted June 12, 2012 At least this project shows the 16 bit possibilities. I never understood, why Raster didn't include this into his Tracker. SID tunes could be played on one POKEY though. Using 2 16 bit channels leaves one percussion channel free. Chords and brass low notes could always be played using filter and modulation FX. Bass sounds can be stabilized, same with polycounter sounds for melodic parts. And, when a clean frequency portamento is needed , 16 bit wait to get used .... and can be manipulated with voloume programmig.... Quote Link to comment Share on other sites More sharing options...
Mclaneinc Posted June 12, 2012 Share Posted June 12, 2012 (edited) Yes, definately something going wrong in Altirra there. Showing .pokey state in the debugger indicates the registers are as you would expect but the sound isn't right. Seemed to work fine in Atari800Win+ Is somebody going to notify phaeron about this? He's most likely read it but I'll put it on the blog & email him.. [done] Edited June 12, 2012 by Mclaneinc Quote Link to comment Share on other sites More sharing options...
Mclaneinc Posted June 12, 2012 Share Posted June 12, 2012 At least this project shows the 16 bit possibilities. I never understood, why Raster didn't include this into his Tracker. SID tunes could be played on one POKEY though. Using 2 16 bit channels leaves one percussion channel free. Chords and brass low notes could always be played using filter and modulation FX. Bass sounds can be stabilized, same with polycounter sounds for melodic parts. And, when a clean frequency portamento is needed , 16 bit wait to get used .... and can be manipulated with voloume programmig.... Credit where credits due, we may not agree sometimes but you know your audio stuff and produce some fantastic tunes, same goes for Ivor.. 1 Quote Link to comment Share on other sites More sharing options...
spookt Posted June 12, 2012 Share Posted June 12, 2012 Nice work. I'm enjoying the tunes. Quote Link to comment Share on other sites More sharing options...
emkay Posted June 12, 2012 Share Posted June 12, 2012 Credit where credits due, we may not agree sometimes but you know your audio stuff and produce some fantastic tunes, same goes for Ivor.. The results are very good. But, to be honest, produced music on the A8 is even more worth, if you can use it in other projects /cpu usage is low enough. I'd bet, many A8 users didn't realize the 16 bit quality, before hearing the tunes from above. It's still possible to have "fair" SID conversions by just programming SID with low CPU usage. That should still be "one" goal. Quote Link to comment Share on other sites More sharing options...
Mclaneinc Posted June 12, 2012 Share Posted June 12, 2012 Yes, I'd like to hear that... A game with high quality music ingame is always a pleasure Quote Link to comment Share on other sites More sharing options...
miker Posted June 12, 2012 Share Posted June 12, 2012 Pretty good result, but... isn't it a waste of two POKEYs? I would use 16-bit sound only where it's really needed. Or do something like there -> http://www.atari.fandal.cz/detail.php?files_id=2483 (especially on title). Quote Link to comment Share on other sites More sharing options...
emkay Posted June 12, 2012 Share Posted June 12, 2012 Pretty good result, but... isn't it a waste of two POKEYs? I would use 16-bit sound only where it's really needed. Or do something like there -> http://www.atari.fandal.cz/detail.php?files_id=2483 (especially on title). It's good to have them, as it explains a part of my "experiments" with RMT. Quote Link to comment Share on other sites More sharing options...
Tezz Posted June 12, 2012 Share Posted June 12, 2012 @Ivo: Cool stuff again Are you aware of SiD2POKEY? I based my port of Chimera in the same way. Quote Link to comment Share on other sites More sharing options...
miker Posted June 12, 2012 Share Posted June 12, 2012 Regarding SID2POKEY... Here are two examples attached in .zip here: http://www.atariage.com/forums/topic/81605-an-idea-someone/?do=findComment&comment=997351 Quote Link to comment Share on other sites More sharing options...
phaeron Posted June 13, 2012 Share Posted June 13, 2012 Looks like the second POKEY isn't being initialized -- needs a write to SKCTL=$03 for the polynomial counters to run. You can get away with this with the main POKEY because the OS will do it as part of init, but not for a secondary POKEY. On real hardware, the secondary POKEY will be in random state, so there's no telling what you're going to get. I recommend clearing all the registers including writing $00 to SKCTL, then writing $03 to SKCTL. Additionally, there's a bug in the .pokey command in Altirra's debugger that is causing the primary POKEY's state to be shown twice, obscuring the problem. Quote Link to comment Share on other sites More sharing options...
ivop Posted June 13, 2012 Author Share Posted June 13, 2012 Pretty good result, but... isn't it a waste of two POKEYs? I would use 16-bit sound only where it's really needed. True, but in the case of replaying whatever sid file you throw at it, you don't upfront how many 16-bit channels you need That's why I chose to have them all at 16-bit. Plus, if you need two channels with that resolution, you are already out of voices on one Pokey and a lot of sids have chirpingly high chords or "Hubbard" ee-oo drums and a high melody. I'm sure a lot of tunes could be fine-tuned to run fine on one pokey, but that was not the goal of this project. Quote Link to comment Share on other sites More sharing options...
ivop Posted June 13, 2012 Author Share Posted June 13, 2012 @Ivo: Cool stuff again Are you aware of SiD2POKEY? I based my port of Chimera in the same way. Nope, was not aware of that either. Anything else significant I should know about that was released between 1995 and 2009? I know about Numen, Project-M and Rybag's i480 trick. Quote Link to comment Share on other sites More sharing options...
ivop Posted June 13, 2012 Author Share Posted June 13, 2012 Looks like the second POKEY isn't being initialized -- needs a write to SKCTL=$03 for the polynomial counters to run. You can get away with this with the main POKEY because the OS will do it as part of init, but not for a secondary POKEY. On real hardware, the secondary POKEY will be in random state, so there's no telling what you're going to get. I recommend clearing all the registers including writing $00 to SKCTL, then writing $03 to SKCTL. Additionally, there's a bug in the .pokey command in Altirra's debugger that is causing the primary POKEY's state to be shown twice, obscuring the problem. Ah, I see. I had looked for something to initialize already, but my documentation didn' t mention anything about needing SKCTL to start the polycounters. Thanks! I have it fixed now. And without this mistake, you wouldn't have found the '.pokey' debugger bug yet Quote Link to comment Share on other sites More sharing options...
ivop Posted June 13, 2012 Author Share Posted June 13, 2012 Here are 12 songs with the latest incarnation of sid2gumby that should work on Altirra too. Not tested though, as I don' t have wine on this machine. Included are: Hubbard: Crazy Comets Commando Delta International Karate Lightforce Monty On The Run Sanxion Tel: Cybernoid Cybernoid 2 JT42 Myth Mix Laxity: Freeze Enjoy! 12songs.zip 4 Quote Link to comment Share on other sites More sharing options...
Mclaneinc Posted June 13, 2012 Share Posted June 13, 2012 Seems ok on Altirra now from a brief listen.. Quote Link to comment Share on other sites More sharing options...
emkay Posted June 13, 2012 Share Posted June 13, 2012 (edited) Ahem... something completely different. If it is possible to play SIDs that way on the Atari. Shouldn't it finally be possible to extract the correct notes of the used 3 channels there? If someone helps to bring them into RMT, I'd like to do do some additional demonstrations.... Edited June 13, 2012 by emkay Quote Link to comment Share on other sites More sharing options...
Creature XL Posted June 14, 2012 Share Posted June 14, 2012 Ahem... something completely different. If it is possible to play SIDs that way on the Atari. Shouldn't it finally be possible to extract the correct notes of the used 3 channels there? If someone helps to bring them into RMT, I'd like to do do some additional demonstrations.... You can use tools like siddump for this. You get a long listing of notes and waveform/ADSR values. Writing a converter for RMT would be possible. I have written a simple one to convert to ".byte" statements for my tests. Can RMT import tracks as text files? If not, is the RMT format documented? Of did oyu mean somthing totally different? Quote Link to comment Share on other sites More sharing options...
emkay Posted June 14, 2012 Share Posted June 14, 2012 Ahem... something completely different. If it is possible to play SIDs that way on the Atari. Shouldn't it finally be possible to extract the correct notes of the used 3 channels there? If someone helps to bring them into RMT, I'd like to do do some additional demonstrations.... You can use tools like siddump for this. You get a long listing of notes and waveform/ADSR values. Writing a converter for RMT would be possible. I have written a simple one to convert to ".byte" statements for my tests. Can RMT import tracks as text files? If not, is the RMT format documented? Of did oyu mean somthing totally different? No... the direction is correct Quote Link to comment Share on other sites More sharing options...
ivop Posted June 15, 2012 Author Share Posted June 15, 2012 Here's the source code: http://www.atariage.com/forums/blog/293/entry-9221-sid-2-gumby-source-code/ As for extracting the song information and converting it to RMT, if you look at the output of siddump, you'll notice that it's not quite that easy. Detecting vibrato, portamento and arpeggios is a non-trivial task. And to repeat CreatureXL, is the RMT file format documented somewhere? I quickly glanced over it with hexedit(1) and it does not seem too complex, but a specification would be nice instead of reverse-engineering it. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.