How to reference DAT data in a TOP?

I have a movieFileIn top, and I want to reference data from a DAT operator so that I can change which movie file it loads. I have multiple movie files to load, and having them all active at the same time lags out my pc majorly.

image

I would reference from switch2 (or a null) and adjust the index value of the switch to choose different files.

Hi @Spronkel,

you can reference DAT Cells in parameters with a python expression like op('switch2')[0,0]

We have a nice introductory video series on the learn.derivative.ca page and especially a lesson on “References and Binding Parameters” which could help understanding the whole concept:

More specific info on the operator’s python members and methods can also be found on the OP Class Pages:

Hope this helps
Cheers
Markus

Drag any dat into another op’s parameter and you are given a partial python statement to finish

op(‘table1’)

if the dat is simple text, or the entirety of the dats cells are to by used in the parameter, you can finish it like

op(‘table1’).text

if you want to specify a cell, you can go [row, column]

op(‘table1’)[0,0]

A chop value can replace the row and or column value in the above statement to make picking dynamically from a complex table easier.

op(‘table1’)[int((op(‘yourchopname’)[‘yourchannelname’])),1]

Here is an example tox file for you.
Movie_Selection_Simple.tox (3.0 KB)