Hardware Reference
In-Depth Information
sequence, it will be played at the same time as the first thread, just as two hands can
play the piano simultaneously.
in_thread do
with_synth “pretty_bell”
20.times do
play 49
sleep 1
end
end
FIGURE 7-12 Playing multiple tunes at the same time using threads
Using the Mouse to Control Sound
There are other elements of computerised sound that you can use to create more inter-
esting sounding music. For example, you may wish to add a background sound that
never ends and that reacts to the movement of the mouse.
To use a background sound that never ends, type the following line at the top of your
script:
play_pad “woah”, 56
Search WWH ::




Custom Search