grame-cncm / faust

Functional programming language for signal processing and sound synthesis
http://faust.grame.fr
Other
2.48k stars 316 forks source link

faust2vsti troubles on Arch Linux #519

Open wesleysinks opened 3 years ago

wesleysinks commented 3 years ago

Hi all,

I've just gotten started with Faust and I love it coming from some background in Pd and Csound! I have been trying for a few days to export a simple dsp file to vsti using faust2vsti, and I seem to have hit a brick wall! Maybe someone can tell me what I'm doing wrong.

First, I tried exporting to Linux > VST from the online IDE, but realized this was not exporting an instrument, but an effect without any midi capabilities. I then downloaded the dsp file and was able to successfully export a working LV2 instrument using faust2lv2 -gui -novoicectrls -nvoices 12 <file.dsp> . (Yay!) However, several DAW's I use on Linux don't support LV2 plugins (boo!), so I'll ultimately need to export a VSTi. I first installed the latest SDK from Steinberg at /usr/local/include/vstsdk2.4/ following the errors I received when trying to export without the SDK. I also ran the shell script to copy over VST2 files to the VST3 directory. I then received the following errors when trying to compile (faust2vsti <file.dsp>):

In file included from /usr/local/include/vstsdk2.4/public.sdk/source/vst2.x/audioeffectx.h:37,
                 from BabyFM.cpp:209:
/usr/local/include/vstsdk2.4/public.sdk/source/vst2.x/audioeffect.h:37:10: fatal error: pluginterfaces/vst2.x/aeffect.h: No such file or directory
   37 | #include "pluginterfaces/vst2.x/aeffect.h" // "c" interface
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
In file included from /usr/local/include/vstsdk2.4/public.sdk/source/vst2.x/audioeffect.cpp:35:
/usr/local/include/vstsdk2.4/public.sdk/source/vst2.x/audioeffect.h:37:10: fatal error: pluginterfaces/vst2.x/aeffect.h: No such file or directory
   37 | #include "pluginterfaces/vst2.x/aeffect.h" // "c" interface
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
In file included from /usr/local/include/vstsdk2.4/public.sdk/source/vst2.x/audioeffectx.h:37,
                 from /usr/local/include/vstsdk2.4/public.sdk/source/vst2.x/audioeffectx.cpp:35:
/usr/local/include/vstsdk2.4/public.sdk/source/vst2.x/audioeffect.h:37:10: fatal error: pluginterfaces/vst2.x/aeffect.h: No such file or directory
   37 | #include "pluginterfaces/vst2.x/aeffect.h" // "c" interface
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
In file included from /usr/local/include/vstsdk2.4/public.sdk/source/vst2.x/vstplugmain.cpp:35:
/usr/local/include/vstsdk2.4/public.sdk/source/vst2.x/audioeffect.h:37:10: fatal error: pluginterfaces/vst2.x/aeffect.h: No such file or directory
   37 | #include "pluginterfaces/vst2.x/aeffect.h" // "c" interface
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.

Upon investigation, this file doesn't exist in the current SDK! I found the following link to the 2.4 SDK and downloaded all 3 revisions/versions: https://archive.org/details/VST2SDK

Revision 2 did not work at all, but the other 2 gave me the following output, along with a set of empty build directories for the VST. I am currently using Rev 1. I get the feeling I'm on the right track, but I don't really know what to try next.

BabyFM.cpp:723:27: warning: multi-character character constant [-Wmultichar]
  723 |             long baseid = 'FAUS';
      |                           ^~~~~~
/usr/local/include/vstsdk2.4/public.sdk/source/vst2.x/audioeffect.cpp: In member function ‘virtual void AudioEffect::int2string(VstInt32, char*, VstInt32)’:
/usr/local/include/vstsdk2.4/public.sdk/source/vst2.x/audioeffect.cpp:530:24: warning: narrowing conversion of ‘(48 + ((int)((char)digit)))’ from ‘int’ to ‘char’ [-Wnarrowing]
  530 |    char temp[2] = {'0' + (char)digit, '\0'};
      |                    ~~~~^~~~~~~~~~~~~
/usr/local/include/vstsdk2.4/public.sdk/source/vst2.x/audioeffectx.cpp: In member function ‘virtual void AudioEffectX::resume()’:
/usr/local/include/vstsdk2.4/public.sdk/source/vst2.x/audioeffectx.cpp:307:48: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings]
  307 |  if (cEffect.flags & effFlagsIsSynth || canDo ("receiveVstMidiEvent") == 1)
      |                                                ^~~~~~~~~~~~~~~~~~~~~
/usr/bin/faust2vsti: line 55: BabyFM.vst/Contents/Info.plist: No such file or directory
/usr/bin/faust2vsti: line 115: BabyFM.vst/Contents/PkgInfo: No such file or directory
./BabyFM.vst;

Any help would be appreciated! I might try to rebuild Faust from source and see if that resolves my issues in the meantime. Thank you!

-Wesley

sletz commented 3 years ago

Have you tried the faust2juce alternative way ? See https://github.com/grame-cncm/faust/tree/master-dev/architecture/juce

wesleysinks commented 3 years ago

I have not tried that yet. I assume I would need to have Juce installed, then export the instrument from Juce after this process?

I'll look into this more this evening and report back. My limited experience with Juce on Linux has not been incredible. I assume mostly user error. I'm by no means comfortable with C++, but eager to learn more!

sletz commented 3 years ago

I have not tried that yet. I assume I would need to have Juce installed, then export the instrument from Juce after this process?

Yes.

I'll look into this more this evening and report back. My limited experience with Juce on Linux has not been incredible. I assume mostly user error. I'm by no means comfortable with C++, but eager to learn more!

OK.

wesleysinks commented 3 years ago

Thanks for the quick follow-up!

I just tried faust2juce and was able to open the project in Juce, but the build options were all grayed out in Juce.

I tried both Juce from Arch packages (out-of-date), and from Roli directly. Neither one would let me build with the Linux Makefile option selected. This was also the case upon opening the examples provided directly within Juce. I have base-devel installed on my system, so I would think that would satisfy any dependencies for Juce. However, I do see on their website their support for Linux references Ubuntu 16.04 specifically. This could be the issue for me trying to use Juce. I no longer have any hardware running Ubuntu, but I suppose I can try spinning up a VM to attempt this build later. I'll update when I've given that a shot.

wesleysinks commented 3 years ago

I finally got JUCE to provide a makefile. Upon trying to build, I'm seeing a rather familiar looking error:

Compiling include_juce_audio_plugin_client_VST2.cpp
In file included from ../../../../modules/juce_audio_plugin_client/juce_audio_plugin_client_VST2.cpp:26,
                 from ../../JuceLibraryCode/include_juce_audio_plugin_client_VST2.cpp:9:
../../../../modules/juce_audio_plugin_client/VST/juce_VST_Wrapper.cpp:87:10: fatal error: pluginterfaces/vst2.x/aeffect.h: No such file or directory
   87 | #include "pluginterfaces/vst2.x/aeffect.h"
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make: *** [Makefile:174: build/intermediate/Debug/include_juce_audio_plugin_client_VST2_dd551e08.o] Error 1

This aeffect.h file just keeps coming up.

sletz commented 3 years ago

So I seems you still have a VST SDK installation issue?

wesleysinks commented 3 years ago

Aye! I had Juce pointing to the SDK download I got directly from Steinberg. I updated it to reference revision 1 of the 2.4 SDK linked above and it seems to have worked. Oddly, the plugin has 64 audio outputs. I'm not sure what caused that, but I can probably get it figured out from here.