falkTX / Carla

Audio plugin host
https://kx.studio/carla
1.63k stars 147 forks source link

Support for LV2 presets #71

Open timowest opened 11 years ago

timowest commented 11 years ago

Support for LV2 presets would be great.

falkTX commented 11 years ago

Carla already supports LV2 preset loading, just not save. When you have a LV2 plugin loaded, open the info/edit dialog and press the "load state" button. That will give you a list of presets, select one and click ok.

Supporting saving LV2 presets might come later.

timowest commented 11 years ago

Great. I tried it, but got the following error

ERROR: carla_set_midi_program(0, -1) - midiProgramId out of bounds
ssj71 commented 8 years ago

I also hit this bug tonight (same error, no change in plugin settings). I think I've loaded presets before with other lv2 plugins, so not sure what makes the difference. Let me know if you need any more feedback.

SpotlightKid commented 6 years ago

Loading LV2 presets is currently broken due to a failing assert in CarlaPluginLV2.cpp, line 1230:

Carla assertion failure: "sendGui || sendOsc || sendCallback" in file ../backend/plugin/CarlaPluginLV2.cpp, line 1230

The assert was introduced in this commit: 7de5812912bc3438e88502c2a43eb4fb6855d64f

The call causing the assert to fail seems to be this one in CarlaEngineBridge, line 738:

plugin->setProgram(index, false, false, false);

If I comment out the assert and recompile, LV2 preset loading works, but I don't know if removing the assert has any adverse effects.

There's another assert failing when loading a MIDI program in CarlaPluginLV2.cpp on line 1267 and there are probably more similar cases.

falkTX commented 6 years ago

The asserts are there on purpose, after cleanup of the code I split the RT and non-RT calls that changed plugin state. If there is a call to change programs without callback, osc or gui send flag active, then likely it comes from a RT context and must be avoided. I am investigating this now...

falkTX commented 6 years ago

presets (on plugin bridges) work once again.

SpotlightKid commented 6 years ago

Great. I can confirm it.

SpotlightKid commented 5 years ago

I got fed up waiting for Carla to get support for saving LV2 presets, so I wrote a Carla project file to LV2 preset bundles converter:

https://github.com/SpotlightKid/jack-audio-tools/tree/master/carla

This probably breaks with plugins, which save unusual atom types in their state, but for many plugins using only control ports or states with basic atom types this should work well.

alex-tee commented 2 years ago

just adding a related note as discussed on IRC: on the host API side a carla_save_native_plugin_state() would be appropriate for saving native plugin states instead of carla presets