Sending "bang" through a spray?

gpvillamil's icon

I have a bunch of number boxes attached to a spray object, and want to be able to send a "bang" to a specific one.

I was doing this before by sending the outlet number, appending a 1, and then inserting a button between the spray and the number.

However, I am using the spray to send different messages now, so would rather send a "bang" directly.

Max Patch
Copy patch and select New From Clipboard in Max.

jvkr's icon

Here a few suggestions.

_
johan

Max Patch
Copy patch and select New From Clipboard in Max.

gpvillamil's icon

That's very helpful! The pvar technique is highly intriguing. For now I will use the "route" technique.

Any reason why "spray" can't pass through a bang? It seems to pass other message types fine...

Luke Hall's icon

The [spray] object only accepts lists (which in max means lists of numbers). Look at the reference page to see details of what you can send to the object. As Johan said: [route] is definitely the way to go.

lh

gpvillamil's icon

Well, I did look at the documentation, and there is a mode where "spray" passes lists through. It passes all kinds of other messages without problems - only bang seems to act weird.

See this for example, the bgcolor message gets through fine, but bang is ignored.

Max Patch
Copy patch and select New From Clipboard in Max.

Luke Hall's icon

You're correct, I wasn't testing [spray] in list mode. It seems that it only passes messages with arguments so "0 bang" won't work but "0 hello 3" and "1 a b c" will work.

lh