The file format qplay expects is of course not BASIC, but raw PLAY command strings. Lines that start with
a leading hash mark ('#') are ignored.
Commands are case insensitive and whitespace is mostly ignored. The original QBasic manpage is slightly
incorrect; below is what qplay supports.
Octavecommandson Sets the current octave. There are seven octaves, n = 0-6.
> Increases octave by 1. The upper octave limit in QBasic was 6; qplay has a limit of 9.
< Decreases octave by 1. Octave cannot drop below 0.
TonecommandsA - G Plays a note in the range A-G. The number sign (#) or the plus sign (+) after a note specifies
sharp; a minus sign (-) specifies flat. Nn Plays note n. The range for n is 0-84 (in the seven
possible octaves, there are 84 notes); n = 0 means a rest.
Suffixes# or + Follows a specified note and turns it into a sharp.
- Follows a specified note and turns it into a flat.
DurationcommandsLn Sets the length of each note. L4 is a quarter note, L1 is a whole note, etc. The range for n is
1-64. The length may also follow the note when a change of length only is desired for a particualr
note. For example, A16 can be equivalent to L16A.
MN Sets "music normal" so that each note will play 7/8 of the time determined by the length (L).
ML Sets "music legato" so that each note will play the full period set by lengt (L).
MS Sets "music staccato" so that each note will play 3/4 of the time determined by the length (L).
TempocommandsPn Specifies a pause, ranging from 1-64. This option corresponds to the length of each note, set with
L n. Tn Sets the "tempo", or the number of L4 quarter notes in one minute. The range for n is
32-255. The default for n is 120.
. A period after a note causes the note to play 3/2 times the length determined by L (length) times
T (tempo). The period has the same meaning as in a musical score. Multiple periods can appear
after a note. Each period adds a length equal to one-half the length of the previous period. For
example, the command A. plays 1 + 1/2, or 3/2 times the length, and A.. plays 1 + 1/2 + 1/4, or
7/4 times the length. Periods can appear after a pause (P). In this case, the pause length is
scaled in the same way notes are scaled.
VariablesX(var) Play the string in the variable var.
Variable definitions in qplay syntax are for example:
$var = "CDEF";
and they must stand on a single line.