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?
-
display an [array define] array constantly?
-
@Jona Everything is all over the place in Vanilla.
[text define] takes the message [click( to open it and [close( to close it.
[array define] takes [map 1( to open it BUT you get a consistency check error.
[map 0( hides the array but does not close the window.BUT, it takes the message [click( with ye olde undocumented arguments message to pd...... so....
[click 200 100 0 1 0( will open it without error.
More messages [mouseup( [click( etc. will write to the array.....
David. -
@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).
-
@Jona Might be. I will spend some time looking.
We discussed something similar before I think, and copying the array object contents to a graphical array (table) was the solution.
David. -
@whale-av something like this? that is what i used so far...
arraydefinedisplay.pd
-
@Jona The graphical array is just an [array] combined with a graphical representation. So you can directly access it with the [array] object without the need of a helper array: arraydisplay.pd
-
@Jona Yes, it must be.
Is the problem updating it or something else, or are you just hoping for a neater solution?
I remember now.... the previous problem was the array not saving more than 100 floats...... so the solution was to copy in the other direction.[array define] is just a slightly better [table] so it is designed to be hidden.
Any size or reset, or read message (and probably others) that you send into [array define] can also be sent at the same time to an array (showing as a GOP) and will be understood....... and it can have the same name...... so if you use a message like
[;
myarray read file.txt, resize 30(
then both arrays will receive it and be modified,
David -
You can also use the messages from [array define] like const and resize by just sending them to the graphical array: arraydisplay2.pd
-
@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). -
@Jona I expected "multiply defined" but in 049 in win7 I get no complaints.
David. -
@Jona Yes. There is a hack to get the pointer of a graphical array. It is pretty messy, but it works. I used this method in [colarray] (https://forum.pdpatchrepo.info/topic/11184/colarray-a-graphical-array-where-color-and-line-width-can-be-set).
The background is that every array, graphical or not, is in fact a representation of a [struct] that is loaded in the background when Pd starts. The trick i used is to modify this hidden patch that contains the [struct] for all arrays by using dynamic patching, then click on the array by using a mouse message. The struct then sends out the pointer to the specific array. But the situations where this is really necessary should be limited.
-
@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.
-
Using an array object like [array get] gives a multiply defined error when graphical and non-graphical arrays with the same name are present
-
@Jona Miller mentions alternative anonymous access in the help file...... so maybe it will magically appear?
David. -
@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. -
@Jona Interesting, the outlet of [array define] was not there in 0.48.1. There you would have to get the pointer via [send( message.
For [colarray], the dynamic patching was needed, because i wanted to modify a graphical array
-
@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
-
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