I was wondering whether anybody knew of a good way to hold off a bang until the right conditions have been met.
It's kind of hard to explain, but essentially I have a looping patch. The loop repeats over and over again until a random parameter tells it to stop looping. The problem? The bang that stops the loop doesn't consider where it is stopping in the sample. So I have a tablplay~ that is looping, and suddenly it stops and pops/clicks right in the middle of it. The goal is to create a kind of check that only sends a bang when the sample is done playing.
When a bang is sent at the end of the tabplay~, check whether the spigot object has been opened. If it has, pass through the bang, and stop the playback. If not, WAIT until it has opened, and THEN pass it through. Does anybody have a good idea of doing this?
This is a simplified version of the looper subpatch. Notice a couple of things.
- Select objects sends a 1 which starts the loop
- The delay object delays the bang from the end of the tabplay to start the loop all over again (it increases over time actually)
- Select object sends a 0 (at some random point (we don't know when)) but the bang will go through only when the spigot is open. So the sample needs to have stopped playing when this happens.
The tricky part about all of this is that the looper needs to stop IN BETWEEN the start of the next loop, and the end of the sample.
Help would be tremendously appreciated.