This had a bug which could crash pd in some situations, thanks to @seb-harmonikar for the fix. Use seb's fix below.
A quick abstraction thrown together so we can use ctrl-t to insert messages or convert any object to a message. Requires iemguts.
msg - a message object (bug fix)
This had a bug which could crash pd in some situations, thanks to @seb-harmonikar for the fix. Use seb's fix below.
A quick abstraction thrown together so we can use ctrl-t to insert messages or convert any object to a message. Requires iemguts.
@oid I think I fixed the bug in this one; maybe it can help with the other more complex object.
msg.pd
basically, I changed the order:
loadbang - object is created. in the event of autopatch, new blank object is also created in the parent patch and connected to
after a delay of 0 (meaning the scheduler puts it after everything else currently on the scheduling list) the new message box is created, and its index is queried as the last item in the canvas (because autopatch may have created a new object in between [msg]
and this new message box in the meantime). All connections are fixed.
after another delay of 0, [msg]
deletes itself
Edit: actually I'm not sure all those delays are necessary.. I'll look at it again later. I think the main thing is that the auto patched object is created before the dynamically created ones (and that usage of [canvasindex]
takes that into account)
Edit2: turns out the [del 0]
before the deletion wasn't necessary. updated the patch (& also [declare]
d the iemguts path)
@seb-harmonik.ar So that is what a delay of 0 does, I accidentally stumbled upon that in my other patch and could not figure out why it made part of it work. A quick try on using this setup with it had no luck but it has a much more complex init and load so probably need to do a bit more. I will play with it some tonight and if I can not figure it out I will upload it to see what you can do with it. Thanks.
Oops! Looks like something went wrong!