17.07.2013 Views

GWBASIC User's Manual

GWBASIC User's Manual

GWBASIC User's Manual

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

GW-BASIC <strong>User's</strong> Guide<br />

PLAY Statement<br />

Purpose:<br />

To play music by embedding a music macro language into the string data type.<br />

Syntax:<br />

PLAY string expression<br />

Comments:<br />

The single-character commands in PLAY are as follows:<br />

A-G [#,+,-] A-G are notes. # or + following a note produces a sharp; - produces a flat.<br />

Any note followed by #,+,or - must refer to a black key on a piano.<br />

L(n) Sets the length of each note. L4 is a quarter note, L1 is a whole note, and so on. n<br />

may be from 1 to 64.<br />

Length may also follow the note to change the length for that note only. A16 is<br />

equivalent to L16A.<br />

MF Music foreground. PLAY and SOUND statements are to run in foreground. That is,<br />

each subsequent note or sound is not started until the previous note or sound is<br />

finished. This is the initial default.<br />

MB Music background. PLAY and SOUND statements are to run in background. That<br />

is, each note or sound is placed in a buffer allowing the BASIC program to<br />

continue execution while music plays in the background. As many as 32 notes<br />

(or rests) can be played in background at one time.<br />

MN Music normal. Each note plays seven-eighths of the time determined by L<br />

(length).<br />

ML Music legato. Each note plays the full period set by L.<br />

MS Music staccato. Each note plays three-quarters of the time determined by L.<br />

N(n) Play note n. n may range from 0 to 84. In the 7 possible octaves, there are 84<br />

notes. n set to 0 indicates a rest.<br />

O(n) Octave 0 sets the current octave. There are 7 octaves (0 through 6). Default is 4.<br />

Middle C is at the beginning of octave 3.<br />

P(n) Pause. P may range from 1-64.<br />

T(n) Tempo. T sets the number of L4s in a minute. n may range from 32-255. Default<br />

is 120.<br />

file:///C|/Documents%20and%20Settings/Lorenzo/Desktop/GW%20Basic/PLAY.html (1 of 2)28/03/2004 21.29.41

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!