Jump to content
IGNORED

Simple examples of using sound?


TonyA

Recommended Posts

Hi,

 

I was wondering if anyone might be able to show me some simple examples of using the sound registers.

 

Would like to produce sound with the joystick, and increase and decrease the volume.

 

 

Tried some stuff like this:

 

rem ----test code 1----

 

 

AUDV0=0

 

 

main

 

 

AUDC0=3

AUDF0=3

 

 

if joy0up then AUDV0=AUDV0+1

if joy0down then AUDV0=AUDV0-1

 

goto main

 

How can I successively increment the volume higher with joy up, and successively decrease the volume with joy down?

 

Thanks for any help.

T

Edited by TonyA
Link to comment
Share on other sites

 

Thank you. It will be helpful.

 

T

I'm working on a new version of Tone Toy which I hope will have more options. I'm still trying to figure out the bast way to go about it, but I hope to have a rough version done before April of 2008.

Link to comment
Share on other sites

 

Thank you. It will be helpful.

 

T

I'm working on a new version of Tone Toy which I hope will have more options. I'm still trying to figure out the bast way to go about it, but I hope to have a rough version done before April of 2008.

 

Thanks. Looking forward to seeing it. Good luck.

 

Tony

Link to comment
Share on other sites

Tony,

 

The trick is that you have to drawscreen before it will play.

 

Note that there are two channels for sound, but you can switch back and forth for the tone/etc. of channel 0 and 1 to simulate more channels by setting the tone/etc. of both channels via AUDC0, AUDF0, AUDV0, AUDC1, AUDF1, AUDV1, then doing drawscreen, and then setting AUDC0, AUDF0, AUDV0, AUDC1, AUDF1, AUDV1 to something else and then again setting AUDC0, AUDF0, AUDV0, AUDC1, AUDF1, AUDV1 and doing drawscreen. This is similar to doing the same switching back and forth with sprites for each drawscreen - there is probably some limit to the number of simulated channels you could emulate via switching without it sounding too muddy, but I don't know what that limit is. My guess is that you could only simulate 4 without it sounding muddy.

 

See more on sound at the page batari wrote that Random Terrain maintains here: http://www.randomterrain.com/atari-2600-me...c-commands.html

 

Hope this helps,

Gary

Edited by Fort Apocalypse
Link to comment
Share on other sites

Tony,

 

The trick is that you have to drawscreen before it will play.

 

Note that there are two channels for sound, but you can switch back and forth for the tone/etc. of channel 0 and 1 to simulate more channels by setting the tone/etc. of both channels via AUDC0, AUDF0, AUDV0, AUDC1, AUDF1, AUDV1, then doing drawscreen, and then setting AUDC0, AUDF0, AUDV0, AUDC1, AUDF1, AUDV1 to something else and then again setting AUDC0, AUDF0, AUDV0, AUDC1, AUDF1, AUDV1 and doing drawscreen. This is similar to doing the same switching back and forth with sprites for each drawscreen - there is probably some limit to the number of simulated channels you could emulate via switching without it sounding too muddy, but I don't know what that limit is. My guess is that you could only simulate 4 without it sounding muddy.

 

See more on sound at the page batari wrote that Random Terrain maintains here: http://www.randomterrain.com/atari-2600-me...c-commands.html

 

Hope this helps,

Gary

 

Hi Gary, thanks. Well I've been experimenting a little with producing sound with the joystick. I did't use drawscreen at all and the compiled bin works fine. I'm probably missing something in your explanation.

 

I'm not using any video right now, just messing around with simple sounds and the joystick.

 

Thanks for the link and help.

 

TOny

Link to comment
Share on other sites

I did't use drawscreen at all and the compiled bin works fine.

 

Hmm. I must have misremembered that. Sorry!

The TIA (and hence bB) will play sounds without having to draw the screen, but the video will be a rolling screen-- although it will probably be a *black* or blank rolling screen, so I guess you might not be able to tell that it's a rolling screen. There are two things that calling drawscreen will do as far as playing sounds-- it will prevent the screen from rolling (which won't *affect* the sound), and it will delay changes to the sound registers so they occur at regular intervals of about 1/60th of a second (NTSC) or 1/50th of a second (PAL/SECAM). So if you're just playing single tones, or controlling the tones with an input device (e.g., a joystick), you probably won't be able to tell any difference between calling drawscreen or not calling drawscreen. But if you're trying to play a tune using data tables, the song is going to play *really* *really* *fast* if you aren't calling drawscreen at all. ;)

 

Michael

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