jd-13 / MONSTR-Stereo-Imaging

MONSTR is a multiband stereo imaging plugin, available in VST, VST3 and Audio Unit formats.
https://whiteelephantaudio.com/plugins/monstr/
GNU General Public License v3.0
25 stars 1 forks source link

Errors are pouring in when trying to assemble a solution #26

Closed EkimmuMaarid closed 11 months ago

EkimmuMaarid commented 1 year ago

I wanted to build myself vst2 and 32, but what I just didn't try to configure, there is no way to build shared code, and without it, the plugin. I even put WECore in the profile folder, installed the library 2019, I prescribed the path to the modules, I probably have ide 2022, I have no other ideas why several dozen assignment errors with possible data loss, and then several dozen quotes the code in chunks mentioning lambda. Please, if it won't be difficult for you, compile all the variants of the 64 and 32 bit vst2 plug-ins to your site, I obviously can't do it

jd-13 commented 1 year ago

Hi, it's usually easiest to build this project from the projucer.

Then you should just need to update the header paths for the WECore library in the visual studio exporter, and enable the VST plugin format in the project settings (the gear icon at the top). This file has the full build steps for windows, you'll need to download the fonts using the command from there.

Or if you're still having trouble building it locally you should be able to fork this repo and trigger a build in github actions.

If that works then as above you can edit the projucer project to enable VST, and push the changes to your fork to trigger a build. You might just need to update this line to pick up the VST build instead of the VST3 one.

EkimmuMaarid commented 1 year ago

Yes, you are right, the bat file contains the address of the font from the program and this, with all the errors, has gathered, I think it's worth adding the font address to the readme along with the wecore address. Now another problem, when I create a 32bit solution in the ide, I copy the parameters from the 64bit one, I guess I can't build a 32bit plugin, because I have to manually specify something somewhere? This is a great tool, it would be useful to my friend without the jbridge gasket.

EkimmuMaarid commented 1 year ago

Here is the error from the log ] (компилируется исходный файл ....\Source\PluginProcessor.cpp) D:\Desktop\MONSTR-Stereo-Imaging-master\Source\General\AudioSpinMutex.h(35,1): fatal error C1189: #error: Unsupported architecture (компилируется исходный файл ....\Source\PluginProcessor.cpp)

As I understand it, it is impossible to build on a 32-bit platform because the author blocked it? Is it possible to remove or fix something from this code? // Some useful links about these instructions in notes/splnlock-instructions.txt

if defined(__x86_64__) || defined(_M_AMD64)

#include <emmintrin.h>
#define CPU_PAUSE _mm_pause();

elif defined(aarch64) || defined(_M_ARM64)

#define CPU_PAUSE __asm__ __volatile__("yield" ::: "memory");

else

#error Unsupported architecture

endif

jd-13 commented 12 months ago

Ah I see, that section only supports 64-bit systems as those are the only ones I've tested those instructions with.

To build on 32-bit I think you'll need to add something like || defined(__x86__) to the end of this line. I'm not sure if that's exactly the right macro though, from a quick look around I couldn't find it documented anywhere.

Or if you're only building for Intel, you could replace that whole block with just these two lines:

#include <emmintrin.h>
#define CPU_PAUSE _mm_pause();

You might also need to make a similar change here.

EkimmuMaarid commented 12 months ago

unfortunately, no, I tried all the options, the architecture error disappeared only when I left two lines removing all the conditions, but now it just doesn't build and only lambda is everywhere

here are the last 10 or so errors, maybe you can figure out what's going on?

