home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar 128 25
/
q25.d81
/
t.sounds
< prev
next >
Wrap
Text File
|
2022-08-28
|
3KB
|
56 lines
S O U N D S O F C H R I S T M A S
by Henning Vahlenkamp
It's the time of year for whirling snow and familiar tinkling music, and
LOADSTAR is happy to bring you both. The whirling snow is courtesy of a
custom font and the BASIC 7.0 RND command. The tinkling music is brought to
you compliments of the BASIC 7.0 PLAY command and the hard work of Henning
Vahlenkamp.
Henning wrote the program to run in the 40-column mode but made it easy
to modify so that it runs in either 80- or 40-columns. This is easy to do,
programmers. To check which mode the user is currently in, test PEEK(215).
If it's 128 then the user is in the 80-column mode; if it's 0, then the user
is in 40 columns. So your program would then check this location before
performing any action specific to either screen.
There are two ways to make music on the C-128. Most programs use an
interrupt-driven routine that plays SID, Songsmith, or some other format of
musical data. The other method is to use the built-in PLAY command. If you
study the syntax for this command (as found in your manual) you'll see that
it has plenty of parameters for setting the duration, pitch, waveform, etc.
for each of the three voices. Henning used a book of Christmas songs and
translated the notes from the musical staff into the syntax used by the PLAY
command. LIST the program to see how it looks.
I added a feature that lets you pick different instruments for each of
the three voices. You may have two voices play the same instrument if you
want. Press the P key at any time to play the highlighted song with the
three selected instruments. Press A and all of the songs will play, one
after another.
The big drawback to the PLAY command (as far as programmers are
concerned) is that nothing can take place while a string is being played.
Your computer is effectively locked up. However, each song is divided into
4 to 10 strings and the keyboard checked after each string so you can quit a
song by pressing any key while it's playing. It may not stop immediately,
but it will stop in a second or two.
Writing music using the PLAY command is hard work but can be an
enjoyable challenge. In my opinion, the book that Henning took the
arrangements from was not very good. Feel free to LIST the program and
modify the PLAY commands. The LISTing is commented and it's easy to see
where a song's data is.
We hope you enjoy the tinkling music and the simulated snowstorm (80-
column only). Remember, only 100 shopping days till Easter!
FT
\\\\\ R - Run RETURN - Menu \\\\\