Users Manual

SCRATCH CODING KIT
TORI Piano Playback coding
Go ahead and make a script like the one above. Did you get it?
First, on the top you receive a ‘Play’ signal. Then the blocks below that will be activated in order. The reason why
we saved it as ‘Play’ in this case is also to show that it is related to recording. Save 1 at ‘pointer’ variable. This is to
show that it is the first item in the ‘note’ and ‘Beats’ list. Then reset the timer since it needs to read the pre-recorded
timer from the very beginning.
Should we start making the script above? The script to play the recorded file is not so complicated. The playback
script will point to an item in the 'Beats' list where the timer is stored with the 'pointer' variable during the timer's
time. At first, it points to the value of the first item. Then play the corresponding to the item 1 in the ‘note; list.
Then add 1 to the ‘pointer’ variable. The above script is when the item stored in the ‘note’ list is ‘C.’ Use the ‘repeat
to~’ block for now. The condition for this block will be ‘Beats size < ‘pointer’.’ The reason for using this condition
is to let 'pointer' point to the total number of items stored in the 'Beats' list. If the value of 'pointer' exceeds the
number of 'Beats' list items, it exits the block until 'repeat to ~' and ends the playback script.
TORI Piano coding activity