PLAY

Syntax

PLAY list

PLAY filename

Explanation

PLAY causes the computer's speaker to play musical notes as specified by its input list. PLAY will accept lists as input that contain special musical commands, such as the note and octave to play, and the length of time to sound the note. The following elements can be included in a list that is input to PLAY.

Musical Notes: A B C D E F G P (for pause)

Note prefixes: An integer immediately preceding a note determines its duration. 1 is a whole note, 2 is a half note, 4 is a quarter note, 8 is an eighth note, etc.

Note suffixes: # following a note indicates it is a sharp note, b following a note indicates it is a flat note;. following a note extends its duration to 3/2 time

Octaves: O followed by an integer between 0 and 6 sets the octave which is preset to 3. O# raises one octave, Ob lowers one octave

Tempo: T followed by an integer sets the tempo in units of quarter notes per minute. T is preset to 120.

Note length: L followed by an integer sets the default note length if no duration is specified with the individual note. L is preset to 4 (for quarter notes).

Staccato: S followed by an integer between 0 and 100 sets the staccato ratio as a percentage. S0 is a perfect legato. S is preset to 10.

Reset: R resets note length, octave, tempo, and staccato to their preset values. Changes in these values are preserved during multiple calls to PLAY unless they are changed again or reset to their preset values.

Chords: A list within the PLAY list is treated as a chord. Intervals and length specifiers are ignored on the first notes in the chord list; only the last note is played in the given length. The first notes are played quickly. PLAY [C [C E G O# C] Ob E] will play a C, a chord ending with a high C and an E.

If PLAY is used with a word as input, Logo assumes a file name for a waveform file. If the Windows 3.1 multimedia extensions are present, Logo plays this file.

Examples

? PLAY [2A# 2P Ob Ab]

?

sounds an A-sharp half note, pauses for the duration of the half note, lowers by one octave, and sounds an A-flat quarter note.

? PLAY "|C:\WINDOWS\DING.WAV|

?

The Windows waveform file DING.WAV is played.