[thresh] for symbols?

Brian H.'s icon

I get that lists and symbols aren't the same, but is there a way to do this? [zl.group] does it nicely, but only if you know how many items there will be ahead of time.

Thanks,

Brian

Christopher Dobrian's icon

You can use zl.group with no number argument, and bang it when you want it to send out its grouped items. So, in your case, you could use a delay object to bang zl.group after waiting for a few ms (or deferlow for a 0 ms delay), which is essentially what thresh does.

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

Brian H.'s icon

Great trick– I didn't know that!

I'm missing how exactly that's happening in your example (simple as it is). If [deferlow] is sending bangs to [zl.group], it'd be doing that every *individual* time it gets hit from [uzi], right? And the [delay] is not connected.

I've found this kind of thing a little tricky, because whatever you want to trigger, it's going to be done *every time* a message comes, not just at the beginning of the series. I have this problem a lot with Max, and haven't come up with anything good (aside from a few kludgey abstractions).

Thanks a lot,

Brian

Christopher Dobrian's icon

The deferlow example was just in case you're sending many symbols all within a single tick of the scheduler, as with uzi in that example. But as you wrote, it does send extra superfluous bangs to zl.group (which have no effect because the first bang empties the contents of zl.group), so that example is perhaps just confusing the issue. Here's a simpler example with just the delay object, which holds only one bang at a time and replaces its currently held bang with each new bang.

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

Brian H.'s icon

Ah, I see! Thanks so much– this is exactly what I've been looking for, and wouldn't have known without your advice!