Commodore VIC-20 User Manual page 110

Hide thumbs Also See for VIC-20:
Table of Contents

Advertisement

PROGRAM 4: Choose A Note
(Chapter 5)
NEW
10 PRINT'
FOR I = 1 TO 5
POKE 36873+1,0
NEXT I
This
means
the VIC
wants you
to input a
number
PRINT "WHICH VOICE (1-4)?"
PRINT "IF DONE. ENTER 0"
INPUT N
IFN=0THEN END
PRINT "WHICH PITCH (128-254)?"
INPUT P <
POKE 36878, 4
POKE 36873+ N,P
FOR J = 1 TO 2000: NEXT N
GOTO 10
When you've checked that all the lines are correct, try running
this program (type RUN and press RETURN). It will let you
select a voice and a pitch, and play the tone you've chosen for
about two seconds. The sound shuts off, and the program asks
you for another voice and pitch. This program is a musical
experimenter's delight, so be sure to give it a try. When you
wish to stop the program, enter 0 as a voice selection. You may
suspect there's a problem when you select pitch 254 in voice 3
and hear nothing. Actually, it's not an error — this note is just
too high for human ears, (you might test it out on your dog
though!)
These lines clear the
screen and turn off
all voices
These lines allow
you to select a
voice
this line ends
the program
These lines
allow you
to select
a pitch
These lines poke the note
and volume, and provide
a 2-second delay
100

Advertisement

Table of Contents
loading

Table of Contents