Re: [PD] Nestable Dictionaries in Pd
just recalled something, see the following patches in my tutorials: data-s_09.pd for array encapsulation, and data-s_09a.pd on how to use [array] and [text] to interact with data structures. afaik that is still up to date info. Dear all I am trying to find the most Pd-vanilla-way to interface with our Dataset object in the FluCoMa project. In Max and SuperCollider we use Dictionaries, which are nestable and queryable in powerful programmatic ways, working essentially like interfaces to JSON-like data structures. I’ve looked at [struct] but the [set] object does not allow to do symbols and (list of) floats, and [appends] seem to have the same limitations. In all cases, I’m not certain it is the best approach in any cases to create such a list in Pd... I wonder how people do it and if I am missing an obvious workflow, especially with nested structures. Any pointer (pun intended) welcome p ___ Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list ___ Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list
Re: [PD] Nestable Dictionaries in Pd
can you post an example of a parsed content? Thanks all for the pointers. Now it is on mer to check the other tutorials > and find a way around. Our object does parse json in and out to file and > std if needs be, the only idea here is a batch interface with Pd so users > can input and retrieve en masse to our dataset world (with mlp and umap and > other fun ML goodies - all working so soon on a repo near you if I can > crack that last interface problem :) > > > On 8 Sep 2021, at 08:26, João Pais wrote: > > > > is jmmmp/cellblock a model of what you could use? but adapted to lists > and maybe not so complex? > > > > I tried opening your first example in [text]. As I thought, the issue is > that commas are already reserved in pd for line changes. The output is this > (I added a line number at the start of each line) when using carriage > returns: > > > > print: 0 { > > print: 1 "cols" : 3 > > print: 2 > > print: 3 "data" : { > > print: 4 "entry-0" : [ -0.06755 > > print: 5 0.44185 > > print: 6 -0.33835 ] > > print: 7 > > print: 8 "entry-1" : [ -0.12305 > > print: 9 -0.24085 > > print: 10 0.31295 ] > > print: 11 > > print: 12 "entry-2" : [ -0.0595 > > print: 13 -0.2881 > > print: 14 0.0597 ] > > print: 15 } > > print: 16 > > print: 17 } > > print: 18 > > > > Or this without them: > > > > print: 0 { "cols" : 3 > > print: 1 "data" : { "entry-0" : [ -0.06755 > > print: 2 0.44185 > > print: 3 -0.33835 ] > > print: 4 "entry-1" : [ -0.12305 > > print: 5 -0.24085 > > print: 6 0.31295 ] > > print: 7 "entry-2" : [ -0.0595 > > print: 8 -0.2881 > > print: 9 0.0597 ] } } > > print: 10 > > > > which makes it a bit hard to read json files without some hacking, as > all those commas create a new line. Unless there is another method, is it > better to code your own json interpreter? > > > > One advantage of [text] is that it can be used to declare data > structures directly - examples might be in my tutorial, I'm not sure > anymore how far I got with it. > > > > Files are attached. > > > > Joao > > > >> Thanks for the quick reply! > >> > >> 2 use-cases. > >> > >> 1- we can generate or retrieve a dataset's content to use natively in > the creative coding environment (Max Pd Sc) so that it integrates in other > workflows of data mangling and drawing. We already have in our dataset > object file support and single point entry and query but this allow batch > dump and load. The structure is: > >> > >> { > >> "cols" : 3, > >> "data" :{ > >> "entry-0" : [ -0.06755, 0.44185, -0.33835 ], > >> "entry-1" : [ -0.12305, -0.24085, 0.31295 ], > >> "entry-2" : [ -0.0595, -0.2881, 0.0597 ] > >> } > >> > >> } > >> > >> > >> 2- we can retrieve or set the state of a complex objects. Our object > will spit out its internal status ( for instance, a neural net) and we can > use the values of its parameters, like below. More interestingly, we can > also query its structure and use that information too. > >> > >> { > >> "layers" : [{ > >> "activation" : 3, > >> "biases" : [ -3.076234734727154, 0.772760846709679 > ], > >> "cols" : 2, > >> "rows" : 1, > >> "weights" : [ [ 6.015551733036155, > -1.826803841455323 ] ] > >> } > >> ,{ > >> "activation" : 3, > >> "biases" : [ -0.490600074475542 ], > >> "cols" : 1, > >> "rows" : 2, > >> "weights" : [ [ -3.115116035462417 ], [ > -3.969281643687132 ] ] > >> } > >> ] > >> } > >> > >> The key-value nesting is quite powerful for this type of open > structure... > >> > >>> On 7 Sep 2021, at 15:51, Christof Ressi > wrote: > >>> > >>> Can you give an example of how the data is structured? > >>> > >>> In which ways are users supposed to interact with the data? > >>> > >>> Christof > >>> > >>> On 07.09.2021 16:37, Pierre Alexandre Tremblay wrote: > Dear all > > I am trying to find the most Pd-vanilla-way to interface with our > Dataset object in the FluCoMa project. In Max and SuperCollider we use > Dictionaries, which are nestable and queryable in powerful programmatic > ways, working essentially like interfaces to JSON-like data structures. > > I’ve looked at [struct] but the [set] object does not allow to do > symbols and (list of) floats, and [appends] seem to have the same > limitations. In all cases, I’m not certain it is the best approach in any > cases to create such a list in Pd... > > I wonder how people do it and if I am missing an obvious workflow, > especially with nested structures. > > Any pointer (pun intended) welcome > > p > > > > > > ___ Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management ->
Re: [PD] Nestable Dictionaries in Pd
Thanks all for the pointers. Now it is on mer to check the other tutorials and find a way around. Our object does parse json in and out to file and std if needs be, the only idea here is a batch interface with Pd so users can input and retrieve en masse to our dataset world (with mlp and umap and other fun ML goodies - all working so soon on a repo near you if I can crack that last interface problem :) > On 8 Sep 2021, at 08:26, João Pais wrote: > > is jmmmp/cellblock a model of what you could use? but adapted to lists and > maybe not so complex? > > I tried opening your first example in [text]. As I thought, the issue is that > commas are already reserved in pd for line changes. The output is this (I > added a line number at the start of each line) when using carriage returns: > > print: 0 { > print: 1 "cols" : 3 > print: 2 > print: 3 "data" : { > print: 4 "entry-0" : [ -0.06755 > print: 5 0.44185 > print: 6 -0.33835 ] > print: 7 > print: 8 "entry-1" : [ -0.12305 > print: 9 -0.24085 > print: 10 0.31295 ] > print: 11 > print: 12 "entry-2" : [ -0.0595 > print: 13 -0.2881 > print: 14 0.0597 ] > print: 15 } > print: 16 > print: 17 } > print: 18 > > Or this without them: > > print: 0 { "cols" : 3 > print: 1 "data" : { "entry-0" : [ -0.06755 > print: 2 0.44185 > print: 3 -0.33835 ] > print: 4 "entry-1" : [ -0.12305 > print: 5 -0.24085 > print: 6 0.31295 ] > print: 7 "entry-2" : [ -0.0595 > print: 8 -0.2881 > print: 9 0.0597 ] } } > print: 10 > > which makes it a bit hard to read json files without some hacking, as all > those commas create a new line. Unless there is another method, is it better > to code your own json interpreter? > > One advantage of [text] is that it can be used to declare data structures > directly - examples might be in my tutorial, I'm not sure anymore how far I > got with it. > > Files are attached. > > Joao > >> Thanks for the quick reply! >> >> 2 use-cases. >> >> 1- we can generate or retrieve a dataset's content to use natively in the >> creative coding environment (Max Pd Sc) so that it integrates in other >> workflows of data mangling and drawing. We already have in our dataset >> object file support and single point entry and query but this allow batch >> dump and load. The structure is: >> >> { >> "cols" : 3, >> "data" :{ >> "entry-0" : [ -0.06755, 0.44185, -0.33835 ], >> "entry-1" : [ -0.12305, -0.24085, 0.31295 ], >> "entry-2" : [ -0.0595, -0.2881, 0.0597 ] >> } >> >> } >> >> >> 2- we can retrieve or set the state of a complex objects. Our object will >> spit out its internal status ( for instance, a neural net) and we can use >> the values of its parameters, like below. More interestingly, we can also >> query its structure and use that information too. >> >> { >> "layers" : [{ >> "activation" : 3, >> "biases" : [ -3.076234734727154, 0.772760846709679 ], >> "cols" : 2, >> "rows" : 1, >> "weights" : [ [ 6.015551733036155, -1.826803841455323 ] >> ] >> } >> ,{ >> "activation" : 3, >> "biases" : [ -0.490600074475542 ], >> "cols" : 1, >> "rows" : 2, >> "weights" : [ [ -3.115116035462417 ], [ >> -3.969281643687132 ] ] >> } >> ] >> } >> >> The key-value nesting is quite powerful for this type of open structure... >> >>> On 7 Sep 2021, at 15:51, Christof Ressi wrote: >>> >>> Can you give an example of how the data is structured? >>> >>> In which ways are users supposed to interact with the data? >>> >>> Christof >>> >>> On 07.09.2021 16:37, Pierre Alexandre Tremblay wrote: Dear all I am trying to find the most Pd-vanilla-way to interface with our Dataset object in the FluCoMa project. In Max and SuperCollider we use Dictionaries, which are nestable and queryable in powerful programmatic ways, working essentially like interfaces to JSON-like data structures. I’ve looked at [struct] but the [set] object does not allow to do symbols and (list of) floats, and [appends] seem to have the same limitations. In all cases, I’m not certain it is the best approach in any cases to create such a list in Pd... I wonder how people do it and if I am missing an obvious workflow, especially with nested structures. Any pointer (pun intended) welcome p > > ___ Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list
Re: [PD] Nestable Dictionaries in Pd
is jmmmp/cellblock a model of what you could use? but adapted to lists and maybe not so complex? I tried opening your first example in [text]. As I thought, the issue is that commas are already reserved in pd for line changes. The output is this (I added a line number at the start of each line) when using carriage returns: print: 0 { print: 1 "cols" : 3 print: 2 print: 3 "data" : { print: 4 "entry-0" : [ -0.06755 print: 5 0.44185 print: 6 -0.33835 ] print: 7 print: 8 "entry-1" : [ -0.12305 print: 9 -0.24085 print: 10 0.31295 ] print: 11 print: 12 "entry-2" : [ -0.0595 print: 13 -0.2881 print: 14 0.0597 ] print: 15 } print: 16 print: 17 } print: 18 Or this without them: print: 0 { "cols" : 3 print: 1 "data" : { "entry-0" : [ -0.06755 print: 2 0.44185 print: 3 -0.33835 ] print: 4 "entry-1" : [ -0.12305 print: 5 -0.24085 print: 6 0.31295 ] print: 7 "entry-2" : [ -0.0595 print: 8 -0.2881 print: 9 0.0597 ] } } print: 10 which makes it a bit hard to read json files without some hacking, as all those commas create a new line. Unless there is another method, is it better to code your own json interpreter? One advantage of [text] is that it can be used to declare data structures directly - examples might be in my tutorial, I'm not sure anymore how far I got with it. Files are attached. Joao Thanks for the quick reply! 2 use-cases. 1- we can generate or retrieve a dataset's content to use natively in the creative coding environment (Max Pd Sc) so that it integrates in other workflows of data mangling and drawing. We already have in our dataset object file support and single point entry and query but this allow batch dump and load. The structure is: { "cols" : 3, "data" : { "entry-0" : [ -0.06755, 0.44185, -0.33835 ], "entry-1" : [ -0.12305, -0.24085, 0.31295 ], "entry-2" : [ -0.0595, -0.2881, 0.0597 ] } } 2- we can retrieve or set the state of a complex objects. Our object will spit out its internal status ( for instance, a neural net) and we can use the values of its parameters, like below. More interestingly, we can also query its structure and use that information too. { "layers" : [ { "activation" : 3, "biases" : [ -3.076234734727154, 0.772760846709679 ], "cols" : 2, "rows" : 1, "weights" : [ [ 6.015551733036155, -1.826803841455323 ] ] } , { "activation" : 3, "biases" : [ -0.490600074475542 ], "cols" : 1, "rows" : 2, "weights" : [ [ -3.115116035462417 ], [ -3.969281643687132 ] ] } ] } The key-value nesting is quite powerful for this type of open structure... On 7 Sep 2021, at 15:51, Christof Ressi wrote: Can you give an example of how the data is structured? In which ways are users supposed to interact with the data? Christof On 07.09.2021 16:37, Pierre Alexandre Tremblay wrote: Dear all I am trying to find the most Pd-vanilla-way to interface with our Dataset object in the FluCoMa project. In Max and SuperCollider we use Dictionaries, which are nestable and queryable in powerful programmatic ways, working essentially like interfaces to JSON-like data structures. I’ve looked at [struct] but the [set] object does not allow to do symbols and (list of) floats, and [appends] seem to have the same limitations. In all cases, I’m not certain it is the best approach in any cases to create such a list in Pd... I wonder how people do it and if I am missing an obvious workflow, especially with nested structures. Any pointer (pun intended) welcome p #N canvas 253 27 402 464 10; #X obj 13 78 text define \$0-json; #X msg 13 58 read -c test.json; #X obj 17 247 text get \$0-json; #X obj 17 267 list prepend; #X obj 17 287 list trim; #X obj 17 307 print; #X obj 17 227 t f f; #X msg 23 38 read test.json; #X obj 110 267 sel 2; #X text 9 15 1 - open file with or without carriage returns; #X obj 17 207 f; #X obj 46 207 + 1; #X obj 17 167 t b b; #X obj 64 187 0; #X obj 17 187 until; #X obj 17 147 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 -1; #X text 16 114 2 - click to print the file with a line number at the start of each line (compare with your original file); #X obj 44 392 text tolist \$0-json; #X obj 44 413 print; #X obj 44 371 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 -1; #X text 20 337 maybe it helps to export the content as a list for the processing?; #X connect 1 0 0 0; #X connect 2 0 3 0; #X connect 2 1 8 0; #X connect 3 0 4 0; #X connect 4 0 5 0; #X connect 6 0 2 0; #X connect 6 1 3 1; #X connect 7 0 0 0; #X connect 8 0 14 1; #X connect 10 0 11 0; #X connect 10 0 6 0; #X connect 11 0 10 1; #X connect 12 0 14 0; #X connect 12 1 13 0; #X
Re: [PD] Nestable Dictionaries in Pd
there's also one at https://github.com/porres/Live-Electronics-Tutorial/tree/v1.0-beta-43/Examples/Part.12-Advanced.Pd/37-Data.Structures but not fully completed yet Em ter., 7 de set. de 2021 às 18:04, João Pais escreveu: > you still have my data structures tutorials? that might be easier than > the documentation. > > > > I’ll give tutorial 4 a go, with the hints of everyone to see how far I > can go. > > > >> On 7 Sep 2021, at 20:34, Miller Puckette wrote: > >> > >> The least-horrible way to learn about it is the "4.data.structures" > tutorial > >> sequence. > >> > >> But the whole idea of hierarchical data structures maps horribly to a > >> patch language - there needs to be a better way to access 'data' in Pd. > >> > >> cheers > >> M > >> > >> On Tue, Sep 07, 2021 at 08:23:58PM +0100, Pierre Alexandre Tremblay > wrote: > >>> There are plenty of examples indeed :) > >>> > >>> I’ll give struct with text and arrays a fair fight, I find the doc > especially quite hard to follow for non-graphical usage but it might just > be me. > >>> > >>> > >>> > On 7 Sep 2021, at 19:23, João Pais wrote: > > Does the max documentation of flucoma has concrete examples of what > you're looking for? > > There is the purest_json library (which isn't vanilla), but maybe > with some hacking it might be possible to read files. Not sure about > writing, but my hacking isn't up to date with the current pd state. > > > > Thanks for the quick reply! > > > > 2 use-cases. > > > > 1- we can generate or retrieve a dataset's content to use natively > in the creative coding environment (Max Pd Sc) so that it integrates in > other workflows of data mangling and drawing. We already have in our > dataset object file support and single point entry and query but this allow > batch dump and load. The structure is: > > > > { > > "cols" : 3, > > "data" :{ > > "entry-0" : [ -0.06755, 0.44185, -0.33835 ], > > "entry-1" : [ -0.12305, -0.24085, 0.31295 ], > > "entry-2" : [ -0.0595, -0.2881, 0.0597 ] > > } > > > > } > > > > > > 2- we can retrieve or set the state of a complex objects. Our object > will spit out its internal status ( for instance, a neural net) and we can > use the values of its parameters, like below. More interestingly, we can > also query its structure and use that information too. > > > > { > > "layers" : [{ > > "activation" : 3, > > "biases" : [ -3.076234734727154, 0.772760846709679 > ], > > "cols" : 2, > > "rows" : 1, > > "weights" : [ [ 6.015551733036155, > -1.826803841455323 ] ] > > } > > , { > > "activation" : 3, > > "biases" : [ -0.490600074475542 ], > > "cols" : 1, > > "rows" : 2, > > "weights" : [ [ -3.115116035462417 ], [ > -3.969281643687132 ] ] > > } > > ] > > } > > > > The key-value nesting is quite powerful for this type of open > structure... > > > >> On 7 Sep 2021, at 15:51, Christof Ressi > wrote: > >> > >> Can you give an example of how the data is structured? > >> > >> In which ways are users supposed to interact with the data? > >> > >> Christof > >> > >> On 07.09.2021 16:37, Pierre Alexandre Tremblay wrote: > >>> Dear all > >>> > >>> I am trying to find the most Pd-vanilla-way to interface with our > Dataset object in the FluCoMa project. In Max and SuperCollider we use > Dictionaries, which are nestable and queryable in powerful programmatic > ways, working essentially like interfaces to JSON-like data structures. > >>> > >>> I’ve looked at [struct] but the [set] object does not allow to do > symbols and (list of) floats, and [appends] seem to have the same > limitations. In all cases, I’m not certain it is the best approach in any > cases to create such a list in Pd... > >>> > >>> I wonder how people do it and if I am missing an obvious workflow, > especially with nested structures. > >>> > >>> Any pointer (pun intended) welcome > >>> > >>> p > >>> > >>> > >>> > > > > > ___ > Pd-list@lists.iem.at mailing list > UNSUBSCRIBE and account-management -> > https://lists.puredata.info/listinfo/pd-list > ___ Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list
Re: [PD] Nestable Dictionaries in Pd
you still have my data structures tutorials? that might be easier than the documentation. I’ll give tutorial 4 a go, with the hints of everyone to see how far I can go. On 7 Sep 2021, at 20:34, Miller Puckette wrote: The least-horrible way to learn about it is the "4.data.structures" tutorial sequence. But the whole idea of hierarchical data structures maps horribly to a patch language - there needs to be a better way to access 'data' in Pd. cheers M On Tue, Sep 07, 2021 at 08:23:58PM +0100, Pierre Alexandre Tremblay wrote: There are plenty of examples indeed :) I’ll give struct with text and arrays a fair fight, I find the doc especially quite hard to follow for non-graphical usage but it might just be me. On 7 Sep 2021, at 19:23, João Pais wrote: Does the max documentation of flucoma has concrete examples of what you're looking for? There is the purest_json library (which isn't vanilla), but maybe with some hacking it might be possible to read files. Not sure about writing, but my hacking isn't up to date with the current pd state. Thanks for the quick reply! 2 use-cases. 1- we can generate or retrieve a dataset's content to use natively in the creative coding environment (Max Pd Sc) so that it integrates in other workflows of data mangling and drawing. We already have in our dataset object file support and single point entry and query but this allow batch dump and load. The structure is: { "cols" : 3, "data" : { "entry-0" : [ -0.06755, 0.44185, -0.33835 ], "entry-1" : [ -0.12305, -0.24085, 0.31295 ], "entry-2" : [ -0.0595, -0.2881, 0.0597 ] } } 2- we can retrieve or set the state of a complex objects. Our object will spit out its internal status ( for instance, a neural net) and we can use the values of its parameters, like below. More interestingly, we can also query its structure and use that information too. { "layers" : [ { "activation" : 3, "biases" : [ -3.076234734727154, 0.772760846709679 ], "cols" : 2, "rows" : 1, "weights" : [ [ 6.015551733036155, -1.826803841455323 ] ] } , { "activation" : 3, "biases" : [ -0.490600074475542 ], "cols" : 1, "rows" : 2, "weights" : [ [ -3.115116035462417 ], [ -3.969281643687132 ] ] } ] } The key-value nesting is quite powerful for this type of open structure... On 7 Sep 2021, at 15:51, Christof Ressi wrote: Can you give an example of how the data is structured? In which ways are users supposed to interact with the data? Christof On 07.09.2021 16:37, Pierre Alexandre Tremblay wrote: Dear all I am trying to find the most Pd-vanilla-way to interface with our Dataset object in the FluCoMa project. In Max and SuperCollider we use Dictionaries, which are nestable and queryable in powerful programmatic ways, working essentially like interfaces to JSON-like data structures. I’ve looked at [struct] but the [set] object does not allow to do symbols and (list of) floats, and [appends] seem to have the same limitations. In all cases, I’m not certain it is the best approach in any cases to create such a list in Pd... I wonder how people do it and if I am missing an obvious workflow, especially with nested structures. Any pointer (pun intended) welcome p ___ Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list
Re: [PD] Nestable Dictionaries in Pd
I’ll give tutorial 4 a go, with the hints of everyone to see how far I can go. > On 7 Sep 2021, at 20:34, Miller Puckette wrote: > > The least-horrible way to learn about it is the "4.data.structures" tutorial > sequence. > > But the whole idea of hierarchical data structures maps horribly to a > patch language - there needs to be a better way to access 'data' in Pd. > > cheers > M > > On Tue, Sep 07, 2021 at 08:23:58PM +0100, Pierre Alexandre Tremblay wrote: >> There are plenty of examples indeed :) >> >> I’ll give struct with text and arrays a fair fight, I find the doc >> especially quite hard to follow for non-graphical usage but it might just be >> me. >> >> >> >>> On 7 Sep 2021, at 19:23, João Pais wrote: >>> >>> Does the max documentation of flucoma has concrete examples of what you're >>> looking for? >>> >>> There is the purest_json library (which isn't vanilla), but maybe with some >>> hacking it might be possible to read files. Not sure about writing, but my >>> hacking isn't up to date with the current pd state. >>> >>> Thanks for the quick reply! 2 use-cases. 1- we can generate or retrieve a dataset's content to use natively in the creative coding environment (Max Pd Sc) so that it integrates in other workflows of data mangling and drawing. We already have in our dataset object file support and single point entry and query but this allow batch dump and load. The structure is: { "cols" : 3, "data" :{ "entry-0" : [ -0.06755, 0.44185, -0.33835 ], "entry-1" : [ -0.12305, -0.24085, 0.31295 ], "entry-2" : [ -0.0595, -0.2881, 0.0597 ] } } 2- we can retrieve or set the state of a complex objects. Our object will spit out its internal status ( for instance, a neural net) and we can use the values of its parameters, like below. More interestingly, we can also query its structure and use that information too. { "layers" : [{ "activation" : 3, "biases" : [ -3.076234734727154, 0.772760846709679 ], "cols" : 2, "rows" : 1, "weights" : [ [ 6.015551733036155, -1.826803841455323 ] ] } , { "activation" : 3, "biases" : [ -0.490600074475542 ], "cols" : 1, "rows" : 2, "weights" : [ [ -3.115116035462417 ], [ -3.969281643687132 ] ] } ] } The key-value nesting is quite powerful for this type of open structure... > On 7 Sep 2021, at 15:51, Christof Ressi wrote: > > Can you give an example of how the data is structured? > > In which ways are users supposed to interact with the data? > > Christof > > On 07.09.2021 16:37, Pierre Alexandre Tremblay wrote: >> Dear all >> >> I am trying to find the most Pd-vanilla-way to interface with our >> Dataset object in the FluCoMa project. In Max and SuperCollider we use >> Dictionaries, which are nestable and queryable in powerful programmatic >> ways, working essentially like interfaces to JSON-like data structures. >> >> I’ve looked at [struct] but the [set] object does not allow to do >> symbols and (list of) floats, and [appends] seem to have the same >> limitations. In all cases, I’m not certain it is the best approach in >> any cases to create such a list in Pd... >> >> I wonder how people do it and if I am missing an obvious workflow, >> especially with nested structures. >> >> Any pointer (pun intended) welcome >> >> p >> >> >> >> >>> >> >> >> >> >> ___ >> Pd-list@lists.iem.at mailing list >> UNSUBSCRIBE and account-management -> >> https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.puredata.info_listinfo_pd-2Dlist=DwIGaQ=-35OiAkTchMrZOngvJPOeA=XprZV3Fxus2L1LCw80hE4Q=0Kw_QRYxpMOw9Aax8vn4jZtdijyKe7xtkoqbr9zc3oI=33CGUSqmnDATTF_7IGkENeVCNhX3lRow1I2w-lpXsLA= >> > > -- ___ Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list
Re: [PD] Nestable Dictionaries in Pd
The least-horrible way to learn about it is the "4.data.structures" tutorial sequence. But the whole idea of hierarchical data structures maps horribly to a patch language - there needs to be a better way to access 'data' in Pd. cheers M On Tue, Sep 07, 2021 at 08:23:58PM +0100, Pierre Alexandre Tremblay wrote: > There are plenty of examples indeed :) > > I’ll give struct with text and arrays a fair fight, I find the doc especially > quite hard to follow for non-graphical usage but it might just be me. > > > > > On 7 Sep 2021, at 19:23, João Pais wrote: > > > > Does the max documentation of flucoma has concrete examples of what you're > > looking for? > > > > There is the purest_json library (which isn't vanilla), but maybe with some > > hacking it might be possible to read files. Not sure about writing, but my > > hacking isn't up to date with the current pd state. > > > > > >> Thanks for the quick reply! > >> > >> 2 use-cases. > >> > >> 1- we can generate or retrieve a dataset's content to use natively in the > >> creative coding environment (Max Pd Sc) so that it integrates in other > >> workflows of data mangling and drawing. We already have in our dataset > >> object file support and single point entry and query but this allow batch > >> dump and load. The structure is: > >> > >> { > >>"cols" : 3, > >>"data" :{ > >>"entry-0" : [ -0.06755, 0.44185, -0.33835 ], > >>"entry-1" : [ -0.12305, -0.24085, 0.31295 ], > >>"entry-2" : [ -0.0595, -0.2881, 0.0597 ] > >>} > >> > >> } > >> > >> > >> 2- we can retrieve or set the state of a complex objects. Our object will > >> spit out its internal status ( for instance, a neural net) and we can use > >> the values of its parameters, like below. More interestingly, we can also > >> query its structure and use that information too. > >> > >> { > >>"layers" : [{ > >>"activation" : 3, > >>"biases" : [ -3.076234734727154, 0.772760846709679 ], > >>"cols" : 2, > >>"rows" : 1, > >>"weights" : [ [ 6.015551733036155, -1.826803841455323 ] > >> ] > >>} > >> , { > >>"activation" : 3, > >>"biases" : [ -0.490600074475542 ], > >>"cols" : 1, > >>"rows" : 2, > >>"weights" : [ [ -3.115116035462417 ], [ > >> -3.969281643687132 ] ] > >>} > >> ] > >> } > >> > >> The key-value nesting is quite powerful for this type of open structure... > >> > >>> On 7 Sep 2021, at 15:51, Christof Ressi wrote: > >>> > >>> Can you give an example of how the data is structured? > >>> > >>> In which ways are users supposed to interact with the data? > >>> > >>> Christof > >>> > >>> On 07.09.2021 16:37, Pierre Alexandre Tremblay wrote: > Dear all > > I am trying to find the most Pd-vanilla-way to interface with our > Dataset object in the FluCoMa project. In Max and SuperCollider we use > Dictionaries, which are nestable and queryable in powerful programmatic > ways, working essentially like interfaces to JSON-like data structures. > > I’ve looked at [struct] but the [set] object does not allow to do > symbols and (list of) floats, and [appends] seem to have the same > limitations. In all cases, I’m not certain it is the best approach in > any cases to create such a list in Pd... > > I wonder how people do it and if I am missing an obvious workflow, > especially with nested structures. > > Any pointer (pun intended) welcome > > p > > > > > > > > > > > ___ > Pd-list@lists.iem.at mailing list > UNSUBSCRIBE and account-management -> > https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.puredata.info_listinfo_pd-2Dlist=DwIGaQ=-35OiAkTchMrZOngvJPOeA=XprZV3Fxus2L1LCw80hE4Q=0Kw_QRYxpMOw9Aax8vn4jZtdijyKe7xtkoqbr9zc3oI=33CGUSqmnDATTF_7IGkENeVCNhX3lRow1I2w-lpXsLA= > -- ___ Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list
Re: [PD] Nestable Dictionaries in Pd
There are plenty of examples indeed :) I’ll give struct with text and arrays a fair fight, I find the doc especially quite hard to follow for non-graphical usage but it might just be me. > On 7 Sep 2021, at 19:23, João Pais wrote: > > Does the max documentation of flucoma has concrete examples of what you're > looking for? > > There is the purest_json library (which isn't vanilla), but maybe with some > hacking it might be possible to read files. Not sure about writing, but my > hacking isn't up to date with the current pd state. > > >> Thanks for the quick reply! >> >> 2 use-cases. >> >> 1- we can generate or retrieve a dataset's content to use natively in the >> creative coding environment (Max Pd Sc) so that it integrates in other >> workflows of data mangling and drawing. We already have in our dataset >> object file support and single point entry and query but this allow batch >> dump and load. The structure is: >> >> { >> "cols" : 3, >> "data" :{ >> "entry-0" : [ -0.06755, 0.44185, -0.33835 ], >> "entry-1" : [ -0.12305, -0.24085, 0.31295 ], >> "entry-2" : [ -0.0595, -0.2881, 0.0597 ] >> } >> >> } >> >> >> 2- we can retrieve or set the state of a complex objects. Our object will >> spit out its internal status ( for instance, a neural net) and we can use >> the values of its parameters, like below. More interestingly, we can also >> query its structure and use that information too. >> >> { >> "layers" : [{ >> "activation" : 3, >> "biases" : [ -3.076234734727154, 0.772760846709679 ], >> "cols" : 2, >> "rows" : 1, >> "weights" : [ [ 6.015551733036155, -1.826803841455323 ] >> ] >> } >> ,{ >> "activation" : 3, >> "biases" : [ -0.490600074475542 ], >> "cols" : 1, >> "rows" : 2, >> "weights" : [ [ -3.115116035462417 ], [ >> -3.969281643687132 ] ] >> } >> ] >> } >> >> The key-value nesting is quite powerful for this type of open structure... >> >>> On 7 Sep 2021, at 15:51, Christof Ressi wrote: >>> >>> Can you give an example of how the data is structured? >>> >>> In which ways are users supposed to interact with the data? >>> >>> Christof >>> >>> On 07.09.2021 16:37, Pierre Alexandre Tremblay wrote: Dear all I am trying to find the most Pd-vanilla-way to interface with our Dataset object in the FluCoMa project. In Max and SuperCollider we use Dictionaries, which are nestable and queryable in powerful programmatic ways, working essentially like interfaces to JSON-like data structures. I’ve looked at [struct] but the [set] object does not allow to do symbols and (list of) floats, and [appends] seem to have the same limitations. In all cases, I’m not certain it is the best approach in any cases to create such a list in Pd... I wonder how people do it and if I am missing an obvious workflow, especially with nested structures. Any pointer (pun intended) welcome p > ___ Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list
Re: [PD] Nestable Dictionaries in Pd
Does the max documentation of flucoma has concrete examples of what you're looking for? There is the purest_json library (which isn't vanilla), but maybe with some hacking it might be possible to read files. Not sure about writing, but my hacking isn't up to date with the current pd state. Thanks for the quick reply! 2 use-cases. 1- we can generate or retrieve a dataset's content to use natively in the creative coding environment (Max Pd Sc) so that it integrates in other workflows of data mangling and drawing. We already have in our dataset object file support and single point entry and query but this allow batch dump and load. The structure is: { "cols" : 3, "data" : { "entry-0" : [ -0.06755, 0.44185, -0.33835 ], "entry-1" : [ -0.12305, -0.24085, 0.31295 ], "entry-2" : [ -0.0595, -0.2881, 0.0597 ] } } 2- we can retrieve or set the state of a complex objects. Our object will spit out its internal status ( for instance, a neural net) and we can use the values of its parameters, like below. More interestingly, we can also query its structure and use that information too. { "layers" : [ { "activation" : 3, "biases" : [ -3.076234734727154, 0.772760846709679 ], "cols" : 2, "rows" : 1, "weights" : [ [ 6.015551733036155, -1.826803841455323 ] ] } , { "activation" : 3, "biases" : [ -0.490600074475542 ], "cols" : 1, "rows" : 2, "weights" : [ [ -3.115116035462417 ], [ -3.969281643687132 ] ] } ] } The key-value nesting is quite powerful for this type of open structure... On 7 Sep 2021, at 15:51, Christof Ressi wrote: Can you give an example of how the data is structured? In which ways are users supposed to interact with the data? Christof On 07.09.2021 16:37, Pierre Alexandre Tremblay wrote: Dear all I am trying to find the most Pd-vanilla-way to interface with our Dataset object in the FluCoMa project. In Max and SuperCollider we use Dictionaries, which are nestable and queryable in powerful programmatic ways, working essentially like interfaces to JSON-like data structures. I’ve looked at [struct] but the [set] object does not allow to do symbols and (list of) floats, and [appends] seem to have the same limitations. In all cases, I’m not certain it is the best approach in any cases to create such a list in Pd... I wonder how people do it and if I am missing an obvious workflow, especially with nested structures. Any pointer (pun intended) welcome p ___ Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list
Re: [PD] Nestable Dictionaries in Pd
Hello Pierre "does not allow to do symbols and (list of) floats" not with the set object but with the text and the array object that have a data structure specific part in their documentation. On Tue, Sep 7, 2021 at 10:24 AM Pierre Alexandre Tremblay < tremb...@gmail.com> wrote: > Thanks for the quick reply! > > 2 use-cases. > > 1- we can generate or retrieve a dataset's content to use natively in the > creative coding environment (Max Pd Sc) so that it integrates in other > workflows of data mangling and drawing. We already have in our dataset > object file support and single point entry and query but this allow batch > dump and load. The structure is: > > { > "cols" : 3, > "data" :{ > "entry-0" : [ -0.06755, 0.44185, -0.33835 ], > "entry-1" : [ -0.12305, -0.24085, 0.31295 ], > "entry-2" : [ -0.0595, -0.2881, 0.0597 ] > } > > } > > > 2- we can retrieve or set the state of a complex objects. Our object will > spit out its internal status ( for instance, a neural net) and we can use > the values of its parameters, like below. More interestingly, we can also > query its structure and use that information too. > > { > "layers" : [{ > "activation" : 3, > "biases" : [ -3.076234734727154, 0.772760846709679 > ], > "cols" : 2, > "rows" : 1, > "weights" : [ [ 6.015551733036155, > -1.826803841455323 ] ] > } > , { > "activation" : 3, > "biases" : [ -0.490600074475542 ], > "cols" : 1, > "rows" : 2, > "weights" : [ [ -3.115116035462417 ], [ > -3.969281643687132 ] ] > } > ] > } > > The key-value nesting is quite powerful for this type of open structure... > > > On 7 Sep 2021, at 15:51, Christof Ressi wrote: > > > > Can you give an example of how the data is structured? > > > > In which ways are users supposed to interact with the data? > > > > Christof > > > > On 07.09.2021 16:37, Pierre Alexandre Tremblay wrote: > >> Dear all > >> > >> I am trying to find the most Pd-vanilla-way to interface with our > Dataset object in the FluCoMa project. In Max and SuperCollider we use > Dictionaries, which are nestable and queryable in powerful programmatic > ways, working essentially like interfaces to JSON-like data structures. > >> > >> I’ve looked at [struct] but the [set] object does not allow to do > symbols and (list of) floats, and [appends] seem to have the same > limitations. In all cases, I’m not certain it is the best approach in any > cases to create such a list in Pd... > >> > >> I wonder how people do it and if I am missing an obvious workflow, > especially with nested structures. > >> > >> Any pointer (pun intended) welcome > >> > >> p > >> > >> > >> > >> > >> > >> ___ > >> Pd-list@lists.iem.at mailing list > >> UNSUBSCRIBE and account-management -> > https://lists.puredata.info/listinfo/pd-list > > > > > > > > ___ > > Pd-list@lists.iem.at mailing list > > UNSUBSCRIBE and account-management -> > https://lists.puredata.info/listinfo/pd-list > > > > > ___ > Pd-list@lists.iem.at mailing list > UNSUBSCRIBE and account-management -> > https://lists.puredata.info/listinfo/pd-list > -- José Rafael Subía Valdez www.jrsv.net *"...I am an Anarchist! Wherefore I will* *Not rule, and also ruled I will not be!"* - John Henry Mackay - ___ Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list
Re: [PD] Nestable Dictionaries in Pd
Thanks for the quick reply! 2 use-cases. 1- we can generate or retrieve a dataset's content to use natively in the creative coding environment (Max Pd Sc) so that it integrates in other workflows of data mangling and drawing. We already have in our dataset object file support and single point entry and query but this allow batch dump and load. The structure is: { "cols" : 3, "data" :{ "entry-0" : [ -0.06755, 0.44185, -0.33835 ], "entry-1" : [ -0.12305, -0.24085, 0.31295 ], "entry-2" : [ -0.0595, -0.2881, 0.0597 ] } } 2- we can retrieve or set the state of a complex objects. Our object will spit out its internal status ( for instance, a neural net) and we can use the values of its parameters, like below. More interestingly, we can also query its structure and use that information too. { "layers" : [{ "activation" : 3, "biases" : [ -3.076234734727154, 0.772760846709679 ], "cols" : 2, "rows" : 1, "weights" : [ [ 6.015551733036155, -1.826803841455323 ] ] } , { "activation" : 3, "biases" : [ -0.490600074475542 ], "cols" : 1, "rows" : 2, "weights" : [ [ -3.115116035462417 ], [ -3.969281643687132 ] ] } ] } The key-value nesting is quite powerful for this type of open structure... > On 7 Sep 2021, at 15:51, Christof Ressi wrote: > > Can you give an example of how the data is structured? > > In which ways are users supposed to interact with the data? > > Christof > > On 07.09.2021 16:37, Pierre Alexandre Tremblay wrote: >> Dear all >> >> I am trying to find the most Pd-vanilla-way to interface with our Dataset >> object in the FluCoMa project. In Max and SuperCollider we use Dictionaries, >> which are nestable and queryable in powerful programmatic ways, working >> essentially like interfaces to JSON-like data structures. >> >> I’ve looked at [struct] but the [set] object does not allow to do symbols >> and (list of) floats, and [appends] seem to have the same limitations. In >> all cases, I’m not certain it is the best approach in any cases to create >> such a list in Pd... >> >> I wonder how people do it and if I am missing an obvious workflow, >> especially with nested structures. >> >> Any pointer (pun intended) welcome >> >> p >> >> >> >> >> >> ___ >> Pd-list@lists.iem.at mailing list >> UNSUBSCRIBE and account-management -> >> https://lists.puredata.info/listinfo/pd-list > > > > ___ > Pd-list@lists.iem.at mailing list > UNSUBSCRIBE and account-management -> > https://lists.puredata.info/listinfo/pd-list ___ Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list
Re: [PD] Nestable Dictionaries in Pd
Can you give an example of how the data is structured? In which ways are users supposed to interact with the data? Christof On 07.09.2021 16:37, Pierre Alexandre Tremblay wrote: Dear all I am trying to find the most Pd-vanilla-way to interface with our Dataset object in the FluCoMa project. In Max and SuperCollider we use Dictionaries, which are nestable and queryable in powerful programmatic ways, working essentially like interfaces to JSON-like data structures. I’ve looked at [struct] but the [set] object does not allow to do symbols and (list of) floats, and [appends] seem to have the same limitations. In all cases, I’m not certain it is the best approach in any cases to create such a list in Pd... I wonder how people do it and if I am missing an obvious workflow, especially with nested structures. Any pointer (pun intended) welcome p ___ Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list ___ Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list
[PD] Nestable Dictionaries in Pd
Dear all I am trying to find the most Pd-vanilla-way to interface with our Dataset object in the FluCoMa project. In Max and SuperCollider we use Dictionaries, which are nestable and queryable in powerful programmatic ways, working essentially like interfaces to JSON-like data structures. I’ve looked at [struct] but the [set] object does not allow to do symbols and (list of) floats, and [appends] seem to have the same limitations. In all cases, I’m not certain it is the best approach in any cases to create such a list in Pd... I wonder how people do it and if I am missing an obvious workflow, especially with nested structures. Any pointer (pun intended) welcome p ___ Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list