Sound Programming


Testing the sound capabilities

Evaluate the following expressions to test the sound capabilities of Squeak:

PluckedSound default play

(AbstractSound majorScaleOn: PluckedSound default) play

(AbstractSound noteSequenceOn: PluckedSound default from: #((c4 1 500) (d4 1 500) (e4 1 500) (f4 1 500 (g4 1 500) (b4 1 500) (c5 1 500))) play

The array elements in the last expression can be (pitch duration loudness) triples or (#rest duration) pairs. Pitches can be given as names or numbers. To get the number of a pitch you can inspect the following expression:

AbstractSound pitchForName: c2

The result will be 65.4064.

Also listen to the following expressions:

PluckedSound chromaticScale play

FMSound hiMajorScale play

PluckedSound lowMajorScale play

PluckedSound bachFugue play

AbstractSound stereoBachFugue play

(AbstractSound bachFugueVoice1On: FMSound flute1) play

(AbstractSound bachFugueVoice1On: PluckedSound default) play