I’m having something that I think is a simple problem, but I can’t figure out how to get it to work.
I have chop A with 5 samples, all the value of 0.
Then I have a constant that can have the values 0-4. Whenever the value of the constant changes, I want the sample of A that corresponds to the value, to be set to 1.
So for instance, chop A is 0, 0, 0, 0, 0
When the constant changes to ‘2’, chop A becomes 0, 0, 1, 0, 0
Then when the constant changes to ‘4’, chop A becomes 0, 0, 1, 0, 1.
Some CHOPs such as the Pattern CHOP have a ‘sampleIndex’ and ‘chanIndex’ member available that are often useful for this sort of thing. Something along the lines of this could be used…
1 if me.sampleIndex == op('constant_val')['val'] else 0