Code-Killing Block

Greetings,

I created the following block of code:

The purpose, in my little mind, is to combine a global pitch reading (which will always be negative in this application.) with the numeric text in the Display_Screen_Right.Text box (which is always positive). When the two numbers cancel (i.e. 0), I want to sound my chime and move on.

MIT AI2 information says I can add global variables and text box content so I am not certain what is happening but this jams up operations, depending on where I try to place it. I am certain this is where I am failing but, after several hours, I am lost and frustrated.

The following actually stops my app from operating, as in the buttons will not even click and it sits on the screen like a brick.

If anyone would be kind enough to help out here, I would really appreciate it.

Fractional numbers rarely exactly match 0.

To complicate matters, the Sound component can freeze the app while it is sounding.

So it is better to use the Player component, and test if it already playing before deciding to ask it to play again.

That comparison to 0 might be replaced with a looser comparison, like Is the absolute value of the difference between the two numbers less than 1?

1 Like

Thank You!

There are several chunks to think about here. I will work with all of your suggestions and see what frees me up.