softSet:
Filter:
Reference | JITLib > GUI

softSet

set a proxy param value conditionally

Description

softSet is an extension method to NodeProxy and Ndef that sets a nodeproxy param value only in two conditions:

Typical uses would be switching to a preset, then using a faderbox, and avoiding sudden controller jumps that could occur (soft takeover).

softSet(param, val, within = 0.025, mapped=false, lastVal, spec)

Arguments:

param

the name of the parameter to set

val

the value to set the param to (can be mapped or unmapped)

within

the normalized range within which the set is accepted - default is 0.025

lastVal

the previous value that a control has set - see last examples.

mapped

a flag whether val is mapped (within the range of param.asSpec) or unmapped (0.0-1.0)

spec

a ControlSpec can be passed in. if nil, param.asSpec is used.

NOTE: if no spec is given, softSet simply allows setting.

Examples