Bypass navigation menu
RGB Classic Games
Keeping the classics alive
Currently hosting 566 great games!
Return to Chapter 2

ExtSound(Frequency, Duration, Volume, Channel)

Generates a sound with the specified frequency, duration, volume, and sound channel.

This function works exactly like the SOUND function in the special version of GW-BASIC that came with you Tandy 1000/PCjr. Sounds can be made in background if you enable sound buffering. This means that your program will continue to execute while sounds are being made. Each sound channel has its own sound buffer. Each buffer can hold up to 64 entries.

Parameters

Frequency is a number 110 - 32767:
This is the tone to produce in Hertz. Certain frequencies correspond to
musical notes. The following chart shows the frequency for each
corresponding note:

NoteFreqNoteFreqNoteFreqNoteFreq
C265A3220F#5740C72489
C#269A#3233G5784C#72637
D273B3247G#5831D72794
D#278C4262A5880D#72960
E282C#4277A#5932E73136
F287D4294B5988F73322
F#293D#4311C61047F#73520
G298E4330C#61109G73729
G#2104F4349D61175G#73951
A2110F#4370D#61245A74186
A#2116G4392E61319A#74435
B2123G#4415F61397B74699
C3131A4440F#61480C84978
C#3139A#4466G61568C#85274
D3147B4494G#61661D85587
D#3156C5523A61760F#85919
E3165C#5554A#61865G86271
F3175D5587B61976G#86645
F#3185D#5622D#82093A87040
G3196E5659E82217A#87459
G#3208F5698F82349B87902

The Texas Instruments SN76496 sound chip in the Tandy 1000 cannot produce frequencies below 110 Hertz. If you use the above chart please remember you cannot make notes below A2.

Duration is a number 0 - 65535:
This is the number of clock ticks the sound will last. See the FastTimer function for more information on clock ticks.

Volume is a number 0 - 15:
0 is the quietest.
15 is the loudest.

Sound channel is a number 0 - 2:
This is the sound channel to use when producing the sound. You can set each sound channel to a different tone to make a 3-note chord.

Examples

BASIC

CALL ExtSound(880, 8, 7, 0)

PASCAL

ExtSound(880, 8, 7, 0);