Note: This is a work in progress and many formatting issues have been fixed. Read more about the project on the home page.
The play
command plays a sound or a series of notes using a sound through the speaker of the Macintosh (or through the audio jack if it’s in use).
Play stop
stops the current sound immediately; otherwise, the sound plays until it’s done and stops by itself.
Important: HyperCard continues to run handlers and perform other actions while a sound plays. Use the command wait until the sound is done
to stop a handler until the sound is done playing.
The text string notes
is an unlimited sequence of words in which each word represents one note. A note has the following NAOD format (Name, Accidental, Octave, and Duration):
You don't have to specify the accidental, octave, or duration of a note. Initially, the accidental defaults to none. The octave and duration default to the same values as the previous note, or to 4
(octave) and q
(duration) for the first note.
Specify the note r to get a rest. For example: re --eighth note rest
A duration followed by a period (.) means a dotted note. A duration followed by the number 3 means one note of a triplet.
HyperCard can also play digitized sounds stored as 'snd ' resources. Use play
with the name of the resource as the sound. The resource must appear in the current stack, a stack being used, or the Home stack.
HyperCard requires more RAM to play large digitized sounds—about 22K for every second the sound plays.
If HyperCard can't find the sound or load it into memory, the result
gets Couldn't load sound
. If the volume is set to 0, if an XCMD is using the sound channel, or if HyperCard is running in the background, the result
gets Sound is off
.
An expression that evaluates to a text string and that is also the name of a digitized sound.
Boing
, harpsichord
, and flute
are provided with HyperCard.
An expression that evaluates to a text string that is also a sequence of notes.
Each word of the string is a separate note. Each note has a name and an optional accidental, octave, and duration. For example:
An expression that evaluates to a positive integer.
For example:
See also: background
, bkgnd
, button
, card
, chunk
, field
, menu
, and menuItem