Users Manual

SCRATCH CODING KIT
TORI Piano coding activity
TORI Piano Playback coding
Does the script you created work well?
You will find a strange thing as you are running the preceding script. If you press and hold the button sensor con-
nected to the analog 0 port, you will notice that you are continuing to press and hold the button while you are
pressing the button.
Use the script from the previous page to make a script above.
Unlike the previous script, now we have added a "Waiting" block. This block waits for a specific condition, and that
condition in this case will be "Analog 0 sensor value > 100".
In other words, if the button sensor on the analogue 0 port is pressed, you will play the 60th note once at 0.5
beats and wait until the value of the analogue 0 sensor is greater than 100 (until you release the button sensor).
This will cause the button sensor to be pressed once, wait for the 60th note to sound and then release it, then go
up again (because it is an infinite repeat) and press the button sensor. That is, if you hold down the button sensor,
the note will not be heard, but only once.Now use the script above to code it so that it will play the sounds from
Do to Si.