• Jona

    @whale-av I wonder if it would be possible to access all (or some) of the options from your vanilla-colours-plugin with ofelia?
    https://forum.pdpatchrepo.info/topic/9960/tcl-for-a-rainy-day/23
    and I also wonder if it is possible to implement a mouse plug-in i made some time ago.
    my first attempt does not work. (not that it is really necessary)
    this is the code from the mouse plug-in:

    bind all <Motion> {pdsend "mouse_receive $focused_window motion %x %y"}
    
    bind all <ButtonRelease-1> {pdsend "mouse_receive $focused_window  mouseup %x %y"}
    
    bind all <ButtonPress-1> {pdsend "mouse_receive $focused_window mousedown %x %y"}
    
    bind all <FocusIn> {pdsend "mouse_receive $focused_window"}
    
    pdtk_post "loaded: experimental mouse plugin\n"```

    posted in technical issues read more
  • Jona

    starting from the ofelia sysgui example i tried to find out which tcl tk commands i can send to pd.
    i think basically it can do the same as the [sys_gui] object from the hcs library or the tcl-plugins.
    i liked the possibility to load images but it seems not possible to load them in a gop, and they dissapear after their window is closed (like with text and shapes too).
    Also changing the font is quite buggy ;)
    ofelia_sys_gui.zip

    posted in technical issues read more
  • Jona

    @ingox thats funny and interesting. i think i saw the data structure sort documentation once, but never in use. nice way to use it with list sort :) i have to admit that i was using the old extended list-abs library until now (with a different list-sort).
    the "new" list sort abstraction is already much better (and faster than my attempt).
    on the right side of this patch i still tried to optimize the abstraction, on the left is the original (with the newer list-abs library installed):
    struct_list_sort.pd

    posted in abstract~ read more
  • Jona

    @MeneerJansen here is another very nice (not only) snare emulation patch from @mianmogra that you can download: https://forum.pdpatchrepo.info/topic/12015/mymembrane-acoustic-drum-synthesizer

    posted in technical issues read more
  • Jona

    just realized that i do not need to create a struct and plot object for changing float-array settings (color/linewidth/style) because they are already there (hidden).
    arraypointertest.pd

    posted in technical issues read more
  • Jona

    @ingox i also discovered the pointer outlet just recently. [text define] has a pointer outlet too. first time i saw data structures with text was in a demo patch from @jancsika https://forum.pdpatchrepo.info/topic/8836/dictionary-object-in-pd-extended/26

    posted in technical issues read more
  • Jona

    @ingox a bit off-topic - this way you can change data structure settings of an array without dynamic patching (just discovered it with the help from your [colarray] patch). still needs the array pointer, so you need to click [array define] for showing the array:
    arraypointertest.pd
    @whale-av i also wondered about that. i am not sure what Miller means with "alternative anonymous access" and would like to know it.
    but if i remember right it is not implemented yet...
    for data structures there is kind of a wild card, something like [set -] and [get -]. perhaps the "alternative anonymous access" has to do with that, but i am absolutely not sure.

    posted in technical issues read more
  • Jona

    @ingox interesting hack.
    @whale-av it seems that messages are received from both, but [array set] sends only to the object that was created first.

    posted in technical issues read more
  • Jona

    @whale-av you are right. the list is sent to the object that was created first, whether the graphical representation or [array define] but no multiply define message.

    posted in technical issues read more
  • Jona

    @ingox thanks. so it seems that everything that is possible with [array define] except sending the array pointer, is also possible with sending messages to the graphical representation. but it is not possible to have [array define] and the graphical representation at the same time ( multiply defined).
    @whale-av just hoping for a neater solution ;) but now i think it is fine like it is (i assume the array pointer is not needed very often).

    posted in technical issues read more
  • Jona

    @whale-av something like this? that is what i used so far...
    arraydefinedisplay.pd
    arraydefdisp.PNG

    posted in technical issues read more
  • Jona

    @whale-av thanks. and sorry, i asked wrongly (but also good to know the map message). i wanted to know if it is possible to show an [array define] array as graph on parent (like with a table).

    posted in technical issues read more
  • Jona

    is it possible to display an [array define] array constantly (without clicking on it)? or do i need to send the values to a [table] for displaying the array?

    posted in technical issues read more
  • Jona

    i changed the name of the thread, so i do not need a new one for every little abstraction ;)
    of course i would also like to see lua abstractions from other people.
    here is another one: luadateandtime.pd

    luadateandtime.PNG

    function ofelia.bang();
    return os.date("today is %A the %dth in %B %Y and the time is %X");
    end;
    

    posted in abstract~ read more
  • Jona

    i made two abstractions for mapping operations to all elements of a list. (i think) [vListMap] has the same functionality as [list-map] from the list-abs library, and [vArrayMap] works with arrays instead of list and only accepts numbers as elements but needs only ~ half the time of [vListMap]. with [vArrayMap] i tried to access a pd [array] as a data structure array, it seems to be the fastest method.
    like someone else mentioned before: also a lot of the other (useful) list-abs abstractions could be optimized with newer objects like [text store] and [array].

    map.zip

    map.PNG

    posted in abstract~ read more
  • Jona

    @solipp at least you need to route the values somehow to and from [savestate]? on the other hand it is possible to save [array] and [text] with the -k flag and toggles/sliders/Radio/numbers2 with init. but the difference to init and -k seems (from the doc): "[savestate] output comes before [loadbang], this mechanism was suggested by Miller in the Pd list and allows to set default values for the controls which will be used whenever there is no state saving in the parent patch. If you open this file (store.state.pd) it'll load with these values."
    edit: wrote my answers before i saw the one from @weightless, so it is kind of redundant...

    posted in abstract~ read more
  • Jona

    @jancsika interesting. when i have 100000 instead of 10000 keys the time for searching stays almost the same.
    it could be well worth an object or abstraction?
    and i wonder why this hash mechanism is not already part of [text]. is there a reason?

    posted in technical issues read more
  • Jona

    @jancsika thanks a lot for the demo, very nice. yes, i think it shed some light on data structures, hash maps and also how pd internally works. i did not know that text can be an element of data structure arrays.
    i tried to implement the text search at the right object chain.
    to save the patch i need to clear $0-data first, otherwise the patch crashes before saving.
    interesting that the hash conversion is a bottleneck, without it is 2 times faster (in pure data).
    i also tried to generate the hash number with a lua script, but that that is even (a little) slower:

    function ofelia.symbol(stringList);
    local a = {};
    local b = 0;
    local c = 0;
    for i = 1, string.len(stringList) do;
    a[i] = string.byte(stringList, i);
    end;
    for i = 1, #a do;
    b = a[i] + b;
    c = (b + c) % 1000;
    end;
    return c;
    end;
    

    i found this about pure data strings:

    "A symbol is a string that is cached (or in fact, permanently stored in a hash table) inside PureData. It can also have some data attached to it. Symbols are a very important part of PureData since a lot of information (e.g. type info) is identified by using them.

    The fact that a symbol is permanently resident has the following consequences: * In a PureData external symbol strings can be compared by comparing their pointer values, since there's only one copy in the system. This makes comparison much faster than comparing string characters. Data attached to a symbol won't get lost, since once a created, a symbol stays in the system. If many symbols are created (e.g. automatically in a patch), symbol lookup in the hash table will get slower - this can slow down the whole system as long as PureData is running.

    ThomasGrill"

    https://puredata.info/community/pdwiki/symbol

    dictB.zip

    posted in technical issues read more
  • Jona

    here is what i could find out about the text pointer and data structures. there is even a text field in [struct] and you can draw the first 100 lines of the text.
    it is also possible to save multiple texts in one [struct] object.
    but it seems not much faster to access text from data structures than from the usual [text] object because there is no direct access like array has with [element].

    textPointer.pd
    text_pointer.PNG
    somehow the drawn text disappears after reopening the patch (but the stored text data is still accesseble).

    posted in technical issues read more
  • Jona

    i wonder especially about this sentence in the [set] help file: "Arrays are accessed using the [element] object, and lists using [text] objects." Access arrays with [element] is no problem, but how can i use lists with data structures and access them with [text]? Or do I misunderstand something from the help file?

    edit: the explanation is at the bottom of the [text] help file [pd text-and-data-structures]...

    posted in technical issues read more
Internal error.

Oops! Looks like something went wrong!