Jump to content
IGNORED

topscreenroutine and psound


fultonbot

Recommended Posts

Quick question:  I want to get a constant playback rate for pokey music, but when I put my gosub to my play code in topscreenroutine , it appear doesn't work.  Is there an issue with psound in topscreenroutine, is there an issue with a gosub in topscreenroutine?, or did I imagine all this?

 

Also, since I'm trying to make the playback independent of frame-rate (i.e no matter if I have drawscreen or doublebuffer 1,2,3, etc.) will this even work?  Is here a better way to make sure music plays back at a constant regardless of display frame rate?

 

 

Link to comment
Share on other sites

The interrupts (top screen, bottom screen, and user interrupt) should really be kept as simple as possible... I should underscore that in the manual. The problem with a bunch of complex code with 7800basic statements is they're likely to modify temp variables, which is problematic.

 

Your gosub likely uses a temp variable here. I think psound might be ok for temps, so you might get away with that, if you avoid the gosub.

  • Like 1
Link to comment
Share on other sites

9 hours ago, RevEng said:

The interrupts (top screen, bottom screen, and user interrupt) should really be kept as simple as possible... I should underscore that in the manual. The problem with a bunch of complex code with 7800basic statements is they're likely to modify temp variables, which is problematic.

 

Your gosub likely uses a temp variable here. I think psound might be ok for temps, so you might get away with that, if you avoid the gosub.

That's what I expected.

Thanks!

 

-Steve

  • Like 1
Link to comment
Share on other sites

On 12/8/2020 at 7:29 PM, fultonbot said:

Quick question:  I want to get a constant playback rate for pokey music, but when I put my gosub to my play code in topscreenroutine , it appear doesn't work.  Is there an issue with psound in topscreenroutine, is there an issue with a gosub in topscreenroutine?, or did I imagine all this?

 

Also, since I'm trying to make the playback independent of frame-rate (i.e no matter if I have drawscreen or doublebuffer 1,2,3, etc.) will this even work?  Is here a better way to make sure music plays back at a constant regardless of display frame rate?

On the Atari 8 bit line, it was common to have music playing handled in a vertical blank routine.

 

I haven't tried 7800 programming (yet), but I do have a macro assembler library adapted from an old issue of Compute you are welcome to try adapting if you want. It is in ca65 syntax, but it probably wouldn't be too much work to change it for DASM (which is what the studio you are using uses?). I've used it in all my Atari 800 games.

 

The way this library works is you point it at a data table of the music (or sound effect), which supports commands for setting tone and volume (pokey), and sets of duration+note data (for 1-4 voices, and you can switch as needed to save memory).

 

For example, here is a "Whoosh" sound effect

 

Whoosh:
    .BYTE ST,NU,1
    .BYTE TV,14,1,14
    .BYTE TV,12,1,12
    .BYTE TV,10,1,10
    .BYTE TV,8,1,8
    .BYTE TV,6,1,6
    .BYTE TV,2,1,2
    .BYTE TV,0,3,0
    .BYTE ST,EN
 

 

 

Link to comment
Share on other sites

18 hours ago, bhall408 said:

On the Atari 8 bit line, it was common to have music playing handled in a vertical blank routine.

 

I haven't tried 7800 programming (yet), but I do have a macro assembler library adapted from an old issue of Compute you are welcome to try adapting if you want. It is in ca65 syntax, but it probably wouldn't be too much work to change it for DASM (which is what the studio you are using uses?). I've used it in all my Atari 800 games.

 

The way this library works is you point it at a data table of the music (or sound effect), which supports commands for setting tone and volume (pokey), and sets of duration+note data (for 1-4 voices, and you can switch as needed to save memory).

 

For example, here is a "Whoosh" sound effect

 

Whoosh:
    .BYTE ST,NU,1
    .BYTE TV,14,1,14
    .BYTE TV,12,1,12
    .BYTE TV,10,1,10
    .BYTE TV,8,1,8
    .BYTE TV,6,1,6
    .BYTE TV,2,1,2
    .BYTE TV,0,3,0
    .BYTE ST,EN
 

 

 

This is cool!  Yeah, I've already kind of made my own version of this in 7800 basic now:

 

sdata song_rudolph = a  
         2,0,A4,10,0,15,DFRAMES,P_ATTACK,1,100,4,12,3,2,P_CONSTANT,
         1,0,B4,10,0,15,DFRAMES,P_ATTACK,
         2,0,B4,0,0,0,DFRAMES,P_CONSTANT,1,100,4,12,3,2,P_CONSTANT,
         1,0,A4,10,0,15,DFRAMES,P_ATTACK,
         2,0,FS4,10,0,15,DFRAMES,P_ATTACK,1,100,4,12,3,2,P_CONSTANT,
         1,0,0,0,0,0,DFRAMES,P_CONSTANT,
 

 

You can specify number of channels to read, Note (freq), beginning and ending volume, duration, and and attack/decay/constant for the tone.

Here is what my current work sounds like:

(4) Atari 7800 Xmas Demo #1: Title Screen With Transcribed Pokey Music. - YouTube

 


  

  • Like 1
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...