|
Playing sounds and MusicLogo allows the user to play music, sounds using the following statements - TONE or SOUND - SOUNDON - SOUNDOFF - PLAYWAVE The TONE or SOUND statements allow the user to play music on the pc speaker. The syntax is as follows: SOUND [pitch duration] or TONE pitch duration Example: SOUND [40 100] TONE 40 100 The SOUNDON & SOUNDOFF statements are used simultaneously. The difference between the SOUNDON and SOUND statements is that SOUNDON plays a sound for an undetermined time until a SOUNDOFF statement is issued.
The example below plays the melody: “Au Clair De La Lune”. TO music startup PLAY [C 500] PLAY [C 500] PLAY [C 500] PLAY [D 500] PLAY [E 1000] PLAY [D 1000] PLAY [C 500] PLAY [E 500] PLAY [D 500] PLAY [D 500] PLAY [C 1500]
END
TO PLAY :SONG IF EMPTY? :SONG [STOP] IF EMPTY? BF :SONG [STOP] TONE THING FIRST :SONG FIRST BF :SONG PLAY BF BF :SONG END
TO startup MAKE "a 881 MAKE "b 988 MAKE "c 523 MAKE "d 587 MAKE "e 659 MAKE "f 698 MAKE "g 784 MAKE "c2 1047 MAKE "REST 0 END
The PLAYWAVE statement
The PLAYWAVE statement plays a wave file.
Example:
PLAYWAVE "c:\\windows\\media\\tada.wav 0
| |||||||||||||||