NEW
10 REM * SOUND EFFECTS WITH FOR-NEXT LOOP
20 VOICE=0:PITCH=0:TONE=10:VOL=8
30 FOR PITCH=0 TO 255
40 SOUND V O I C E , P I T C H , T O N E , V O L
50 NEXT PITCH
R U N
Varying the volume in a program produces a variety of sounds. Change
VOL = 8 to VOL = 0 and press . Then add the following line:
35 VOL=INT(RND(0)*16)
This line randomly selects a value between 0 and 15 for the volume
variable. Run the program to find out how randomly changing the
volume affects the sound.
Making Music
The SOUND command can produce musical tones as well. The follow-
ing scale includes musical notes and their pitch values:
Note Pitch
high C 29
B 31
A 35
G 40
F 45
E 47
D 53
C 60
B 64
A 72
G 81
F 91
E 96
D
108
middleC 121
Type and run the following program:
NEW
10 R E M ** SIMPLE SONG
15 DIM PITCH$ (1)
20 VOICE=0:PITCH=0:TONE = 10:VOL = 8
30 REM ** C=121:D = 108:E=96:F=91
40 T R A P 300
50 PRINT " "
67
Содержание 65XE
Страница 1: ...ATARI 65XE PERSONAL COMPUTER OWNER S MANUAL TM...
Страница 3: ...ATARI 65XE PERSONAL COMPUTER TM...
Страница 6: ...Part 1 GettingStarted 1...
Страница 9: ...4...
Страница 23: ...18...
Страница 25: ...20...
Страница 32: ...Part 2 Programming withATARI BASIC 27...
Страница 33: ...28...
Страница 59: ...54...
Страница 69: ...64...
Страница 82: ...Part3 Appendices 77...
Страница 83: ...78...
Страница 97: ...92...
Страница 105: ...100...
Страница 125: ...120...
Страница 126: ...121 Index...
Страница 127: ...122...
Страница 134: ...ATARI 1987 Atari Corp All Rights Reserved Printed in Taiwan C072018 001 REV B K l 2 1987...
Страница 135: ......