Index ButtonsFields Message Variables
Ask/Answer Colour Sound Menus QuickTime

HyperCard and Music

The play command can take a digitised sound and play notes. The notes can vary in pitch, length and tempo so that quite passable tunes can be constructed using a digitised sound. The beauty of this is that long tunes take up only a tiny space. On my "101 Australian Folk Songs" stack all the words and all the music can still fit on one floppy disk! The drawback is that the tunes sound a bit mechanical. Here's a sample tune called Brisbane Ladies

Copy the script and paste into a button on your stack. Of course you need a sound resource called Fiddle or else you can try it by replacing Fiddle in the script with Harpsichord which is build in to hyperCard.

Instead of numbers you can use the names of the note so that 60 is middle C and 61 would be C#. I find the numbers are better for 2 reasons

Firstly if you use the note letter system you have to specify octave changes (c3 is middle C, c4 the octave above and c2 the octave below

Secondly if you use the number system you can change the pitch of a tune by adding or subtracting the same whole number from each note in the tune.

The length of each note is specified by the letter following the note as shown below

Using SoundChannel

In the latest version of HyperCard the soundChannel property reflects the channel through which sound is played. By immediately switching channels and playing new sounds, several sounds can be played nearly simultaneously as in this example

Script for a Button to play Random Music

Copy this script and paste it into a button in your stack. When you click on it it will play random music till you click again! It plays a pentatonic music (only the black notes). If you have a different sound resource in your stack just replace the word harpsichord in the script with the name of the new sound

XCMD's for HyperCard and Sound

Return to top of page