Using the two code blocks shown in Figure 11.4, you can add the playing of a drum to your Scratch application and, when necessary, pause drum play for a specified number of beats.
The first code block shown in Figure 11.4 plays a drum sound for a specified number of beats. This code block lets you choose from among 46 different types of drums, each of which is easily selected by clicking on the code block’s drop-down list, as demonstrated in Figure 11.5.
The second code block shown in Figure 11.4 lets you momentarily pause drum play for a specified number of beats. Using both of the code blocks, you can play a wide assortment of drums within your applications.
In this example, the first sound block plays a drum beat for five beats using an Acoustic Snare. The second sound block rests for .5 beats, and the third code block uses an Open Triangle to play a drum for .5 beats.
18.216.77.153