Is there a faster way to perform math functions on an entire table (for example multiply each cell by 2) instead of doing for loops in python and multiply each cell?
I have a chop execute, and it takes some 60ms to execute this script which seems a bit high?
Another option is to convert it to a CHOP (datto CHOP), do the math, and convert it back to a DAT (if you still need it as a DAT, otherwise keeping it in a CHOP is faster).
Math is much quicker in CHOPs (native floating point numbers) then DATs (strings that are converted) in general.
The above is from the Chop Execute OP… I think it would perform the same as an evaluate Op? however I can throttle how often it runs the script based on the off to on value in the CHOP it is checking. I would imagine an evaluate CHOP would run at the same efficiency, but would constantly try to run the script.
Rob -
The DAT table is being used to control the RBG of about 450 instances of a circle. The tx ty tz is a grid of 30 x 15 (450 points), and the rgb is this table. In this particular application, would it be better to have a whole bunch of chop channels? 450 x 3 would be some 1350 individual numbers that would be between 0 … 1…
Ah OK, yeah with that many values you’d be much better off doing it all in CHOPs if possible. I’ve only ever used the evaluate DAT with relatively small tables where I need text as well as numbers. As Rob says, floating point maths is much faster in CHOPs.
In my experience CHOP math is always faster. You can also drive your instances with a CHOP instead of a DAT - which is also faster performing in general.
Rather than 450 x 3 chop channels ( 1350 ), I’d think of 3 channels with 450 samples each.
A bit of both… what I am working with right now is individual control of each instance/sample.
However I am thinking I will want to make a couple different configurations and be able to fade between patterns that manipulate individual samples, and others that would be more pattern based.
For direct control, you’re probably best suited to place all of the initial data in a table DAT and then convert to CHOPs. If you always have the same number of channels, you could use a cross CHOP to blend between different states. Otherwise you might use a switch CHOP
The Evaluate DAT now has a Scope page, so you can affect a sub-set of cells with the expression. This is just a side-note in case you missed it last month.
I like including an index with my instances because it makes texture instancing easier - if, in the future, you want to apply textures to your instances, this can be handy to have baked into your chop channels. I can also be useful if you’re trying to track down a particular sample.
It should still function just as well without the index channel, I just find it useful personally.
i’m trying to pick a specific xy coordinate in my grid of hex’s and only illuminate a specific one based on that xy coordinate (converting the xy to a single index number). ultimately creating some animation of light moving around the grid of hexes… GRID_CHOP.toe (6.2 KB)