Users Manual

CLASS 4
74
TORI Piano Playback coding
Does the script you made above function correctly?
If so, we will add another note. It is very similar to the script we made above, so it should be very easy to make.
Create the script above using the script you created on the previous page. You have to add another script that
plays the note.
The script to add at this time is a button sensor that outputs 71 notes. Since the main cell has six input analog
ports, you need to connect the button sensor to the input digital port 2 to sound 71st note. The ‘If~’ condition for
digital 2 sensor is “is the digital sensor pressed?”. Button sensor is ‘true’ in this condition whenever it is pressed.
The principle is same for analog port. If digital sensor 2 is pressed, play the 71st note, if not, wait until the hand is
released from digital sensor 2. If so, the button sensor connected to input digital port 2 will also play once every
time you press and release it.
Now let ‘s make a piano that makes the sounds Do Re Mi Fa So La Ti?
TORI Piano coding activity