I’m looking to assign some JSON parsed data, to run a simple animation, as cubes on a grid, rising and falling based on the data values.
I have parsed the data, but not sure how to assign the data into proper CHOPs, to then use for instancing.
Can you point me to some tutorials where I can get further info?
All the existing tutorials I have seen from Matthew or others are either just directly CHOPs, or text DATs and replicators.
I can also post my working file here if you can give me some of your time.
Thanks very much.
Matthew here. If you post an example of where you are I’d be happy to give you a nudge.
As a heads up, DATs are the least efficient approach for instancing (at least in my experience) since they’re treated as strings and have to be cast as their appropriate types. This can be very reasonable if you’re only updating intermittently, but might become a bottleneck suddenly.
thanks for getting back. It might be that instancing is not the way to go in this instance!
I will be happy to hear your thoughts on that.
at the moment, I’m not updating, but this might change as I will apply the data directly from the API soon. Would be great to learn the most optimized approach(es).
Idea is to run each asset(1000), on a cube where the height of the cube is the energy and this value will be affected by the power value, at every occurrence of a sampling event (which is not a fixed number, between 28 and 32 samples I believe). the samples have timestamps next to them.
p.s. I am not sure if the JSON file is cooked into the patch or needs to be uploaded.
JSON_TO_CUBES.toe (493 KB)
Just saw this. I’m traveling today and at a show this evening. So it might be tomorrow before I can really dig in - I’ll post some thoughts once I can look at this.
Okay here you’ll find some examples of working with instances in DATs. Initial big picture ideas to hold onto are that your column headers are how you match values from a DAT to an instance.
The first couple of examples show how you can drive instances from a DAT, then there’s a look at how you can manipulate those / update those values directly in a table. Following are some exploratory ideas about other ways to drive your instances with updating json data. Everything from putting in a point attribute to pulling it from storage with a script CHOP.
900 instances still runs smoothly for me on a little ultra-book’s processor on battery power, but your mileage will vary. My general advice is to imagine that you need to reserve at least 20% of your project time for optimization. If you’re doing something for you, or for a lower-stakes situation you can likely skip this. If, this is client work or something that’s mission critical for success, I would make sure you reserved more time than you expect for optimization and edge case handling - what happens when you get a json blob with no data, or if the keys have changed; what are your upper and lower limits for data throughput, if your maxing out, do you need to break this into another touch process and how do you want to handle the data exchange; and so so many other considerations.
I’m going to look at your project specifically next, but I wanted to make sure that you had some solid examples that weren’t domain specific so you could explore the concepts.
dat-instancing.toe (24.6 KB)
Thanks very much, Matthew.
I’m still exploring the different approaches.
It is very helpful the way you have put the information together in various stages.
I made sure to update the examples in the instancing repo with these as well - makes me think there should be an updated series about instancing
github.com/raganmd/touchdesigne … g_examples