I have seen references to a Tscript “chopf” function which took the form
chopf( “a channel name”, a frame number )
My rough understanding is that this would be able to assign a different value to a different point, based, for instance, on the frame. (So that, using a variable, each point could have a different vale).
My question would be twofold. A. What is the Python equivalent and B. how could it be used to create a sort of iterator in a line (if that is what it is made to do).
To access a channel at any arbitrary index, simply use the index operators:
value = op('wave1')['chan1'][50]
or similarly, use the eval function to evaluate it at a specific frame:
value = op('wave1')['chan1'].eval(51)
(This gives the same value when the first sample of the channel lies at frame 1, and has the same sample rate as the timeline, which is usually the case).
For part B) of your question, it really depends on where the expression lives.
If it lives in Point SOP, Position tx for example:
op('noise')['chan1'][me.inputPoint.index]
The iterator is the index of the current point being modified.
This will set each tx to one sample of the default noise CHOP channel. (see attached toe file)