Refer to the index of a table DAT?

Hello! I’m trying to find my way around the table DAT operator – I’m thinking that it would be great to refer to the index value, but I don’t see a way to ‘convert’ it to the right format. As an example, I’m trying to use the index value as the seed of a noise, but when I convert it to an integer:

str(int(op('table1')[me.digits, 'path']))

I get the error:

invalid literal for int() with base 10: 'None'

There’s probably multiple things I’m not understanding here, so I’d appreciate any pointers or explanations. (I’ve enclosed a file).

refer to table index.toe (3.6 KB)

Can I ask what you are trying to achieve?
Based on what you have attached I would simply put me.digits in the Seed field

a quick example attached:
on the left seeds coming from the cell values that appear table1 (not the index, the value typed in), on the right noise3 with me.digits in the Seed field as per my suggestion above

I hope this helps!
refer to table index MOD.toe (3.4 KB)

as @FaustoB mentioned, there really isn’t much benefit to this unless you really needed an exact seed from the table value, but your specific problem here has to do with unnecessary type casting. The evaluated value is already a string, but gets interpreted as an int for you automatically in the evaluation. Forcing it back to a string breaks your expression, as the seed is meant to be an int, not a str. As you can see from this screenshot, none of this type forcing is necessary to get the results you want

Hm… yes, that works just as well. Thank you!

My thinking was that I would use the table to generate variations on a noise CHOP, and that I could create that variation by using the row index as the seed. But I suppose I can pretty easily just add a column with numbers that I can use as a seed.

But I was thinking – since there’s already an index, that seemed like a pretty handy source of numbers that would not repeat.

Hey @subset

equally the digits of operators with the same string base name cannot repeat. If your noises are named differently like “myNoise1” and “myOtherNoise1” but you still require a unique seed for all of them, you could make use of the node id: - just be aware that an operators unique id is not consitent over closing and opening a file.


1 Like

That would work too! Thank you @snaut !