probably very easy but i just cant get it right. i have a kick going from 0 to 1. whenever the value is 1, i want other specific values (e.g. 0, 1, 3, 9, 13) to be randomly triggered. how do i do that?
hey @arshalouys welcome to the forum!
I have attached a little example of how I would approach this.
Specific Value.toe (6.0 KB)
The kick value increments a count CHOP.
The count CHOP loops between a min (zero) and a max (the number of rows in the table).
The table DAT contains your specific values, and the select DAT selects a specific row.
The row index in the select DAT is set by the counter CHOP looping between zero and the amount or rows in the table.
If you add rows to the table to add new specific numbers, or if you cut rows from the the table, the counter loop min/max will update automatically; just make sure you use the “set size” option in the table. Blank values in the table will trigger blank values.
that’s what i was looking for, thank you!
now out of curiosity… how can i randomly select the values in the table DAT?
I missed that in your original request.
as usual there are a few ways to resolve the same thing in TD. I would use a line of python that generates a random index within a range.
I have attached an example that uses a chop execute (instead of a “linear” counter CHOP) and a little bit of python to generate a random index for the select DAT.
Specific Value Random.toe (6.2 KB)
Just so you know, usually it’s better to share your tests and show your attempts to resolve the problem instead of just asking for a solution here in the forum.
PS: to understand what is going in the file I’ve attached I’d recommend to look into the script inside the chopexec1, and also familiarise with:
. chop execute DAT
. python randint (random integer)
. python random seed
oh i see, will do that! thanks a lot for the tips and examples!