242
The
VIC
20
User
Guide
200
POKE
36875,13
205
FOR
U=9
TO
190:NEXT
219
POKE
36875,207
215
FOR
U=9
TO
109:NEXT
229
POKE
36875,9
225
FOR
U=0
TO
190:NEXT
239
POKE
36975,212
235
FOR
U=9
TO
le0:NEXT
240
POKE
36875,O
245
FOR
u-e
TO
100:NEXT
259
POKE
36875,217
255
FOR
U=9
TO
100:NEXT
269
POKE
36875,0
265
FOR
U=0
TO
199:NEXT
279
POKE
36875,297
275
FOR
U-9
TO
499:NEXT
289
POKE
36875,13
285
FOR
u-e
TO
190:NEXT
299
POKE
36875,204
295
FOR
u=e
TO
309:NEXT
300
POKE
36875,9
395
FOR
U=9
TO
100:NEXT
This isn't a very long song, but the program
is
quite long.
If
you
attempted to put all
of
the notes
of
a song into a program this way, you
would probably run out of memory.
Another way to enter music into a song program
is
by
using DATA
statements. A program
of
this type requires three short sections: a routine
that reads the notes, one that plays them, and one
that
contains the notes as
data. Try this version
of
the song.
19
POKE
36878,15
29
READ
A:
IF
A=
999
THEN
50
25
POKE
36875,A
39
FOR
T=9
TO
100:NEXT
40
OOTO
20
59
POKE
36878,0
60
DATA
297,0,297,13,212,0,217,0,207,9
713
DATA
217,9,212,9,199,
El,
207,9,297,9,212,9,217,
El,
211'7,2137
89
DATA297,9,294,294,204,999
By
changing the values in the
DATA
statement, you can play almost
any song you like; Enter 0 wherever you want a pause,
and
enter
an
illegal
number, such as 999, to signal the end
of
the song, as shown above.