1 / 18

Unit 3 Music and Sound

Unit 3 Music and Sound. Evangel College S.2 ICT. Animal Piano Project. We will use the blocks in the Sound category to build an Animal Piano project. New sprite. At first, we add the key sprites. Click the New Sprite From File button. New sprite.

umeko
Télécharger la présentation

Unit 3 Music and Sound

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Unit 3 Music and Sound Evangel College S.2 ICT

  2. Animal Piano Project We will use the blocks in the Sound category to build an Animal Piano project.

  3. New sprite At first, we add the key sprites. Click the New Sprite From File button

  4. New sprite Click Costumes button on the left and then choose crab1-a in the Animal folder.

  5. Shrink and Rename Click on the Shrink tool, then click on the crab in order to shrink it. Place it on the left hand side. (Optional: Rename the sprite to “C Note”.)

  6. Play a Note Drag the PLAY NOTE block to the scripts area. The value 60 represents middle C. Click on the script. Can you hear the sound?

  7. Key Press Drag the KEY PRESS block on top of the PLAY NOTE block. Change the key from “Space” to “a”. Press “a” on the keyboard. Can you hear the middle C sound?

  8. Add other notes You can change the note using the keyboard.

  9. Add other notes Prepare other notes: C Note: 60 Key: a G Note: 67 Key: g D Note: 62 Key: s A Note: 69 Key: h E Note: 64 Key: d B Note: 71 Key: j F Note: 65 Key: f C Note: 72 Key: k Hint: You may duplicate the sprite and then change the costume.

  10. Import the stage background Choose the Stage and then Import

  11. Animal Piano Project • Congratulations! You have created an Animal Piano! • Can you play a “happy birthday” song on it?

  12. Challenging activities Activity 1 (Change tempo): Add script for the stage so that • When the key “b” is pressed, the tempo (beats per minute) increases, ie. faster. • When the key “v” is pressed, the tempo (beats per minute) decreases, ie. slower.

  13. Challenging activities Activity 2 (Change volume): Add scripts for each sprite so that • When the keys “up-arrow” is pressed, the volume increases. • When the keys “down-arrow” is pressed, the volume decreases.

  14. Challenging activities Activity 3 (Change instrument): Add scripts for each sprite so that • When key “1” is pressed, the piano plays Acoustic Grand sound. • When key “2” is pressed, the piano plays Violin sound.

  15. Challenging activities Activity 4 (Mouse control): Add scripts for each sprite so that • When the user clicks on the keyboard, the piano plays sound too.

  16. Programming concept: Event Event An event is triggered when something happens. For example, when the user presses a key on the keyboard, a key press event is triggered. There are many kinds of events, such as Key Press event, Mouse Click event, Green Flag event or even events triggered by other sprites.

  17. Programming concept: Event Event driven programming Any programming model which uses events to run a specific portion of the program is called event-driven programming. Event capture and event handling A sprite can capture the event and handle it. For example, the cat sprite captures the keyboard event and plays a note.

  18. Summary You have learnt: • How to use SOUND blocks to build scripts • How to new a Sprite, rename, resize and move it You have also learnt the following programming concepts: • Event – Happenings triggered by user or other sprites

More Related