How to Make an Instrument Play Music on Scratch.mit.edu

by collindeconstructor in Craft > Digital Graphics

1287 Views, 3 Favorites, 0 Comments

How to Make an Instrument Play Music on Scratch.mit.edu

Scratch homepage.jpg

Here, I am going to show you how to make an instrument play music on the programming website, Scratch.

Supplies

a computer with a good web browser

Go to the Website: Www.scratch.mit.edu

Start Creating.jpg

From there you can click the Start Creating icon. Or, if you have an account and are signed in, then you can click the create icon in the top left corner.

Choosing a Sprite

saxophone.jpg

Then, you should delete the pre-loaded cat sprite and choose a musical instrument. To do this, go to the sprites section of the screen and click choose sprite. There you will find a large library of sprites. Then you can scroll or go to the Music category to find your instrument* I chose saxophone.

* Instrument has to be able to play notes. No singer, speaker, microphone, radio, bell, or drums.

Then, Find the Code

First, go to the Events code category. Then, drag out 8 When Space Key Pressed code blocks. Click the word space on the blocks and you will find a list of the keys that are on your keyboard. Then go to the Sound code category. Then, drag out 8 Play Sound C2 Sax Until Done blocks. Click the word C2 Sax to pull up a list of musical notes.

Put Code Together

Scratch screen.jpg

Then, with the lists that you pulled up, you can switch the events blocks to: a, b, c, d, e, f, g, and 2. Then switch the sound blocks to C Sax, D Sax, E Sax, F Sax, G Sax, A Sax, B Sax, and C2 Sax. Then you can match each letter to its corresponding letter.

Play Music

Then, you just hit the key to play its corresponding musical note.

While in Scratch...

username.jpg

While you are in Scratch, be sure to check out some of my other projects. My Scratch name is ccfprogrammer.