yokemura / Magical8bitPlug2

GNU General Public License v3.0
301 stars 19 forks source link

Add Linux build #36

Closed sjfricke closed 6 months ago

sjfricke commented 2 years ago

I run Reaper on Ubuntu 20. I added a new exporter and was able to easily build (JUCE v6.1.6) and run the plugin as both a standalone and a VST3 plugin in Reaper without any issues.

somewhat related to https://github.com/yokemura/Magical8bitPlug2/issues/7 as well

denilsonsa commented 10 months ago

Compiling it without any instructions can be tricky. Here's how to compile on Linux:

# Installing the dependencies in Manjaro (or Arch):
# I have no idea why it requires webkit2gtk.
pacman -S --asdeps webkit2gtk juce

# Building the LV2 plugin instead of the VST2 plugin:
sed -i 's/,buildVST,/,buildLV2,/'
# ↑ I think this change should also be pushed to the main repository.
#
# Alternatively, just disabling the VST2 plugin:
# sed -i 's/,buildVST,/,/'

Projucer --resave Magical8bitPlug2.jucer
cd Builds/LinuxMakefile

# Building the Debug version:
make
# Or rather building the Release version:
make CONFIG=Release
# Or "make -j 4" if you want to run 4 compilation processes in parallel.

I had to disable VST2 plugin to avoid the following error:

In file included from ../../JuceLibraryCode/include_juce_audio_plugin_client_VST2.cpp:9:
/usr/share/juce/modules/juce_audio_plugin_client/juce_audio_plugin_client_VST2.cpp:88:10: fatal error: pluginterfaces/vst2.x/aeffect.h: No such file or directory
   88 | #include "pluginterfaces/vst2.x/aeffect.h"
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Which seems to be related to VST2 SDK file no longer being distributed with JUCE. In fact, the ob-xd package also disables the legacy VST2 plugin (and additionally prevents auto-installing the plugins into the user's home directory).


I've tested the standalone binary and it works fine. I have not tested the plugins.

Minor bug: the application runs fine, but doesn't have the proper application icon. Instead, the default generic X11 icon is shown on the taskbar.


One can install it by copying these files:

denilsonsa commented 10 months ago

The webkit2gtk dependency might be avoided if adding JUCE_WEB_BROWSER="0" JUCE_USE_WIN_WEBVIEW2="0" inside <JUCEOPTIONS … />. I have not tested it, though.

Exagone313 commented 10 months ago

I successfully built the plugin on Arch Linux from @denilsonsa instructions. (I just corrected the path to juce to the system installation, but maybe it could work without this modification). By the way, it will copy the plugin in ~/.lv2 and ~/.vst3 by itself after running make CONFIG=Release so it probably needs more setup to make an Arch Linux package for it.

Though I can't get the plugin to work, with both LV2 and VST3 plugins. I used Element to run it. I used some basic MIDI input, either with the built-in virtual keyboard from Element or with Midinous.

With the VST3 plugin, it makes a continuous silent note at volume 100%, it seems like a security is in place somewhere to not crash everything with a maximum volume output. I don't even have to plug a MIDI input to get this. I have been able to obtain a loud and continuous low pitch sound by restarting it multiple times.

With the LV2 plugin, when inputting a note, it just make a high pitch sound that never ends. By inputting multiple notes, all the sounds are kept playing together and it's inaudible.

I confirmed with another plugin (General MIDI Synth) that it is an issue with Magical8bitPlug2 plugin and not my setup.

The standalone program works correctly, the issue is only with the LV2 and VST3 plugins.

denilsonsa commented 10 months ago

By the way, it will copy the plugin in ~/.lv2 and ~/.vst3 by itself after running make CONFIG=Release

That can be prevented with enablePluginBinaryCopyStep="0", which is something I learned later and suggested in some other projects (like tunefish, xenos, audio-dsp-multi-visualize)

If packing this, try taking inspiration from other JUCE-based packages, like odin2, dexed, ob-xd.

denilsonsa commented 10 months ago

I tested the VST3 and the LV2 plugins using Carla, and I can confirm @Exagone313 findings. They're completely broken, while the stand-alone works fine.

image

Both plugin versions emit a loud noise (one of them immediately, the other after receiving the first MIDI note):

image

Exagone313 commented 10 months ago

It's possible that the bug is coming from recent changes in either Juce or Magical8bitPlug2. It would be nice to compare with Windows or macOS builds.

denilsonsa commented 10 months ago

Indeed, loading either the VST2 or the VST3 plugins from the windows version (from the latest/only release) inside Carla (with the help of yabridge), they behave correctly.

yokemura commented 6 months ago

As I commented on another Linux related PR, let me just merge this without any testing as it won't affect any other part of code.

RustoMCSpit commented 1 week ago

can a linux build be added to the releases on github