Presets and randomizers
Presets and randomizers let a plugin offer useful starting points while keeping parameter ownership in the Yrendr host.
Define presets
Pass a mapping of display labels to parameter dictionaries during registration:
presets={
"Neutral": {"strength": 0.0},
"Strong": {"strength": 0.8},
}Use only declared parameter keys and JSON-compatible values.
Add a randomizer
Provide randomizer= with a function that receives the current parameter dictionary and returns a new dictionary:
def randomize(values):
return {**values, "strength": 0.5}Design guidelines
- Keep preset names short and descriptive.
- Return only parameter values the processor can accept.
- Keep randomization within declared parameter constraints.
- Preserve unrelated values when the randomizer changes only part of the state.
- Make repeated randomization safe for preview and project persistence.
Note: Presets and randomizers change parameter data. They do not bypass the normal host-owned processing, persistence or validation model.