How do I sequentially read from a table DAT

Let’s say I have a table that contains one row with several numbers representing the size of something over time, e.g.

0.5 0.6 0.7 0.8 0.9

And let’s say I have a rectangle Top whose size parameters (width, height) were set to read from the table:

sizex: op(‘table1’)[0,0]
sizey: op(‘table1’)[0,0]

What I’d like to do, is, for instance, to make the table index advance in time, e.g.something like:

op(‘table1’)[0,int(absTime.seconds)]

… but that doesn’t work (and I don’t know python well enough to know what the correct syntax would be.)

How do I do that?

Thanks!

here’s an example.
Some tips:

  • first row, then column. So op(“table”)[2,1] is row 2 column 1
  • absTime.seconds is the total number of seconds TD has been running, so this could very well be a very large number, so it could be you’re trying to access a rownumber which does not exist in your table. I made an example using me.time.seconds, which has the timeline seconds, (by default 0-10)

read_from_table_using_python_expression.tox (646 Bytes)

1 Like

That makes sense! Thanks for that! Much appreciated!