Using Python to set the value of an Input channel of a CHOP


Is there any way on a CHOP to set the input channel value using a Python instruction?

Something like op("trigger1").input["chan1"] = 1

I am not looking for a way to set the channel value of the CHOP itself, but on its input.

I am not looking for a solution that involves using a Constant CHOP in front of the CHOP, nor a Python Script CHOP, nor a DAT.

I want to use the CHOP without connecting anything in its input in the network, and directly specify the value in python in the textport with one line command like op("trigger1").input["chan1"] = 1

I have that need for a Trigger CHOP, to give an example, or any other CHOP that has as an input a channel.


Hi @sdtouchdd,

there is no way to do this. If a CHOP requires an input for processing, it will have to be supplied as a CHOP channel/value.

Generally there is the difference between the Generator and Filter type CHOPs where generators will generate data while filters will require an input. The Trigger CHOP and some others are an exception here being able to generate data and act as a filter - specifically without an input, the envelope can be triggered using the Trigger parameter.


Thanks for confirming.

I could use the Trigger CHOP if there was 2 pulse functions, one to start the envelope, and one to stop it.


But only having the start (triggerpulse.pulse()) is insufficient for my current need.


Hi @sdtouchdd,

could you describe the use case? There might be a way to do this outputting the whole envelope and using a Lookup CHOP.


Just to be able to start and stop the envelope using Python.

With the minimum amount of Nodes and python code.

And it seems the minimum number of nodes is 2, a constant + trigger.

Or a trigger with a lookup probably, but it’s still 2 nodes.

I’m trying to simplify the node count for ease of development iterations

Hi @sdtouchdd,

thinking about it. You could make use of the Event CHOP. It has the same parameters relevant for an ADSR minus the interpolation options but features to trigger

op('event1').createEvent(hold=False, samples=[], index=0, attackTime, attackLevel, decayTime, sustainTime, sustainMin, sustainMax, releaseTime, releaseLevel, speed)

and release an event:

# id is optional, if not specified, all events will be released


Didn’t know about that CHOP, that could simplify my network, thanks.

@sdtouchdd Moved this thread to General, please reserve Techniques category for completed techniques and workflows, not questions.