BBC BASIC for Windows
« basic sound »

Welcome Guest. Please Login or Register.
Apr 5th, 2018, 11:54pm



ATTENTION MEMBERS: Conforums will be closing it doors and discontinuing its service on April 15, 2018.
Ad-Free has been deactivated. Outstanding Ad-Free credits will be reimbursed to respective payment methods.

If you require a dump of the post on your message board, please come to the support board and request it.


Thank you Conforums members.

BBC BASIC for Windows Resources
Online BBC BASIC for Windows documentation
BBC BASIC for Windows Beginners' Tutorial
BBC BASIC Home Page
BBC BASIC on Rosetta Code
BBC BASIC discussion group
BBC BASIC for Windows Programmers' Reference

« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: basic sound  (Read 567 times)
leslie griffin
Guest
xx basic sound
« Thread started on: Mar 14th, 2010, 9:02pm »

is there a way to get a program to flow normally while executing a sound command.
Im getting quite good at moving my sprites arround the screen and detecting collisions but must keep the final parameter of the sound command very small because everything stops until it completes........thx
User IP Logged

admin
Administrator
ImageImageImageImageImage


member is offline

Avatar




PM


Posts: 1145
xx Re: basic sound
« Reply #1 on: Mar 14th, 2010, 10:17pm »

on Mar 14th, 2010, 9:02pm, Guest-leslie griffin wrote:
is there a way to get a program to flow normally while executing a sound command.

Of course. Sounds are played asynchronously and sound 'events' are queued so that you can play (for example) music to accompany a program without it pausing.

The only time a SOUND statement will stall a program is if the queue for that channel is already full; you can test for that condition using ADVAL. If you only ever issue a SOUND statement when there is space in the queue for that channel, it won't stall. Conceptually you can do that using code such as the following:

Code:
      IF ADVAL(-6) THEN SOUND 1,level,pitch,dur 

For example suppose you were reading the sound parameters from DATA statements, you could then do:

Code:
      IF ADVAL(-6) THEN
        READ level,pitch,dur
        SOUND 1,level,pitch,dur
      ENDIF 

It gets a little more complicated if you're using more than one channel, but hopefully you get the idea.

Richard.
User IP Logged

Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

| |

This forum powered for FREE by Conforums ©
Terms of Service | Privacy Policy | Conforums Support | Parental Controls