stream of integers into list

o s's icon

I'am totally stuck. It seems simple to me but I can't figure out a solution:
How can I collect a sequence of integers into a list?
Thanks for a hint!

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

ole

Rick's icon
Max Patch
Copy patch and select New From Clipboard in Max.

[thresh]

o s's icon

Thank you!!

Emmanuel Jourdan's icon
Max Patch
Copy patch and select New From Clipboard in Max.

Make sure you really need to use thresh. For your example I would highly recommend using zl.group instead. With thresh, you will get the result N ms after you stop sending the last number, it will mess up all the order of your patch.

Rick's icon
Max Patch
Copy patch and select New From Clipboard in Max.

LOL..I'll grant you that [thresh] can break the patch, but unless your banging the example patches [uzi] at a rate faster than 5 ms I don't think there's any worry. And the [dict] example, unless I'm mistaken, produces a list of symbols that needs to be converted back to a list of integers. ;D

Emmanuel Jourdan's icon

Yes, dict will convert the keys to symbols, so probably not the best solution either ;-)

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

Regarding thresh, it's not a question of fast rate, it's just a question of order, thresh will wait for N milliseconds to output something, so that just break everything that rely on order, like triggers and everything else in your patch:

Thresh / quickthresh are basically designed to grab thing in the time, like playing notes on a midi keyboard to chords.

o s's icon

Thanks again to all!

Rick's icon
Max Patch
Copy patch and select New From Clipboard in Max.

@EJ We are in complete agreement on what [thresh] does. And your right, it only breaks if you try to do something with the list before it's dumped out. Which in this case can be avoided by inserting a [t b l]
after the [thresh] to maintain the order of the patch. "Maintain the Order!" lol

Emmanuel Jourdan's icon
Max Patch
Copy patch and select New From Clipboard in Max.

@Rick my only point is IMHO using thresh in this kind of situation is just asking for trouble. One day you might want to clean your patcher, make an subpatcher/abstraction and hopefully forget about that specific feature, and you will just end up having to come back to figure out why trigger doesn't work anymore ;-)

Rick's icon
Max Patch
Copy patch and select New From Clipboard in Max.

I'll let it go.

Emmanuel Jourdan's icon

What you're suggesting totally works for this example, the only problem is that you need to know what's inside the subpatcher to be able to patch that way. I'll let it go to ;-)