1>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.36.32532\include\functional(820,35): message : выполняется компиляция ссылки на экземпляр шаблон функции "_Rx std::_Invoker_ret<_Rx>::_Call<_Callable&,>(_Fx) noexcept(false)" 1> with 1> [ 1> _Rx=float, 1> _Callable=WECore::JUCEPlugin::CoreAudioProcessor::registerPrivateParameter::, 1> _Fx=WECore::JUCEPlugin::CoreAudioProcessor::registerPrivateParameter:: & 1> ] (компилируется исходный файл ....\Source\MONSTRCrossoverMouseListener.cpp) 1>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.36.32532\include\functional(819,9): message : во время компиляции функции-члена класс шаблон "_Rx std::_Func_impl_no_alloc<WECore::JUCEPlugin::CoreAudioProcessor::registerPrivateParameter::,_Rx>::_Do_call(void)" 1> with 1> [ 1> _Rx=float 1> ] (компилируется исходный файл ....\Source\MONSTRCrossoverMouseListener.cpp) 1>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.36.32532\include\functional(717): message : выполняется компиляция ссылки на экземпляр класс шаблон функции "std::_Func_impl_no_alloc<WECore::JUCEPlugin::CoreAudioProcessor::registerPrivateParameter::,_Ret>" 1> with 1> [ 1> _Ret=float 1> ] (компилируется исходный файл ....\Source\MONSTRCrossoverMouseListener.cpp) 1>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.36.32532\include\functional(903,23): message : выполняется компиляция ссылки на шаблон переменной "const bool _Is_large<std::_Func_impl_no_alloc<,float> >" (компилируется исходный файл ....\Source\MONSTRCrossoverMouseListener.cpp) 1>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.36.32532\include\functional(1030,13): message : выполняется компиляция ссылки на экземпляр шаблон функции "void std::_Func_class<_Ret>::_Reset<_Ty>(_Fx &&)" 1> with 1> [ 1> _Ret=float, 1> _Ty=WECore::JUCEPlugin::CoreAudioProcessor::registerPrivateParameter::, 1> _Fx=WECore::JUCEPlugin::CoreAudioProcessor::registerPrivateParameter:: 1> ] (компилируется исходный файл ....\Source\MONSTRCrossoverMouseListener.cpp) 1>D:\Desktop\MONSTR-Stereo-Imaging-master\Source\CoreJUCEPlugin\CoreAudioProcessor.h(419,75): message : выполняется компиляция ссылки на экземпляр шаблон функции "std::function<float (void)>::function<WECore::JUCEPlugin::CoreAudioProcessor::registerPrivateParameter::,0>(_Fx &&)" 1> with 1> [ 1> _Fx=WECore::JUCEPlugin::CoreAudioProcessor::registerPrivateParameter:: 1> ] (компилируется исходный файл ....\Source\MONSTRCrossoverMouseListener.cpp) 1>D:\Desktop\MONSTR-Stereo-Imaging-master\Source\CoreJUCEPlugin\CoreAudioProcessor.h(419,75): message : см. первую ссылку на "std::function<float (void)>::function" в "WECore::JUCEPlugin::CoreAudioProcessor::registerPrivateParameter" (компилируется исходный файл ....\Source\MONSTRCrossoverMouseListener.cpp) 1>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.36.32532\include\functional(659,31): warning C4244: return: преобразование "int" в "_Rx", возможна потеря данных 1> with 1> [ 1> _Rx=float 1> ] (компилируется исходный файл ....\Source\MONSTRCrossoverWrapperComponent.cpp) 1>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.36.32532\include\functional(820,35): message : выполняется компиляция ссылки на экземпляр шаблон функции "_Rx std::_Invoker_ret<_Rx>::_Call<_Callable&,>(_Fx) noexcept(false)" 1> with 1> [ 1> _Rx=float, 1> _Callable=WECore::JUCEPlugin::CoreAudioProcessor::registerPrivateParameter::, 1> _Fx=WECore::JUCEPlugin::CoreAudioProcessor::registerPrivateParameter:: & 1> ] (компилируется исходный файл ....\Source\MONSTRCrossoverWrapperComponent.cpp) 1>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.36.32532\include\functional(819,9): message : во время компиляции функции-члена класс шаблон "_Rx std::_Func_impl_no_alloc<WECore::JUCEPlugin::CoreAudioProcessor::registerPrivateParameter::,_Rx>::_Do_call(void)" 1> with 1> [ 1> _Rx=float 1> ] (компилируется исходный файл ....\Source\MONSTRCrossoverWrapperComponent.cpp) 1>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.36.32532\include\functional(717): message : выполняется компиляция ссылки на экземпляр класс шаблон функции "std::_Func_impl_no_alloc<WECore::JUCEPlugin::CoreAudioProcessor::registerPrivateParameter::,_Ret>" 1> with 1> [ 1> _Ret=float 1> ] (компилируется исходный файл ....\Source\MONSTRCrossoverWrapperComponent.cpp) 1>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.36.32532\include\functional(903,23): message : выполняется компиляция ссылки на шаблон переменной "const bool _Is_large<std::_Func_impl_no_alloc<,float> >" (компилируется исходный файл ....\Source\MONSTRCrossoverWrapperComponent.cpp) 1>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.36.32532\include\functional(1030,13): message : выполняется компиляция ссылки на экземпляр шаблон функции "void std::_Func_class<_Ret>::_Reset<_Ty>(_Fx &&)" 1> with 1> [ 1> _Ret=float, 1> _Ty=WECore::JUCEPlugin::CoreAudioProcessor::registerPrivateParameter::, 1> _Fx=WECore::JUCEPlugin::CoreAudioProcessor::registerPrivateParameter:: 1> ] (компилируется исходный файл ....\Source\MONSTRCrossoverWrapperComponent.cpp) 1>D:\Desktop\MONSTR-Stereo-Imaging-master\Source\CoreJUCEPlugin\CoreAudioProcessor.h(419,75): message : выполняется компиляция ссылки на экземпляр шаблон функции "std::function<float (void)>::function<WECore::JUCEPlugin::CoreAudioProcessor::registerPrivateParameter::,0>(_Fx &&)" 1> with 1> [ 1> _Fx=WECore::JUCEPlugin::CoreAudioProcessor::registerPrivateParameter:: 1> ] (компилируется исходный файл ....\Source\MONSTRCrossoverWrapperComponent.cpp) 1>D:\Desktop\MONSTR-Stereo-Imaging-master\Source\CoreJUCEPlugin\CoreAudioProcessor.h(419,75): message : см. первую ссылку на "std::function<float (void)>::function" в "WECore::JUCEPlugin::CoreAudioProcessor::registerPrivateParameter" (компилируется исходный файл ....\Source\MONSTRCrossoverWrapperComponent.cpp)

