Time for action - applause, please

Everyone appreciates applause. Let's use Scratch's instruments to add some new effects to our story:

  1. From the Sound palette, drag a set tempo to 60 bpm block to the scripts area, but do not attach it to any of the previous scripts. Add a set instrument to 1 block after the tempo block.
  2. Change the instrument value to 127 applause. Click the more... option until value 127 displays.
  3. Double-click the block to play the sound. You should hear silence.
  4. Add the play note 60 for 0.5 beats block to the script.
  5. Change the beats value from 0.5 to 1.
  6. From the Control palette, drag a repeat 10 block to the scripts area and wrap it around the three sound blocks we just added.
  7. Double-click the blocks and listen to the applause.
Time for action - applause, please

Our applause needs some work. Actually, I'll be honest with you. It sounds horrible. You'll get a chance to fix it soon.

What just happened?

We used the term instrument liberally. Even though we could have chosen standard musical instruments such as organs, guitars, and pianos, our story called for an applause.

Selecting an instrument by itself did not produce any sound the way the play drum block did. In order to get sound, we had to first select a musical note, so we chose to play our applause in C for one beat.

The repeat block gave us the sense of roaring applause that would not be possible if we chose to play only one beat of applause.

Play a note

When we click on the note value in the play note block, a keyboard displays. As you hover your mouse over the key, the note and its associated number display.

Play a note

If you want a higher-pitched note, select a higher number in the play note block.

Have a go hero

The applause we added doesn't sound good because it's choppy. You can experiment and try to make the applause smoother.

Or, you can turn to the Internet to find an applause sound effect and play it with the play sound until done block instead of repeating the tempo, notes, and instruments we added in the exercise.

Pop quiz

  1. If you specify a value of 90 in the point in direction block, what position does that represent on the Scratch stage?
    • Up
    • Down
    • Left
    • Right
  2. In order to play an instrument you need to accompany the set instrument to block with a:
    • play sound until done block
    • play drum block
    • play note block

Piece the dog scene together

Right now, our scene has four disconnected sets of blocks. There's nothing wrong with that. Our projects do not always unfold in a linear pattern.

It's time to write the joke. You should be able to build the joke sequence without much help from me. Here is the joke: "What are the top three reasons dogs don't use computers?" The responses:

  • Sit and stay were hard enough—grep and awk are out of the question!
  • They can't stop hunting the mouse.
  • Carpal Paw Syndrome!

Most of you will be wondering what grep and awk are. Let's just say our dog caters to a Linux-friendly audience. Feel free to change the joke to incorporate your favorite operating system, as you see fit.

Add a one second pause between each line. If you need some help, the screenshot below shows a possible approach:

Piece the dog scene together

In the next exercise, we'll refer to this block of code as the joke sequence.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.149.25.163