Porting JUCE programs to DISTRHO/juce for LV2 support

Programming applications for making music on Linux.

Moderators: khz, MattKingUSA

User avatar
REIS0
Established Member
Posts: 8
Joined: Wed Oct 07, 2020 12:44 pm
Contact:

Re: Porting JUCE programs to DISTRHO/juce for LV2 support

Post by REIS0 »

I'm currently trying to port AnemoneChorus and LibreArp. My plan was to start the port for LibreArp but since it uses some "weird" stuff then I've decided to properly learn how to make ports using the AnemoneChorus.

Kott
Established Member
Posts: 321
Joined: Thu Mar 21, 2013 12:55 am
Location: Vladivostok

Re: Porting JUCE programs to DISTRHO/juce for LV2 support

Post by Kott »

I've build LibreArp LV2 version.
You may see the tricks to build it in spec https://build.opensuse.org/package/view ... c?expand=1

User avatar
REIS0
Established Member
Posts: 8
Joined: Wed Oct 07, 2020 12:44 pm
Contact:

Re: Porting JUCE programs to DISTRHO/juce for LV2 support

Post by REIS0 »

Oh that's nice, I'll be checking out

User avatar
REIS0
Established Member
Posts: 8
Joined: Wed Oct 07, 2020 12:44 pm
Contact:

Re: Porting JUCE programs to DISTRHO/juce for LV2 support

Post by REIS0 »

Another problem this time, after all going well I've hit another barrier that is making me quite confused. Basically all the compilation goes well except when calling generate-lv2-ttl.py, it gives this error

Code: Select all

Linking AnemoneChorus - LV2
python3 ../../generate-lv2-ttl.py build/AnemoneChorus.lv2/AnemoneChorus.so
Traceback (most recent call last):
  File "../../generate-lv2-ttl.py", line 25, in <module>
    dll.lv2_generate_ttl(ctypes.c_char_p(dll_basename.encode('utf-8')))
  File "/usr/lib/python3.8/ctypes/__init__.py", line 386, in __getattr__
    func = self.__getitem__(name)
  File "/usr/lib/python3.8/ctypes/__init__.py", line 391, in __getitem__
    func = self._FuncPtr((name_or_ordinal, self))
AttributeError: build/AnemoneChorus.lv2/AnemoneChorus.so: undefined symbol: lv2_generate_ttl
make: *** [../../LV2.mak:26: build/AnemoneChorus.lv2/AnemoneChorus.so] Error 1
At first I thought it was related to the files in the wrong directories, then tested installing lv2_ttl_generator in my system and still got this, after frying my head for days I still can't figure out what is going on.

Kott
Established Member
Posts: 321
Joined: Thu Mar 21, 2013 12:55 am
Location: Vladivostok

Re: Porting JUCE programs to DISTRHO/juce for LV2 support

Post by Kott »

Looks like build/AnemoneChorus.lv2/AnemoneChorus.so has not lv2 actually
Could you post here the steps of building?

User avatar
REIS0
Established Member
Posts: 8
Joined: Wed Oct 07, 2020 12:44 pm
Contact:

Re: Porting JUCE programs to DISTRHO/juce for LV2 support

Post by REIS0 »

  • Add the JUCE port as a submodule
  • Make and open Projucer and then add Linux make as one of the builds
  • Copy LV2.mak.in to the plugin folder (in this case there's the repo folder and folder for the plugin which has the juce lib code, builds etc) and add "include ../../LV2.mak" in makefile
  • Since the other problem related to building the vst2 version I've been using juce6 to build only the vst3 and using it as the source as stated before
  • Create the generate-lv2-ttl.py
  • Then run make
I've reviewed these steps quite few times, maybe I'm missing something? Personally I've never used JUCE to other thing beside this one so maybe there's some detail that I can't figure out.

Here's the full make output (there's some warnings probably related to this plugin using 5.3 or 5.4 version and the submodule is using juce6): https://pastebin.com/5idR6au3

Kott
Established Member
Posts: 321
Joined: Thu Mar 21, 2013 12:55 am
Location: Vladivostok

Re: Porting JUCE programs to DISTRHO/juce for LV2 support

Post by Kott »

Add the JUCE port as a submodule
Submodule? I guess you mean subdirectory in project's dir.

Maybe you have system-wide JUCE installed? In Ubuntu it is juce-modules-source.
Anyway check the projects's modules path in Projucer, it must be set to JUCE-LV2 modules dir.

Edit. I see that modules path is right, but you didn't add LV2 defines in JuceLibraryCode/AppConfig.h. It has to include such lines in BEGIN_USER_CODE_SECTION:

Code: Select all

// [BEGIN_USER_CODE_SECTION]

// (You can add your own code in this section, and the Projucer will not overwrite it)
  #define JucePlugin_Build_LV2 1
  #define JucePlugin_LV2URI "https://github.com/walkerdavis/OceanPlugIns-AnemoneChorus"
  #define JucePlugin_MaxNumInputChannels 2
  #define JucePlugin_MaxNumOutputChannels 2


// [END_USER_CODE_SECTION]

User avatar
REIS0
Established Member
Posts: 8
Joined: Wed Oct 07, 2020 12:44 pm
Contact:

Re: Porting JUCE programs to DISTRHO/juce for LV2 support

Post by REIS0 »

Submodule? I guess you mean subdirectory in project's dir.
Yeah I mean as a git submodule in the repo.
I see that modules path is right, but you didn't add LV2 defines in JuceLibraryCode/AppConfig.h. It has to include such lines in BEGIN_USER_CODE_SECTION:
Oh I forgot to do this again, I've done this in my other attempts but this time I totally forgot, totally my bad.

@Kott apparently it worked now! thanks for helping in this little adventure and for answering my annoying newbie questions.

Kott
Established Member
Posts: 321
Joined: Thu Mar 21, 2013 12:55 am
Location: Vladivostok

Re: Porting JUCE programs to DISTRHO/juce for LV2 support

Post by Kott »

good!

Post Reply