Forums > MaxMSP

stream of integers into list


o s
May 11, 2014 | 11:20 am

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!

ole

– Pasted Max Patch, click to expand. –

May 11, 2014 | 12:02 pm

[thresh]

– Pasted Max Patch, click to expand. –


o s
May 11, 2014 | 12:06 pm

Thank you!!


May 11, 2014 | 3:05 pm

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.

– Pasted Max Patch, click to expand. –

May 11, 2014 | 3:16 pm

i also prefer zl solutions for this.

but i’ve found recently i can also use ‘dict’ in really stupid ways for similar things, haha! :D

– Pasted Max Patch, click to expand. –

verrrry easy on the patching brain ;)
(i use ‘dict’ in this way for a guitar-effects-pedal chain, where ‘getkeys’ message instantly gets ordered/reordered poly~/effects routing on-the-fly(receive~ names are stored within the dict), so as i step on my FCB1010 midi-footpedal-thingamabob, effects appear and disappear instantly with proper ordering within the chain… the list can easily vary in length at different times too… saved me alot of thinking ;D …not the best use of ‘dict’ though, since i’m not using any ‘value’ in ‘key’/'value’ pairs :p)


May 11, 2014 | 8:59 pm

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

– Pasted Max Patch, click to expand. –

May 12, 2014 | 5:08 am

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

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:

– Pasted Max Patch, click to expand. –

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


May 12, 2014 | 8:52 am

"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 "

HA! so true! i didn’t think of this… works great for changing receive~ names on my guitar-effects-patch(supposed to be symbols there), but not great for numbers :p

my mistake!



o s
May 12, 2014 | 9:07 am

Thanks again to all!


May 12, 2014 | 11:17 am

@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

– Pasted Max Patch, click to expand. –

May 12, 2014 | 12:13 pm

and as a result of this thread, i’ve come up with my own abstraction(zl queue to zl group for lists of varying length), called "Num2ListThresh"! Named(and designed ;) in the continuing tradition, of the overly-verbose idiocy, of both my online posts AND my patches ;D

– Pasted Max Patch, click to expand. –

Cheers.


May 12, 2014 | 12:59 pm

@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 ;-)

– Pasted Max Patch, click to expand. –

May 12, 2014 | 1:48 pm

I’ll let it go.

– Pasted Max Patch, click to expand. –

May 13, 2014 | 5:46 am

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 ;-)


Viewing 14 posts - 1 through 14 (of 14 total)