Does Speedlim work when editing patches in M4L?

parkingsun's icon

If i try to use speedlim in an amxd device then when I am in device edit mode messages do not seem to pass through the speedlim object at all; it becomes a black hole eating all input. This makes a wide variety of thing more complex than they ought to be. OTOH it works fine if I load a frozen device with speedlim in.

To demonstrate what i mean, I have created an M4L device wherein speedlim doesn't work. If you load it up as a device, you can drag the upper number box and the lwoer number box will claim to receive updates every 200ms. But if you unfreeze and edit it, doesn't do anything.

For comparison, I have the same patch as a vanilla Max patch linked and pasted below.

Works fine.

Is there something about scheduling that I am not understanding here?

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

Dan

parkingsun's icon

I just heard from the bug team about this one.

Apparently the answer is: "no. it's a bug"

Lee's icon

at least it'll get fixed then :)

parkingsun's icon

That's what you'd think, isn't it, Lee? However, it didn't get fixed in the latest version of Max.

So anyway, I wrote a "speedlim" in javascript which I am replacing the broken max "speedlim" objects with. This might be useful to anyone else who wishes to limit the rates of messages and also use M4L.

var s_interval = 10.0;
var s_output_task = "nothing";
var s_output_task_exists = false;
var s_message_content = "nothing";
var s_kill_on_next_loop = false;

if(jsarguments.length>1) {
   s_interval = jsarguments[1];
}
if (s_interval
gavspav's icon

Thanks for this.

Good to know its a bug. Thought I was going mad there for a second.

Wetterberg's icon

I personally prefer doing atrocities with metro and zl reg, but I guess I can see how a js replacement might help ;)