Switch from constant to expression - amplitude parameter

Looking to switch from constant mode(grey box) to expression mode(blue box) on the amp par on my noise. I’d like to have this as customised component on the Base. I’ll be trigging it via OSCIN from VCV rack. Thanks

The Python code to change modes looks like this:

op(‘noise1’).par.amp.mode = ParMode.EXPRESSION
op(‘noise1’).par.amp.mode = ParMode.CONSTANT

If you’re trying to switch automatically when another par switches modes, you have to use a parexecDAT. It has an onModeChange callback. There is no automatic way to link the mode of two parameters.

Thanks @Ivan, yea I’m just needing to switch from one state to the other. Think of it like the expression needs be off during the “intro” of the scene and then turned on and allow the CHOP info to drive the par.

How do I set this up if the expression mode already has a expression? I understand these:

op(‘noise1’).par.amp.mode = ParMode.EXPRESSION
op(‘noise1’).par.amp.mode = ParMode.CONSTANT

But where do I assign these to on the noise OP I want to change modes on, is it one of the other modes fields?

If it is, can I have two toggles on a custom competent of the base and switch modes through that?

Those Python functions set the mode, so you’d put them in an exec DAT script of some kind. For example, if you want to control the mode with a toggle parameter, you’d put them in a parexecDAT set to watch the value of that parameter (onValueChange callback). If you want them locked to the mode of another parameter, you’d put them in a parexecDAT set to watch the mode of that parameter (onModeChange callback). If you’re wanting to change mode in reaction to something else, I’ll need more info as to what.

Also, if a par has an expression in it, you can switch back and forth between modes and the expression will stay. To set the expression:

op(‘noise1’).par.amp.expr = “bladebladebla”

1 Like

@Ivan thanks, that got it sorted

1 Like