Jump to content



0

Simple examples of using sound?


8 replies to this topic

#1 TonyA OFFLINE  

TonyA

    Star Raider

  • 64 posts

Posted Sat Mar 1, 2008 8:21 AM

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, Sat Mar 1, 2008 8:43 AM.


#2 Gorf OFFLINE  

Gorf

    River Patroller

  • 4,633 posts

Posted Sat Mar 1, 2008 9:03 AM

See if this can help.....
http://www.atariage....showtopic=77106

#3 TonyA OFFLINE  

TonyA

    Star Raider

  • 64 posts

Posted Sat Mar 1, 2008 9:29 AM

View PostGorf, on Sat Mar 1, 2008 12:03 PM, said:

See if this can help.....
http://www.atariage....showtopic=77106

Thank you. It will be helpful.

T

#4 Random Terrain OFFLINE  

Random Terrain

    Visual batari Basic User

  • 20,906 posts
  • Controlled Randomness
    Replay Value
    Nonlinear
  • Location:North Carolina (USA)

Posted Sat Mar 1, 2008 12:39 PM

View PostTonyA, on Sat Mar 1, 2008 10:29 AM, said:

View PostGorf, on Sat Mar 1, 2008 12:03 PM, said:

See if this can help.....
http://www.atariage....showtopic=77106

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.

#5 TonyA OFFLINE  

TonyA

    Star Raider

  • 64 posts

Posted Sat Mar 1, 2008 1:09 PM

View PostRandom Terrain, on Sat Mar 1, 2008 3:39 PM, said:

View PostTonyA, on Sat Mar 1, 2008 10:29 AM, said:

View PostGorf, on Sat Mar 1, 2008 12:03 PM, said:

See if this can help.....
http://www.atariage....showtopic=77106

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

#6 Fort Apocalypse OFFLINE  

Fort Apocalypse

    Stargunner

  • 1,593 posts

Posted Sat Mar 1, 2008 1:34 PM

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.randomter...c-commands.html

Hope this helps,
Gary

Edited by Fort Apocalypse, Sat Mar 1, 2008 1:35 PM.


#7 TonyA OFFLINE  

TonyA

    Star Raider

  • 64 posts

Posted Sun Mar 2, 2008 9:08 AM

View PostFort Apocalypse, on Sat Mar 1, 2008 4:34 PM, said:

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

#8 Fort Apocalypse OFFLINE  

Fort Apocalypse

    Stargunner

  • 1,593 posts

Posted Sun Mar 2, 2008 9:52 PM

View PostTonyA, on Sun Mar 2, 2008 10:08 AM, said:

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

Hmm. I must have misremembered that. Sorry!

#9 SeaGtGruff OFFLINE  

SeaGtGruff

    River Patroller

  • 4,543 posts
  • Location:Georgia, USA

Posted Sun Mar 2, 2008 11:27 PM

View PostFort Apocalypse, on Sun Mar 2, 2008 10:52 PM, said:

View PostTonyA, on Sun Mar 2, 2008 10:08 AM, said:

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




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users