Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Linux build #36

Merged
merged 1 commit into from
Jan 28, 2024
Merged

Add Linux build #36

merged 1 commit into from
Jan 28, 2024

Conversation

sjfricke
Copy link
Contributor

@sjfricke sjfricke commented Jun 5, 2022

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 #7 as well

@denilsonsa
Copy link

denilsonsa commented Sep 12, 2023

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:

  • Builds/LinuxMakefile/build/Magical8bitPlug2/usr/bin/Magical8bitPlug2
  • Builds/LinuxMakefile/build/Magical8bitPlug2.vst3//usr/lib/vst3/Magical8bitPlug2.vst3/
  • Builds/LinuxMakefile/build/Magical8bitPlug2.lv2//usr/lib/lv2/Magical8bitPlug2.vst3/
  • docs//usr/share/docs/Magical8bitPlug2/
  • Resources/icon-256.png/usr/share/icons/hicolor/256x256/apps/Magical8bitPlug2.png
  • Resources/icon-512.png/usr/share/icons/hicolor/512x512/apps/Magical8bitPlug2.png
  • new .desktop entry must be created → /usr/share/applications/Magical8bitPlug2.desktop

@denilsonsa
Copy link

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
Copy link

Exagone313 commented Sep 29, 2023

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
Copy link

denilsonsa commented Sep 29, 2023

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
Copy link

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
Copy link

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
Copy link

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
Copy link
Owner

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.

@yokemura yokemura merged commit 3796308 into yokemura:develop Jan 28, 2024
@RustoMCSpit
Copy link

can a linux build be added to the releases on github

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants