Generating a value and popping it out from a node, using python?

Hi there,

I’d like to use a python script to generates raw sample and to pop them out from a node. My question is probably too much global.

Let’s say, at first, I’d like to generates a value (or a channel) by using Python. I do something, like I monitor a channel, I do some logic for testing samples of this channel, if a sample matches a condition, I execute the script within a CHOP Execute DAT. And I want this script, for instance, to pop out the samples generated from a CHOP node output.

Here in my example, a button generating random numbers.
Of course, here, “only” a print. I miss how to “write” values for the constant1 there.

Is it a way to go ?

This is also related to this one

For simple cases you can set the value parameter of a Constant CHOP via Python script.
For an example see Help->Operator Snippets, go the Constant CHOP, check the example named “scripting” (also useful to see “snapshot” and “offset” examples).

For more advanced cases you can use the Script CHOP (check Operator snippets for examples)

1 Like

Thanks a lot. I got it.
If the Constant CHOP way is a nice practice, I’ll go that way. It is nice because it is also a way for displaying values and debugging.