Jump to content
Sign in to follow this  
Synthpopalooza

Trying to do double POKEY music ...

Recommended Posts

OK, so here's the deal:  I am trying to do a demo tune in double POKEY.  It's the famous Krayt music from metroid.  :)

 

The idea is, POKEY1 has AUDCTL=$7A and double-16 bit with a hi-pass filter to make a finely tuned SID type filter.  POKEY2 is a more standard 16-bit$Ax bass plus two $Ax channels.

 

The question is ... does anybody have any ideas on how to modify my code, so that both POKEY's can be addressed, and all 8 channels played at once?  I'm stumped ...

 

Attaching my sources, plus a mixed recording from Altirra which is meant to demonstrate what the mixed output should sound like.

 

On the binary, press START key to switch between the two POKEY tunes. 

 

TUNE00-TUNE03 is first POKEY tune

TUNE04-TUNE07 is the second POKEY

 

What I want to do is to play both these at the same time, addressing both POKEYs.

 

 

metroid - krayt's lair - double pokey mix.wav metroid-krayt.asm metroid-krayt.bat metroid-krayt.s metroid-krayt.xex

Share this post


Link to post
Share on other sites

I don't quite get it - you just want to play each tune on a single Pokey?

So you'd just call your player routine for each one, ensuring tune 2 is addressing the second Pokey.

I had a quick look at the first one- looks like you just JSR to a play routine in defferred VBlank.   I suppose the other modification to the playback routine would be to ensure each one is using it's own work variables.

Share this post


Link to post
Share on other sites

 

10 hours ago, Rybags said:

I don't quite get it - you just want to play each tune on a single Pokey?

So you'd just call your player routine for each one, ensuring tune 2 is addressing the second Pokey.

I had a quick look at the first one- looks like you just JSR to a play routine in defferred VBlank.   I suppose the other modification to the playback routine would be to ensure each one is using it's own work variables.

 

Took a look, it's actually easier because each tune is linked to a channel. So I did the modification and it seems to work

 

krayt.thumb.png.5813be0bedc30e233f0294785e2ea77b.png

 

Beware though it seems the lastest Altirra 3.90 beta is required (test 21)

 

I tried with earlier 3.90 releases and it didn't work... 

 

@Synthpopalooza the 2nd tune should just be a matter of replacing the sounddata (tune0-7). I also did some code cleanup (removed those nasty ORGs and scoped those tune variables)

krayt.zip

  • Thanks 1

Share this post


Link to post
Share on other sites

Incidentally ...

 

The reset timer code is only used when using $Cx mod 3 distortion (smooth bass/sawtooth).  Normally this will output three random timbres, but the reset timer is used to reset the polycounters and stabilize the timbre.  In this piece of music it's not needed, as nothing here uses $Cx mod 3

 

This works excellently, thanks!

Share this post


Link to post
Share on other sites

Also:  Plays on Altirra 3.20, but with some slight stuttering.  I'll get the latest ...

 

Also Altirra feature request for Avery:  Ability to put stereo POKEY into mono double POKEY, for tunes like this.  :)

Edited by Synthpopalooza

Share this post


Link to post
Share on other sites

Specifically:

 

On the krayt music, POKEY1 has double 16-bit plus hi pass.  AUDCTL=$7A.  The 16 bit value in the last two channels filters the 16-bit value in the first, hence the swirling sound.

 

Also:  On the brinstar theme, I'm using $Cx distortions in 16-bit to make those pulse lead sounds.  Not currently doable in RMT.

Share this post


Link to post
Share on other sites
20 hours ago, Synthpopalooza said:

 

The reset timer code is only used when using $Cx mod 3 distortion (smooth bass/sawtooth).  Normally this will output three random timbres, but the reset timer is used to reset the polycounters and stabilize the timbre.  In this piece of music it's not needed, as nothing here uses $Cx mod 3

 

Yeah I didn't even know if that would work if I converted it to stereo pokey, so I skipped it but hopefully you'll figure it out

19 hours ago, Synthpopalooza said:

Also:  Plays on Altirra 3.20, but with some slight stuttering.  I'll get the latest ...

 

I'm not sure which Altirra version is required anymore, seems like my TV was set to mono for the past year 😏

Share this post


Link to post
Share on other sites

I think the reset timer is ok to use on a case by case basis ... i.e. depending on which POKEY is playing the $Cx mod 3 notes, you then reset the polycounters of that particular POKEY.  I suppose I should do up a double POKEY demo that uses $Cx mod 3 on both POKEYs to test it out.

Share this post


Link to post
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.

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...
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...