• oid

    So I got a TCL solution partially working. Rebound control-1..5 so they now test the contents of the current object to see if it is the macro, if it is it toggles editmode off then on to deselect all, waits a few ms and places the new object. Works well but only works for default keybindings and does not work for objects placed from the Put menu, but I am not sure there will be a simple solution for the Put menu.

    posted in technical issues read more
  • oid

    @catkisser666 The textfile is not getting loaded in time, the bangs being output tells you there is nothing there to get. Try this. Also, you do not need the [clear( as [read( replaces everything in the [text].
    Untitled.png

    posted in technical issues read more
  • oid

    @seb-harmonik.ar Yeah, it got fairly complex, some things are done kind of weird for ease of bug hunting/sorting out the final details but it is a fairly complete macro system for pd and it won't get much simpler, just abit. Putting a [del 0] before the [loadbang] just causes it too crash if you use the auto patching. The [closebang] stuff will not work if done on the [loadbang], nothing ends up selected after it deletes itself. I fought with your [del] trick for a good while, not sure it can be done on this one but I don't really know. I did get it too not crash on undo once, but the autoplaced object ended up unconnected and stuck to the cursor instead, not sure how I did that and have not been able to reproduce it.

    My current plan is going back to TCL but I have not had much luck there either but I am slowly making progress and I might get that too work. Installed tclpd to explore that some but not thrilled about it as a solution since the deken version seems broken and compiling it was a bit of a pain so any solutions done that way do not really help make the abstraction something that can be uploaded and shared. A proper external is probably the way this abstraction should be done, but that is a bit beyond my ambition at this time.

    posted in technical issues read more
  • oid

    @seb-harmonik.ar Have not had much luck getting this too work, I suspect having [initbang], [loadbang], and [closebang] as well as not completely understanding how the scheduler works keeps it out of reach for me. The [closebang] is buried in [macro$0execute]/[macro$0errata] and used to be a [del 0] getting its bang from the [trigger] until you clued me into what the delay was doing. Reverted the patch to before my attempt and in [macro$0execute] I included a quick outline of what each subpatch does as well as the very preliminary help for the macros themselves in the subpatch there, should be enough to get you orientated. Also included is the basic counter macro in the macros folder, [m count] will run it.
    m.zip

    Edit: I am guessing the select logic will not really work with this fix? The autopatched object will always be connected to the last object? Will also require a tweak of the macros to make it connect to the proper object but that is trivial.

    posted in technical issues read more
  • oid

    @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.

    posted in abstract~ read more
  • oid

    @seb-harmonik.ar Quick test suggests [initbang] happens too late, the event has been added to the undo history by then and there seems to be nothing I can do at that point. My [msg] abstraction has the same bug and is far simpler. https://forum.pdpatchrepo.info/topic/14071/msg-a-message-object create a new object, use [msg] on it, control-1 or the like to autoplace the new object, undo and watch pd crash.

    posted in technical issues read more
  • oid

    @whale-av I attempted playing with the menus but I am trying to avoid actual editing of pd's tcl since the purpose of this plug-in is making the abstraction something which can be easily shared, seems there is little you can do there with a plugin since these are mostly run at startup and forgotten? I think I am getting closer, I can redefine the procs in pdtk_text, mainly pdtk_text_new which is the new object creation proc and pdtk_text_set which provides the text in the currently edited object. Have pdtk_text_set test the current object to see if it is the macro abstraction and set a variable if it is, then when pdtk_text_new is called if the variable i set then deselect all before doing the rest of pdtk_text_new. This assumes pdtk_text_new is run before the connection is made, which I think it is, even if it is not I can use pdtk_text_set to make default binding work but the Put menu and custom bindings still present an issue. Thanks for that bit on the tcl message and cluing me in on HCS/sys_gui, will be very helpful.

    posted in technical issues read more
  • oid

    @whale-av Anything done from within the macro abstraction will be done after the connection is made to the abstraction if you apply by pressing control-1 to place the next object, so any work around like simulated clicks would be done after that connection is made which means it is to late, I tried everything including disconnecting the macro abstraction before it deletes itself but no luck since that connection is in the undo history and if you undo it you get a crash. Here you can see that if you place the new object with Control-1 or the like there will be no connection to it from the objects which the macro patched in, it was made to the macro object which deleted itself and when you do the undo you get the crash.
    output.gif
    Think I explained things better this time, becoming stupid from fighting with TCL/TK for far too long, but I think a TCL plugin is the only way short of a full fledged external.

    posted in technical issues read more
  • oid

    So I am just putting the finishing touches on a macro abstraction that is a real time saver and does all sorts of fun stuff and can use plain old regular abstractions as the macro files or be extended well beyond into quite complicated macros while still following the standard pd patch methodology, arguments, dynamic number of ins/outs, variables, etc. But it has one major flaw, if you apply the object by using the autopatching/placing the next object the new object will be connected to the abstraction which deletes itself, not the new objects the abstraction patched in and if you undo that will crash pd since the abstraction no longer exists; you have to apply the abstraction by clicking in the window or risk creating a situation that can crash pd. So I am looking for work arounds and a TCL plugin seems like it would be the best bet, my plan was too intercept the new object creation, check if it is the macro abstraction and if it is apply the object by sending a deselect then wait a few milliseconds so the abstraction can do its thing before placing the object (part of the macros is which object/objects to select on shutdown). I am having very slow progress in finding my way through pd's TCL and I am not even sure if what I intend is possible so hoping some of you can point me in the right direction, offer alternatives, or any sort of help.
    output.gif

    posted in technical issues read more
  • oid

    This had a bug which could crash pd in some situations, thanks to @seb-harmonikar for the fix.

    output.gif
    A quick abstraction thrown together so we can use ctrl-t to insert messages or convert any object to a message. Requires iemguts.
    msg.pd
    msg.png

    posted in abstract~ read more

Internal error.

Oops! Looks like something went wrong!