How can I delay Use of Sel object until after bang has been made?
I want to control bangs based on a corresponding number in a message box. However I need my patch to bang first when it is finished, so I cannot just use the sel object as it would bang when a number is detected (I am using a keyboard in the patch). How can I allow the patch to bang, and then after, route the bang according to a corresponding number?
Thanks
It’s a little difficult to follow your logic but, if I’ve understood you correctly, I suggest that you consider using a gate with multiple outlets controlled by the number. Feed the bang into the right inlet and the number into the left inlet. You define the number of gate outlets by the first argument in the gate object, e.g. gate 5 will give you five outlets. There is a second optional argument that you can use to direct the output to a specific outlet at initialisation. Thus, gate 5 0 would close all the outlets until an outlet number is selected via the left inlet.
(Sorry this is all descriptive but I don’t have my computer to hand!)
Frankly, I also have difficulties to understand what you want.
> How can I allow the patch to bang, and then after, route
> the bang according to a corresponding number?
I understand you want to "store" a bang, then later be able to check if it did occur or not, and react accordingly. Is this correct?
If so: [gate] is either open or closed, similar to [sel] (you noted this already). It has no memory, does not remember what has happened before. BTW I personally consider [gate] as highly confusing because the events must reach it in reversed order: First the integer to the left, then the data to the right.
But anyway, you cannot store a bang. Instead, convert it to any other data. For example, set an integer to a dedicated value before (right inlet), for example, to 0 or -1. Now if the bang occurs, use it to change the integer value (again right inlet). This means, let the bang hit a message, say 4711, which goes to this integer and changes it. When later the time comes, send a bang to the integer (left inlet!), check its value, and react on it.
But, again, I am very unsure what exactly you want to do. Perhaps you can try to explain again?
i
Store the number of your numberbox, and bang it when your patch is ready
This is what I had in mind for directing a bang to a specific output using gate:

If you need to "store" the bang before sending it, you could do something like this:

Explanation:
If a bang is received, it turns the toggle on and stores the value in int (bang received = 1, no bang received = 0). Using the right inlet of int stores the value with no output.
When the value of the integer selector changes (I have constrained this using the Inspector to values between 0 & 5 to match the gate and activated the "Send value on mouse up" option), it activates the trigger. This sends out the integer value and then a bang (processes right to left).
The integer value sets the gate output first. If the value is 0 the gate will be closed generating no output, otherwise the relevant outlet is opened.
The bang then forces the int store to output its value (bang to left inlet).
route 1 then does one of two things. If the value is 0 (no bang waiting) the process stops. If the value is 1 (bang waiting), it sends out a bang. Firstly, this resets the toggle and int store back to 0 and then sends the bang through the gate to the respective outlet.
to "store bangs" (if really neccesary) you can most conveniently convert them to "1".