Control propagation of observable sequence #879
Replies: 3 comments 4 replies
-
Hi, Could you include your current workflow? I am not sure what kind of logic you are looking for, but if you want to play two sounds controlled by two distinct events, you could use something like the attached workflow. |
Beta Was this translation helpful? Give feedback.
-
Dear Bruno, thank you very much for your response. So my problem is that when using the PropertySource to update the source name of the PlaySource node, the actual audio file does not change. The value of the source does indeed change on the drop-down menu (on the right of the screen) of the PlaySource node, but the sound played does not. In order to change the audio file that the PlaySource node plays, I have to stop the protocol, change the value and start it again. For my purpose, I want to be able to change the audio sources while the protocol is running. Ideally, I want to use something like the "Where" function that I saw on a marble diagram of a Bonsai ppt. Where the observable sequence is propagated only when a specific value (or group of values) is received. Since even the transmission of a boolean false value will trigger the PlaySource, I have found no way to reliably control its activation. Button press is one way, but I would like its activation to be controlled without user input, for example to play the sound (activate PlaySource) when mouse enters ROI. Entering ROI could trigger broadcasting of a bool True or a numeric value >0. Thank you again for your time |
Beta Was this translation helpful? Give feedback.
-
I will try to address your answer point by point.
The problem is that words dont easily translate into Bonsai code. It would be much easier and efficient to have the workflow you are trying to use and that reproduces the behavior you are describing. The code that i have sent before seems to achieve what you described and it toggles between the two sounds. Without checking your workflow I wont be able to identify the exact problem you are having.
In your workflow, the camera is controlling the update of the gain, is this a valid reason for the delay?
This would be a cheers, |
Beta Was this translation helpful? Give feedback.
-
Hello amazing people of Bonsai!
Thank you for all the work you 've been putting into this. I have a question regarding the PlaySource(Audio) node. This node is activated whenever it receives an observable sequence, i.e. a button press or anything else. In my workflow I need to be able to select between different sound files but I've found that I cannot change the audio file played by the PlaySource while the workflow is running. So I ended up putting as many PlaySource nodes as the different audio files I need. However, I would like to be able to trigger the different PlaySource nodes in a controlled manner, while the workflow is running. Is there a way to allow an observable sequence to propagate to these nodes, using an equality comparison ? I cannot use the Equality node, because even when there is no equality, the zero output still activates the PlaySource.
Thank you very much for your help
Beta Was this translation helpful? Give feedback.
All reactions