Play Music with Funny Touch
We can use message broadcast to have Neuron communicate with sprites, thus to make a interactive project.
We need the [Funny Touch] block.
Program Funny Touch
1. Drag an Events block when green flag clicked to the Scripts Area. Add a Control block if () then (), a Sensing block Funny Touch (1)(blue) is touched?, and another Events block broadcast (). Create a new piece of message "blue", so that when the blue alligator clip is touched, the message named of the same color will be broadcast.
2. Likewise, we can create three new pieces of message, namely "yellow", "red", and "green", for corresponding alligator clips. Simply duplicate the script for the blue alligator clip.
3. Add a Control block forever
Program the sprite
4. Select "Sprites", and delete the default sprite "Panda".
5. Click "+" to add a new sprite "Max".
6. Click "+ extension" at the bottom of the Blocks Area. We'll use the "Music" extension.
7. Add an Events block when I receive (blue), and a Music block play drum ((1)Snare Drum) for (0.25) beats.
7. Duplicate the script. When message "yellow", "red", or "green" is received, drum "Bass Drum", "Side Stick", or "Crash Cymbal" will be played.
9. Click the green flag. See what happens?