--- On Tue, 3/2/10, volker böhm vboehm@gmx.ch wrote:
From: volker böhm vboehm@gmx.ch Subject: Re: [PD] integer values To: pd-list@iem.at Date: Tuesday, March 2, 2010, 12:02 PM
On 02.03.2010, at 11:03, João Pais wrote:
(Volker, if you're not in a hurry and this
interests you, I could make an example around the end of the week)
The good thing about data structures is that you can
make a nice gui with it (in case that matters).
hi joao, no it's not urgent at all. the looks aren't important to me, but the inteface should be intuitive and responsive (the array solution is lacking responsiveness in my opinion. it's actually not easy to control single values).
jonathan, thanks a lot for your examples using data structures, this looks exactly like what i was hoping for. i'm only an occasional pd-hacker, and i've never looked at ds - and i know why: it seems complicated ;)
well, i had only a quick go with this patch, but fwiw, i couldn't find a way to get the values back form the sliders to use them in the patch. i'm sure this is somehow possible, so i'm going to check the docs.
You pretty much just build your own [tabread] objects using [element].
Here's an example (not optimized at all!)
thanks, volker.
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
There is a very small error in the patch : [s linked_array] -> [s linked_garray]. However, this is a nice example. I'm working on data structures (for automations) and it would be nice to have a 'return' from [struct] (or something like that, but i don't know what :) when you modify an array of scalars (with mouse) without [metro] to update some values (like in your patch with the array 'linked_garray', but without a [metro] to update). Hope what i mean is enough clear ? ++
Jack
Le mardi 02 mars 2010 à 13:10 -0800, Jonathan Wilkes a écrit :
--- On Tue, 3/2/10, volker böhm vboehm@gmx.ch wrote:
From: volker böhm vboehm@gmx.ch Subject: Re: [PD] integer values To: pd-list@iem.at Date: Tuesday, March 2, 2010, 12:02 PM
On 02.03.2010, at 11:03, João Pais wrote:
(Volker, if you're not in a hurry and this
interests you, I could make an example around the end of the week)
The good thing about data structures is that you can
make a nice gui with it (in case that matters).
hi joao, no it's not urgent at all. the looks aren't important to me, but the inteface should be intuitive and responsive (the array solution is lacking responsiveness in my opinion. it's actually not easy to control single values).
jonathan, thanks a lot for your examples using data structures, this looks exactly like what i was hoping for. i'm only an occasional pd-hacker, and i've never looked at ds - and i know why: it seems complicated ;)
well, i had only a quick go with this patch, but fwiw, i couldn't find a way to get the values back form the sliders to use them in the patch. i'm sure this is somehow possible, so i'm going to check the docs.
You pretty much just build your own [tabread] objects using [element].
Here's an example (not optimized at all!)thanks, volker.
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
_______________________________________________ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
--- On Wed, 3/3/10, Jack jack@rybn.org wrote:
From: Jack jack@rybn.org Subject: Re: [PD] integer values To: "Jonathan Wilkes" jancsika@yahoo.com Cc: pd-list@iem.at, "volker böhm" vboehm@gmx.ch Date: Wednesday, March 3, 2010, 2:16 AM There is a very small error in the patch : [s linked_array] -> [s linked_garray]. However, this is a nice example. I'm working on data structures (for automations) and it would be nice to have a 'return' from [struct] (or something like that, but i don't know what :) when you modify an array of scalars (with mouse) without [metro] to update some values (like in your patch with the array 'linked_garray', but without a [metro] to update). Hope what i mean is enough clear ? ++
Jack
Thanks for finding the error-- I must have forgotten to save after I made that needless change.
So which [struct] would the message come out of when modifying an element of an array-- the [struct] that defines the array or the [struct] that defines the element being modified?
If it's the [struct] that defines the array, then how do you specify which array and which index number of the thing that's getting moved? If it's the [struct] of the element being modified, I suppose the same question applies.
Also, how do you do it in a way that handles nested arrays gracefully?
-Jonathan
Le mardi 02 mars 2010 à 22:47 -0800, Jonathan Wilkes a écrit :
--- On Wed, 3/3/10, Jack jack@rybn.org wrote:
From: Jack jack@rybn.org Subject: Re: [PD] integer values To: "Jonathan Wilkes" jancsika@yahoo.com Cc: pd-list@iem.at, "volker böhm" vboehm@gmx.ch Date: Wednesday, March 3, 2010, 2:16 AM There is a very small error in the patch : [s linked_array] -> [s linked_garray]. However, this is a nice example. I'm working on data structures (for automations) and it would be nice to have a 'return' from [struct] (or something like that, but i don't know what :) when you modify an array of scalars (with mouse) without [metro] to update some values (like in your patch with the array 'linked_garray', but without a [metro] to update). Hope what i mean is enough clear ? ++
Jack
Thanks for finding the error-- I must have forgotten to save after I made that needless change.
So which [struct] would the message come out of when modifying an element of an array-- the [struct] that defines the array or the [struct] that defines the element being modified?
I don't know, that's why i ask ;) When you modify the size of a polygon, [struct] return a message. Why is it not possible with a [struct] that defines the array ?
If it's the [struct] that defines the array, then how do you specify which array and which index number of the thing that's getting moved?
Just receive a message there is an update of the array ? This is not possible at all ? ++
Jack
If it's the [struct] of the element being modified, I suppose the same question applies.
Also, how do you do it in a way that handles nested arrays gracefully?
-Jonathan
--- On Wed, 3/3/10, Jack jack@rybn.org wrote:
From: Jack jack@rybn.org Subject: Re: [PD] integer values To: "Jonathan Wilkes" jancsika@yahoo.com Cc: pd-list@iem.at, "volker böhm" vboehm@gmx.ch Date: Wednesday, March 3, 2010, 2:20 PM Le mardi 02 mars 2010 à 22:47 -0800, Jonathan Wilkes a écrit :
--- On Wed, 3/3/10, Jack jack@rybn.org
wrote:
From: Jack jack@rybn.org Subject: Re: [PD] integer values To: "Jonathan Wilkes" jancsika@yahoo.com Cc: pd-list@iem.at,
"volker böhm" vboehm@gmx.ch
Date: Wednesday, March 3, 2010, 2:16 AM There is a very small error in the patch : [s linked_array] -> [s linked_garray]. However, this is a nice example. I'm working on data structures (for automations)
and it
would be nice to have a 'return' from [struct] (or something like
that, but
i don't know what :) when you modify an array of scalars (with
mouse)
without [metro] to update some values (like in your patch with
the array
'linked_garray', but without a [metro] to
update).
Hope what i mean is enough clear ? ++
Jack
Thanks for finding the error-- I must have forgotten
to save after I made
that needless change.
So which [struct] would the message come out of when
modifying an element
of an array-- the [struct] that defines the array or
the [struct] that defines the element being modified? I don't know, that's why i ask ;) When you modify the size of a polygon, [struct] return a message. Why is it not possible with a [struct] that defines the array ?
If it's the [struct] that defines the array, then how
do you specify which
array and which index number of the thing that's
getting moved? Just receive a message there is an update of the array ?
I don't think that would help very much, because you don't know which value was changed, or to which array it belongs (if you have more than one array in a struct). You would at least want to know the array name and index of the element being modified. So if I move the first element of the "boxes" array in that patch, it would be nice if I got the following message:
change boxes 0 (pointer)
So the pointer here points to the [graph] data structure-- in other words the one that defines that array. Putting the atoms of the message in that order would work well because you can route according to the array name, then immediately send the next message to the left inlet of [element] to do whatever it is you want to do with that data (or precede it with an [unpack 0 p] if you want to be finicky).
But if the message is to come out of the [struct] that defines the element (box), you'd probably want a different set of info in the message.
Btw- if you hook up [print] to the outlet of [struct box] in that patch, you'll see that every time you click somewhere in the array a series of messages is output. I don't understand what the numbers mean, and the (pointer) doesn't correspond to either of the data structures I have defined. But even if it did, that would be a lot of messages to deal with every time you happen to click the containing scalar (imagine if you're using a ds-array to visualize/manipulate five seconds of audio...)
-Jonathan
Le mercredi 03 mars 2010 à 10:01 -0800, Jonathan Wilkes a écrit :
--- On Wed, 3/3/10, Jack jack@rybn.org wrote:
From: Jack jack@rybn.org Subject: Re: [PD] integer values To: "Jonathan Wilkes" jancsika@yahoo.com Cc: pd-list@iem.at, "volker böhm" vboehm@gmx.ch Date: Wednesday, March 3, 2010, 2:20 PM Le mardi 02 mars 2010 à 22:47 -0800, Jonathan Wilkes a écrit :
--- On Wed, 3/3/10, Jack jack@rybn.org
wrote:
From: Jack jack@rybn.org Subject: Re: [PD] integer values To: "Jonathan Wilkes" jancsika@yahoo.com Cc: pd-list@iem.at,
"volker böhm" vboehm@gmx.ch
Date: Wednesday, March 3, 2010, 2:16 AM There is a very small error in the patch : [s linked_array] -> [s linked_garray]. However, this is a nice example. I'm working on data structures (for automations)
and it
would be nice to have a 'return' from [struct] (or something like
that, but
i don't know what :) when you modify an array of scalars (with
mouse)
without [metro] to update some values (like in your patch with
the array
'linked_garray', but without a [metro] to
update).
Hope what i mean is enough clear ? ++
Jack
Thanks for finding the error-- I must have forgotten
to save after I made
that needless change.
So which [struct] would the message come out of when
modifying an element
of an array-- the [struct] that defines the array or
the [struct] that defines the element being modified? I don't know, that's why i ask ;) When you modify the size of a polygon, [struct] return a message. Why is it not possible with a [struct] that defines the array ?
If it's the [struct] that defines the array, then how
do you specify which
array and which index number of the thing that's
getting moved? Just receive a message there is an update of the array ?
I don't think that would help very much, because you don't know which value was changed, or to which array it belongs (if you have more than one array in a struct). You would at least want to know the array name and index of the element being modified. So if I move the first element of the "boxes" array in that patch, it would be nice if I got the following message:
change boxes 0 (pointer)
So the pointer here points to the [graph] data structure-- in other words the one that defines that array. Putting the atoms of the message in that order would work well because you can route according to the array name, then immediately send the next message to the left inlet of [element] to do whatever it is you want to do with that data (or precede it with an [unpack 0 p] if you want to be finicky).
But if the message is to come out of the [struct] that defines the element (box), you'd probably want a different set of info in the message.
Btw- if you hook up [print] to the outlet of [struct box] in that patch, you'll see that every time you click somewhere in the array a series of messages is output. I don't understand what the numbers mean, and the (pointer) doesn't correspond to either of the data structures I have defined. But even if it did, that would be a lot of messages to deal with every time you happen to click the containing scalar (imagine if you're using a ds-array to visualize/manipulate five seconds of audio...)
With the [print] object on [struct graph], i have something in the console when i click somewhene on the array only in edit mode, not in run mode. Something like : print: select \p(0x0xbfb28e08) print: displace \p(0x0xbfb28e80) 0 print: displace \p(0x0xbfb28e80) 1 print: deselect \p(0x0xbfb28dd8)
But nothing from [struct box]. I miss something ?
For my patch, a bang message should be enough to update my [table] object with (for example) :
[bang( : when a value change from the array (or as you suggest : change boxes :) [until] [element] [pointer] [get] [tabwrite]
Now i use a [metro] to update the content of my [table] every 100 ms : [metro 100] [until] [element] [pointer] [get] [tabwrite]
Thanx. ++
Jack
-Jonathan