Hi
I am a beginner with Bonsai and struggling with implementing an "if statement".
The task is the following (see scheme below).
I set an Integer. When this Int becomes <0, a sound should be played and repeated in loop as long as Int<0.
How can I start the sound playback in loop only when int becomes <0 and stop the playback when Int becomes >0?
The task exemplified here is intended to simulate a mouse moving in an arena, with a background sound being played when the mouse is in a given ROI, and no sound outside this ROI. When the mouse enters the ROI, the average brightness of the ROI drops below the baseline (baseline=0). So average<0 means that the mouse is in the ROI and the sound should be played. I got the mouse detection part to work, but I then do not manage to play the sound accordingly.
Thanks for any help!
Alessandro