Chapter
10
I
BASIC
Ke-ywords
PLAY
Statement
PLAY string
[,[string1
[,string11
Plays the musical notes specified by
string.
PLAY
supports
3
separate strings
to
allow independent control of each of
3
voices.
String
is a string expression consisting of
1
or
more single-char-
acter music commands.
String
must be enclosed in quotation
marks.
The single character music commands are:
A-G
plays notes
A
through
G
of one musical scale.
You may include an optional number sign
(#)
or
plus sign
(
+)
to
indicate a sharp note or a minus
sign
(-)
to
indicate
a
flat note. You may only
specify sharp or
flat
notes that correspond
to
the
black keys on a piano. The letters
A,
C,
D,
F,
and
G
may be followed by a plus because they
are followed by black keys on
a
piano. The letters
A,
B,
D,
E, and
G
may be followed by minus be-
cause they are preceded by black keys on a
piano.
sets the duration of the notes that follow.
n
may
be
a
value in the range
1
to
64.
Here are a few
of
the more common lengths:
Ln
1
indicates a whole note.
2
indicates
a
half note.
4
indicates
a
quarter note.
8
indicates an eighth note.
16
indicates a sixteenth note.
If
you want
to
change the duration for only
1
note, place
n
immediately after the note,
omit-
ting the
L.
For
example,
A16
is
equivalent
to
L16A.
sets the current octave. There are
7
octaves,
0
through
6.
Each octave starts with
C
and ends
with
B.
Octave
3
starts with middle
C.
If
you
omit
n,
BASIC
assumes Octave
4.
On
261