Onebang conundrum

Dan Laüt's icon

Objective:
Collect a bulk dump of a number of sysexes in a coll.

Issue:
The first sysex should clear the coll before it is stored, paving the way for the rest.
It would seem that onebang is the way to go.

Problem is that first a bang should go to onebang’s right inlet to reset it.
What triggers this bang?

Obviously it should be the first incoming sysex, clearing the coll for itself and its train.
But onebang does not output that bang. Dang! :(

Status:
This is a snake-bites-own-tail problem that’s been byting me for too long.
I decided it was time to put it to the forum when I caught myself cascading onebangs.

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

Christopher Dobrian's icon

You can initialize the [onebang] object with a nonzero argument. But my advice would be just to use whatever message triggers all those events to (first) clear the [coll] directly.

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

Dan Laüt's icon

That's what I ended up doing. But I'm still intrigued by the puzzle how to make the first incoming clear the slate.

mizu's icon

imho the clear message to coll needs to be sent before you click the message with pairs and commas inside. Comma in message box breaks your click-on or bang in multiple messages, how to know the first one ? In sysex, 240 is allways the beginner, 247 the lastone, so you know when to clear the coll before 240. my2c hth

Dan Laüt's icon

Here's a way:

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

May have to tweak the delay for longer messages.

Christopher Dobrian's icon

I think this is a bit simpler.

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

Dan Laüt's icon

Very elegant! Does the trick. Thank you.