Question: Object to delay a message?

Wiebe Marten's icon

Hello there,

I have a very basic and probably simple-to-answer question, but I cannot figure it out:

When I want to delay a bang, I can use the [delay] object. When wanting to delay an int/float, I can use pipe.

But how can I delay a string or a list for a couple of (mili)seconds?

Thanks,

Wiebe Marten

$Adam's icon

Hi,

how about this?

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

HTH,
Ádám

Wiebe Marten's icon

You help me out again, Ádám.
Great solution. Never would have thought that the zl object is that versatile.

Thanks,

Wiebe Marten

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

Yeah, alersito beat me to it. Unless I have completely misunderstood zl.reg, the problem with Siska's suggestion is that a new incoming item will overwrite the one that's already saved in zl.reg.

I use the pipe with symbol conversion (although I wrap the whole thing up in an abstraction to make it easier to manage). My concern with this solution is the proliferation of large numbers of symbols if what you're piping are things like MIDI events or OSC data.

$Adam's icon

Hi dwhatever,

yep, you're right. I overlooked this ;-) However, in my experience, both [tosymbol] and [fromsymbol] are quite heavy operations. Since the OP wants to delay messages for only a few milliseconds, if he's sending so many messages that there's a chance that a new message would arrive while an old one is still in the queue, I would rather use the solution that one can find in [pipe]'s help file as [p "more about delaying lists"].

Cheers,
Ádám (which, again, is my first name)

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

I feel like I must have posted something like this before, but I'm senile so here goes again.

woyteg's icon

That seems to be a really beautiful solution!