kmatheussen / radium

A graphical music editor. A next generation tracker.
http://users.notam02.no/~kjetism/radium/
GNU General Public License v2.0
835 stars 36 forks source link

LV2 support #1382

Closed akimaze closed 4 months ago

akimaze commented 2 years ago

JUCE has released a technology preview of version 7 which adds LV2 support. This would be a nice feature for Radium 7. See juce7 branch for example: https://github.com/juce-framework/JUCE/commit/1182024fc496f5c876968740e0d98747326103bc

More info: https://forum.juce.com/t/juce7-technical-preview-branch/50866

kmatheussen commented 2 years ago

Thanks for the tip. I read that VST3 support might work better in that branch as well. Anyway, I've made a "juce7" branch for Radium now, which includes the "juce7" branch of JUCE. I haven't tried to load lv2 plugins yet (requires some programming), but I'll give it a shot.

kmatheussen commented 2 years ago

Also, the "AudioPluginHost" example program included with JUCE is already able to run LV2 plugins (at least zynaddsubfx), so I guess it should work.

kmatheussen commented 2 years ago

Seems to work fine: lv2radium

kmatheussen commented 2 years ago

You can try the juce7 branch now. It seems to work for me at least...

akimaze commented 2 years ago

It also works for me, although plugins that use GTK (eg Calf plugins) do not display the original GUI. I don't know if it's a JUCE problem or the lack of some libraries.

kmatheussen commented 2 years ago

I don't see a native GUI for the Calf plugins in the Juce audio plugin host program either, meaning that it's probably not a bug in Radium, so I guess it might be a good idea to create a ticket on the JUCE repo, or ask on the juce7 thread on the forum.

akimaze commented 1 year ago

I just wanted to notice that stable 7.0.1 version of JUCE was released so the juce7 branch can be updated/merged :) Then we can also check Calf plugins again.

akimaze commented 1 year ago

@kmatheussen JUCE 7.0.2 have been released and I think they probably fix the threading issue we have in preset browser with setComponentState() (I have to add std::this_thread::sleep_for(std::chrono::milliseconds(50));) .

akimaze commented 1 year ago

I compiled last version (commit https://github.com/kmatheussen/radium/commit/5367057694abb2f25a47dab9dc7591e3424ab982) and:

akimaze commented 1 year ago

I tried to save a few Surge XT LV2 presets and check if they behave the same like VST3 and it turns out that the LV2 plugin also needs this 50 millisecond sleep to play note after PLUGIN_recreate_from_state(). So this is not VST3 support bug in JUCE. Maybe it's Surge XT bug (and some other plugins) or something in Radium.

kmatheussen commented 1 year ago

I did go through the plugin-initialization code of Radium, but I couldn't see anything wrong that would cause this. But in any case, it's not unlikely that there are plugins that won't play a note immediately after being created, for various reasons, so it's probably best to keep the sleep anywan.

kmatheussen commented 1 year ago

Perhaps you can try to change the value of 'g_use_custom_mm_thread' from true to false. Earlier it hasn't worked to run the JUCE message thread in the main thread on Linux, but with JUCE 7.0.2 this now seems to work, as far as I can see. (it's much better running the message thread in a separate thread though, but if it works, we are closer to know why we need to sleep 50ms)

On Sun, Sep 25, 2022 at 10:31 AM Kjetil Matheussen @.***> wrote:

I did go through the plugin-initialization code of Radium, but I couldn't see anything wrong that would cause this. But in any case, it's not unlikely that there are plugins that won't play a note immediately after being created, for various reasons, so it's probably best to keep the sleep anywan.

fentras commented 1 year ago

Is LV2 support present in Demo version? I can't seem to load Calf plugins that are installed on my system under lib64. I can easily use them in other loaders like Carla.

Screenshot_20230209_132740

mxmilkiib commented 1 year ago

Calf uses a GTK which is highly unadvised when making plugins exactly because of the problem mentioned.

https://github.com/calf-studio-gear/calf/issues/248#issuecomment-1205213409

https://github.com/lv2/lv2/wiki#avoid-gui-frameworks

kmatheussen commented 1 year ago

Sorry @fentras I must have overlooked your question. The answer is yes though, LV2 should work in the demo. I don't know why the calf plugin don't load. Could be a GTK thing, but I don't know much about LV2.

kmatheussen commented 5 months ago

Closing this as LV2 has been supported for a while.