๐ ๏ธ Section project: a little piano
Section 3: Looks and soundLesson 3.4 ยท โฑ 12 min
Turn the keyboard into a piano: every key plays a note, and Robo dances with the music.
๐ฏ Project goal
When you press the keys 1, 2, a and b you hear C, D, E and F, and each time Robo switches his costume.
Steps
- Drag the block when key pressed and choose the key 1.
- Put next costume under it, then play note (60).
- Do the same for the keys 2, a and b with the notes 62, 64 and 65.
- Play a tune with the keys.


๐ก Tip
Copy the script by right-clicking it and choosing โDuplicateโ, then change only the key and the note.
๐ Another example: two more keys
The key d plays E, the key b plays F, and every press switches Robo's costume.




โ๏ธ Practise
Build the whole piano here: a key for every note from C to G.
โ๏ธ Practise here in the lessonโ Close the labor open the lab in a new page โ
๐ฏ Challenge yourself
Easy
Make the space key play G, and Robo says โGโ.
๐ Show the solution๐ Hide the solution


Medium
Make the flag play a ready tune of 5 notes, then Robo says โMy tune ๐ถโ.
๐ Show the solution๐ Hide the solution


Hard
The key a plays C and makes Robo 10 bigger, and the key d plays D and makes him 10 smaller. We pressed a, then a, then d: what is the size?
๐ Show the solution๐ Hide the solution





