Microsoft KB Archive/20537

= SOUND & WAVE Common Questions and Problems in Macintosh BASIC =

Article ID: 20537

Article Last Modified on 11/21/2006



This article was previously published under Q20537



SUMMARY
Below is a list of common questions, problems, and answers regarding the SOUND and WAVE statements. SOUND and WAVE are found in Microsoft QuickBASIC 1.00, 1.00a, 1.00b, in Microsoft BASIC Interpreter Versions 2.00, 2.10, and 3.00, and in Microsoft BASIC Compiler Version 1.00 for Apple Macintosh.



MORE INFORMATION
 Which type of wave is quieter, SIN waves or SQUARE waves?

SIN waves are much quieter than the default SQUARE waves when using the SOUND command. Synthesizers also display this characteristic. The attack (and decay) of the SQUARE wave signal amplitude is much quicker than a SIN wave, which results in a louder sound from the speaker. Why can't I change the volume of the SOUND statement when using a non-default wave such as a SIN wave?

The volume argument of the SOUND statement works only in single-voice mode. Page 239 of "Microsoft BASIC Interpreter for Apple Macintosh" manual for Versions 2.x and 3.00 correctly states the following:

The volume argument [of the SOUND statement] is ignored if the system is in multivoice mode.

 How do I change to multivoice mode?

The following invokes multivoice mode:

WAVE 0,SIN

You are in multivoice mode whenever you specify any WAVE statement other than WAVE 0. For example, the statement WAVE 0,SIN invokes multivoice mode, and the volume argument on subsequent SOUND statements will then have no effect. Why does a volume of zero make a sound yet the manual for BASIC interpreter Versions 2.x and 3.00 states that it should not have a volume?

The following is a correction:

Page 239 of the "Microsoft BASIC Interpreter for Apple Macintosh" manual for Versions 2.x and 3.00 should be changed to state that a volume of zero will still make a (minimal) sound.

Page 310 of the "Microsoft QuickBASIC for Apple Macintosh: Language Reference" correctly states the following:

The number given for volume can range from 0 (minimum volume) to 255 (maximum volume). The default volume is 127. The volume argument is ignored if the system is in multivoice mode.

 Why does a SOUND statement make a continuous sound that won't stop (in BASIC interpreter Version 2.00 or 2.10)?

If you run programs in BASIC interpreter Versions 2.00 and 2.10 on the new 128K ROM that comes with ROM upgrades, the MacPlus, and later Macintoshes, then single-voice SOUND creates a sound that cannot be stopped except by resetting the beep volume in the control panel or rebooting.

Because of this ROM problem, BASIC Versions 2.x programs can only use multivoice sound on ROM upgrades, the MacPlus, and later Macintoshes. A sample workaround in BASIC Versions 2.x is WAVE 0,SIN. This workaround puts you into multivoice mode, and subsequent SOUND statements work normally.

The problem has been eliminated in later versions of BASIC. Both single-voice and multivoice sound work correctly in BASIC interpreter Versions 3.00, BASIC compiler Version 1.00, and QuickBASIC Version 1.00.

Additional query words: BasicCom MQuickB

Keywords: KB20537

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.