Preset Questions

Hi Guys,

I have a couple of questions maybe someone can help me with:

  1. Is there a way that a plugin can tell that a preset/snapshot has been changed/loaded in Mod-UI? I need to reset some data when this occurs.

  2. How do we package up presets with the plugin, so when it is installed the factory presets are there?



1 Like

no, this is strictly not something that LV2 provides. An LV2 preset is literally the same as a saved LV2 host state.
if there is something internal that you need to change when a preset changes, your plugin is considered broken.

You can ship the preset files as part of the plugin bundle, and refer to them in the manifest.ttl.
They will appear in mod-ui as “factory” presets.



So how would you go about resetting the phase of LFOs when a preset changes, is there a trick when using LV2s?

1 Like

Thinking aloud, you could just define a state and any time that state gets loaded reset (because it will only be from a preset). Or you could have a port marked with the trigger property. Have the presets set it to 1 to trigger the reset. The port will automatically go back to 0 on the next call to run. This does allow the user to manually reset the phase, which may or may not be desirable. The state method would not be available to the user.

1 Like

Hi @ssj71

Thanks, I already have a reset phase trigger. This would work for factory presets but is always written as 0 for user presets saved :frowning:

I also have a Preset ID value with I have set to lv2:notOnGUI I am having difficulty getting this saved into a user preset as well, is there actually a way of setting a parameter value in the host from the plugin?

1 Like

Good question…

In theory you could have a non-host readable property (using lv2 state extension) that you get notified via same state extension when the state has been restored.

Not sure if a hidden trigger port would work, never tried.
Might be the easiest path, if it works. You can request control input port changes from the plugin with the custom LV2-Extensions/control-input-port-change-request.h at master · KXStudio/LV2-Extensions · GitHub extension, which mod-host supports.


Thanks, I’ll have a look at that…