Confused by Dat Exporting

I am looking at someone elses .tox file and trying to learn from it. I came across many uses of this technique, which i don’t really understand why? To be clear, I think understand what is occurring, just don’t understand why do this over a dragging python reference.

Hiting the Base parameter ‘record’ sends a 0 or 1 to the switch1 index.

Also the

That’s just what happens if you click “export” instead of “reference” when you drag-drop a CHOP channel onto a par. It used to be that exports were more efficient than using python references…

But these days, with TD’s relatively new optimized / caching python implementation, the performance difference is now negligible and most people use references instead of exports in newer projects.

If you’re looking through older projects you might see lots of exports like that. My old projects still have a lot of exporting. There’s nothing wrong with exports when they’re working, but I would occasionally run into bugs when trying to undo or delete exports, and I always disliked the extra attached DATs that would be created.

Be aware, there is ALSO another method of exporting called DAT exporting (mentioned in the subject of your post) that is actually NOT what you posted a screenshot of. DAT exporting is when you have a DAT export it’s own cells to pars instead of a CHOP exporting channels to pars. Both methods use a DAT to store the info about where the export should go to, but where the data comes from is different in each case.

The key is to look at which op has it’s export flag turned on (in your case, the CHOP does - it’s the little dot at the bottom of the CHOP. If it were a DAT export, the DAT would probably not be attached to the CHOP and it would have it’s little circle lit up. Also the format of the data inside the DAT would be different: DAT Export - Derivative

1 Like

Thanks Peeet. This thorough response really helps me understand the differences I was noticing in the Dat Export that you linked to, but couldnt find further info on it.

Glad I could help. Long story short: using python expression references are fine for the vast majority of situations these days, except maybe if you’re exposing parameters of ops to custom parameters of a parent component (then use bind).

The one annoying caveat: the default expression that gets filled in when you drag and drop from a CHOP is the channel NAME (ie op('null1')['chan1'] ) whereas in the good ol’ days of CHOP exporting, it would dictate the channel by index number (ie op('null1')[0] ).

The number of times I’ve gone back and changed a 'chan1' or a 'v1' to 0 (or forgotten to and regretted it) is very high.

2 Likes

@Peeet Interesting take on preferring index over channel name. We’ve been having some good debates about which is safer when building large systems, because index can change in many situations automatically when you add or subtract channels, whereas with named channels you need to actually manually change a name, unless of course merging channels of the same name. Both have pros and cons, but I’d like to hear a deep-dive on your take and why index is your preference.

1 Like