Atari 130XE — 130XE Owners Manual_Page_074

60 PRINT "NOTES FOR SIMPLE SONG" 65 FOR NOTE= 1. TO 8 70 READ PITCH 80 SOUND UOICE .. PITCH .. TONE .. UOL '30 GOSUB 200 1.00 PRINT: PRINT PITCH$ 1.1.0 FOR PAUSE=1. TO 500: NEXT PAUSE 1.20 SOUND 0 .. 0 .. 0 .. 0 1.30 NEXT NOTE 1.40 GOTO 300 1.50 REM ** DATA FOR NOTES 1.60 DATA 1.21. .. 1.21. .. 1.08 .. '36 .. '36 .. '31. .. 1.08 .. 1.21. 200 REM ** PRINT NOTES 21.0 IF PITCH=1.21. THEN PITCH$="C" 220 IF PITCH=1.08 THEN PITCH$=" D" 230 IF PITCH='36 THEN PITCH$="E" 240 IF PITCH='31. THEN PITCH$=" F" 250 RE · TURN 300 PRINT: PRINT" END OF SIMPLE SONG" :

END RUN The GOSUB-RETURN and READ-DATA commands allow the computer to produce different notes by inserting a series of values for the variable PITCH . GOSUB tells the computer to go to the "subroutine" that starts at line 200 and continues to line 250; the RETURN com- mand sends the computer back to the line immediately below the GOSUB line. The READ command tells the computer to pick up an item in the DATA line and insert it into the variable. The computer con- tinues to loop through the program until all the values in the DATA line have been 'used. The program also uses a FOR-NEXT loop to determine how long the notes last.

Using different FOR-N EXT loops, try modifying the program to produce whole notes, half notes, and other kinds of notes. For more information about programming with sound, refer to the Resources section of this guide. COLORFUL GRAPHICS Your ATARI 130XE has 16 graphics modes encompassing 256 colors. To get you started, this section presents 6 different modes and some of the most essential graphics commands. The following chart lists the 16 basic colors and their corresponding number values. (The colors va ry somewhat according to the adjust- ment of the hue control on your television set.) 68