Jump to content
IGNORED

Teaser: sid 2 gumby


ivop

Recommended Posts

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

  • Like 3
Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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 by ivop
Link to comment
Share on other sites

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....

 

Link to comment
Share on other sites

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 by Mclaneinc
Link to comment
Share on other sites

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..

  • Like 1
Link to comment
Share on other sites

 

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

@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.

Link to comment
Share on other sites

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 :)

Link to comment
Share on other sites

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

  • Like 4
Link to comment
Share on other sites

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 by emkay
Link to comment
Share on other sites

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? :)

Link to comment
Share on other sites

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 :D

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...