"stop tone" block: does it work for you?


#1

I’ve noticed that the “stop tone” block doesn’t seem to work. If I play a tone (e.g., “play tone on note C4 beat whole”, it seems to play through to the end, regardless of whether a “stop tone” command is encountered.

I’ve tried to play C whenever the keyboard “C” is pressed, and trigger a “stop tone” when the keyboard “C” is released.

Has anyone tried something similar, and if so what behaviour did you encounter?
Thanks,
SK


#2

I’ve been using the Stop Tone block with no issues.

How are you connecting to the mBot? Via the USB cable, Bluetooth, or WiFi?

Can you post a screenshot of the code you are using?


#3

Hi Chuck,
Thanks for replying.

I’m connecting to the mbot by USB at the moment, running a simple test code as follows:

I find that when I press the g key, the G3 note plays through the full duration of a double note, rather than stopping when I release the g key.
SK


#4

Add a “When clicked” block followed by a forever loop. The other hat blocks may not act properly without it. :slightly_smiling:


#5

Thanks, chuckmcnight. I’ll give that a try tonight.
SK


#6