Structure Processor

Towards a processor equivalent of the iterator renderer. A structure pipe + grep. A hint of what spreads could do. Take your metaphor of choice!

A macro patch that takes in a structure and then passes each structure member to its subpatches and outputs the modified structure. Would need an 'iterator variables' equivalent to handle the feeding in and out of the subpatch, and the subpatch would need to know the key or index of the structure item its currently processing.

Lets say I have a structure of images and positioning metadata. With this, I could add a filter to those images and leave the metadata alone.

Or a bunch of 3D geometry, GL lines etc, now you can manipulate each coordinate.

For me, this is a wall I've hit as its beyond the scope of the official api.

Toby

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

cwright's picture
interesting!

I've been thinking about some stuff like this (basically, mid-graph loops for sets of data). The problem currently with this is that the Iterator patch is red, so it can't be used as such. a non-red iterator, however, would probably do the trick for this, wouldn't it?

tobyspark's picture
yep... a green iterator

structure in -> iterate through each structure element doing whatever you please -> structure out.

toneburst's picture
I'll

second that...

alx

Quartz Composer Blog: http://machinesdontcare.wordpress.com

Music Site: http://www.toneburst.net

toneburst's picture
Having said that..

wouldn't it be possible to this kind of thing with JavaScript? Admittedly, this would require a lot of coding, mind...

alx

Quartz Composer Blog: http://machinesdontcare.wordpress.com

Music Site: http://www.toneburst.net

yanomano's picture
Should this work ?

I have tried to iterate maths... it seems to work with a spooky patch loop inside an iterator... However the structure assembly need to be improve a lot ! I don't think that a lot of spooky channels would be very efficient but it is just a way to explore...:)

PreviewAttachmentSize
Inside_Iterator.png
Inside_Iterator.png121.82 KB
Math_Iteration_test01.qtz15.54 KB
Root.png
Root.png98.54 KB

psonice's picture
Queue to rebuild structure?

I've not got spooky send installed here (or time to test it really), but do you not need to rebuild the structure with a queue patch (or structure tools)?

franz's picture
+ 1

and more generally, an enhanced version of the structure tools, that's in the air for quite a long time now ( i guess)

cwright's picture
have in mind

What kinds of stuff would y'all like to see in an enhanced structure tools patch?

tobyspark's picture
shopping list off the top of my head and plea for 'streams'

  • structure maker as is, but could you make the physical patch more compact? - rename output from 'output structure' to just 'structure' - a settings pane tickbox to expose or not the 'skip empty inputs' input. i loved the boinx structure add patch for being so compact, be nice to be able to declutter structure maker to this level for simple one-object adds.
  • structure processor as in this thread
  • structure from streams mangles a structure of x coords (ie from queue node or similar), a structure of y coords, etc into a structure of x,y,z,x,y,z. yes, i'm thinking gltools here.

    as a general statement, maybe it is time to implement single dimension c-arrays as a data type that can be passed between kineme structure tools and kineme gl tools? we could call the data type 'stream', and i think it would really clarify whats going on when we're trying to patch this kind of world together. structures are for structured information, streams are for streams of the same data type, typically coordinates.

    ...and we probably shouldn't call them spreads, as a) streams is more accurate for our purposes here, and b) the might of spreads lies more with the concept of vvvv nodes being spreadable by design (ie they iterate themselves correctly and efficiently) rather than just having the plain data-type.

  • tobyspark's picture
    just to clarify coordinates as streams

    would be a single dimension plain c array (ie as fast as a computer can go), with the x,y,z coordinate information encoded as... x,y,z,x,y,z,...,x,y,z. or r,g,b,a...r,g,b,a or etc.

    yoki's picture
    +1

    that would come in handy when handling serial streams from the arduino as well!

    yanomano's picture
    Structure tools

    • possibility to pass the structure thru 2D/3D/4Dnoise...

    • Structure manager : to edit vertex on the fly, with basic ACCII import/export. ( a patch with a table as a custom interface to display : index and vectors )

    •Structure blend : input 2 structures with same lenght and same array number and apply blend mode (mix, add, divide, multiply,max, min..etc) then output result.

    •"Convert to object" "patch : to plug structures to Kineme 3D Object render...in this case the structure could fly thru the existing Kineme 3D Patches...:)

    •1D structure generator : generate an array with custom lenght (with decrease, increase, sin, cos Arrays ) and minimum/maximum amplitude.

    franz's picture
    ha!

    any tool that can remove nan. entries will do. (or any specific entry) then any possibility to merge, sort, find, reorder, multiply, divide, duplicate... would be a great improvement anyway. and some pizza

    cwright's picture
    status

    Ok, huge turn out for this one I guess ;P

    I've smallified the structure maker (working on finishing touches for removing the skip empty inputs port via checkbox). Next up, I think I can make the 1D structure maker pretty simply, as well as the structure merger. Noising is also easy, except for strange types (string noise? image noise? those could work, but are expensive, so I'll probably skip them for now) -- 1D noise only I suppose.

    blend should be renamed "structure operation" or "structure op", because it's doing a set of operations between structures. not too difficult, though again we hit the "strange type" problem mentioned above.

    I feel like the green iterator, combined with a few of the above, would make solving many issues possible.

    streams suffer from the typical problem of having no built-in support. The muxing idea wouldn't be difficult, but I wonder if it's too specific (a more general "raw data" abstraction could be handy, but I don't know what that abstraction is yet... not given it much thought) -- this is slightly dangerous territory because introducing half-way solutions (like the last GLTools "spreads") isn't a real full solution, so it's bound to get passed up. That's a lot of extra work to recode everything using the half-way method.

    and pizza. I think that would solve basically all the problems we're facing ;)

    yanomano's picture
    float truncate

    Do tou think that a "structure float array truncate" patch could optimize arrays flow ? (something like the string truncate but to truncate floats after the comma)

    cwright's picture
    harm

    floats are a fixed size (32bits), so passing them around with or without a fractional part doesn't affect their memory foot print. Coincidentally, integers are also 32bits, so no memory is saved by converting floats to ints.

    Converting floats to ints takes a few instructions per item (a nanosecond or so), truncating them takes a few more instruction (still only a nanosecond or so), but leaving them alone takes no time :)

    They'd flow just the same either way, but the extra processing would actually slow things down (probably imperceptibly though, unless the arrays were gigantic)

    yanomano's picture
    good to know ;)

    so floating point precision is not "a luxe " ;) especially when 2D coordinates are from 0.0 to 1.0 !

    franz's picture
    thxx / del function ?

    thanks, this is really appreciated. I'm also personally crossing the need of a way to remove one specific entry from the structure (or even a whole substructure), so a delete feature of any fashion is super+