jd-13 commented 12 months ago

Sorry I'm not as familiar with VS, I'm thinking it might be because it looks like you have the 2022 version but the project is configured for 2019?

I'd say the easiest thing to do from here would be:

  1. Fork the WECore repo and the MONSTR repo
  2. Update this line to point to your fork of WECore
  3. Trigger a build in github actions from your fork of the MONSTR repo, make sure everything works

If that's all good, then try making the changes:

  1. Update the ifdefs in WECore
  2. Enable VST in the project settings (Maybe push the changes at this point to check the github actions build still works)
  3. Set the Architecture to Win32 in the Visual Studio 2019 exporter
  4. Replace x64 with Win32 here
  5. Change the path here, I think something like this should work: Builds/VisualStudio2019/Win32/Debug/VST/*.vst
  6. Push the changes, then if that worked you should be able to download a build from the github actions page
EkimmuMaarid commented 12 months ago

Yes, the problem is that I did about that, I also set up juce so that it would give out a VS project in 32 bits, except that I don't want to fork, because I don't know the C++ language. When at the very beginning, in juce, I simply replaced the one you used with my font, the result of the construction was about the same, it failed for no obvious reason (grrrr seems to be microsoft ahead of the whole planet >_<). I think 32 bits can't be built due to the lack of something referenced by routines from wecore, perhaps 64-bit libraries, accessing memory with a space request? It is likely that juce itself has forgotten how to compile in 32, I can't find out for sure, it all depends on the functions used in the plugin itself. But in general, if I have tortured you, I will not insist. I built the 64-bit vst2 as soon as I discovered the font. I am more than grateful for your help.

jd-13 commented 12 months ago

I have a build set up here which almost works: https://github.com/jd-13/MONSTR-Stereo-Imaging/actions/runs/6240000514/job/16939119300

The issues with registerPrivateParameter I think are just warnings and can be ignored, the error on that build is that the legacy VST SDK hasn't been configured. If you use the 32-bit branches of this repo and WE-Core, then I think you should be able to configure the VST SDK and get it to build.

EkimmuMaarid commented 12 months ago

I downloaded 4 versions of the sdk, the latest and old, tried with all, tried to disable JUCE_VST3_CAN_REPLACE_VST2, copied the old parts to the new sdk, nothing works, in 100% case the studio simply does not collect SharedCode without specific reasons.

jd-13 commented 12 months ago

Ah ok, I've updated the 32-bit branch to only build VST3 and that works successfully, these are all the changes I made: https://github.com/jd-13/MONSTR-Stereo-Imaging/compare/master...32-bit

This would still need to be configured to use the legacy VST SDK for it to build VST2, but I think that should work. I don't have a Visual Studio setup I can test with right now, but if it still doesn't work I might be able to help if you can find the error that your build is failing on.

EkimmuMaarid commented 11 months ago

I downloaded a 32-bit branch, separately, put the font file in the resources- graphics folder, copied (so as not to expose folders) the contents of wecore to the resources folder. I opened the AudioSpinMutex.h file with notepad and deleted the condition lines, leaving only 2, as mentioned above. I opened the project in projucer and selected 32 bits in the projucer itself in the visual studio release settings. In the settings of each module, I specified the location of c:/ juce/module. And in global path, I used a modern vst sdk with a copied vst 2.4 folder. I was very confused by the fact that all the modules were listed as part of juce, but for some reason the dsp module was listed as part of sdk juce. I saved and opened it in ide, selected release, since I specified 32 bits in projucer, it is selected automatically when opening. Clicked build only shared code. 1>D:\Desktop\MONSTR-Stereo-Imaging-32-bit\Source\CoreJUCEPlugin\TooltipLabelUpdater.h(103,1): fatal error C1189: #error: "Unknown arch" (компилируется исходный файл ....\Source\PluginProcessor.cpp)

I wrote in detail my actions, I may simply not understand some obvious things, you will understand my actions.

EkimmuMaarid commented 11 months ago

Yes, we did it!!! I deleted the conditions in the TooltipLabelUpdater.h file, leaving only two lines //Arch _defaultString += " "; _defaultString += "x86"; and was able to build vst2 32bit. I checked it, it is quite working. Cheers cheers Thank you very much, you are the best!

jd-13 commented 11 months ago

Glad it's working, let me know if you have any other issues or feedback!