GuitarML / SmartAmpPro

Guitar plugin using neural networks to capture real amps and pedals
https://guitarml.com/
GNU General Public License v3.0
187 stars 13 forks source link

Getting missing member errors attempting to build SmartAmpPro #22

Open jamsden opened 2 years ago

jamsden commented 2 years ago

I'm trying to build SmartAmpPro on MacOS 10.15.7 using Projucer 6.1.4, boost_78_0, and Xcode 12.4.

I'm getting 5 compilation errors in PluginEditor.cpp, all similar to: No member named 'browseForMultipleFilesToOpen' in 'juce::FileChooser'. I have looked at the header files that are getting included and the missing members are there. Haven't done much C++ in many years, but I don't see any solution. Any idea how to fix this?

My Projucer.app Header search paths is: $(HOME)/eigen/ ~/Documents/GitHub/json/include ~/Documents/GitHub/NumCpp/include ~/Developer/boost_1_78_0

The missing methods are in in juce_FileChooser.h, but are not include unless JUCE_MODAL_LOOPS_PERMITTED is defined.

I resolved the issue by adding JUCE_MODAL_LOOPS_PERMITTED=1 in the SmartAppPro Exporter Preprocessor Definitions, but I'm not sure that's the correct solution.

jamsden commented 2 years ago

After getting beyond the compilation errors, I was able to build SmartAmpPro.component, but when scanning the component on Logic Pro X startup, SmartAmpPro crashes during plugin validation with:

validating Audio Unit SmartAmpPro by GuitarML:

AU Validation Tool
Version: 1.7.0 
Copyright 2003-2019, Apple Inc. All Rights Reserved.
Specify -h (-help) for command options

VALIDATING AUDIO UNIT: 'aufx' - 'sa10' - 'Manu'

Manufacturer String: GuitarML AudioUnit Name: SmartAmpPro Component Version: 1.0.0 (0x10000)

validation result: crashed validation

This stack trace from the crash might be relevant:

8 com.GuitarML.SmartAmpPro 0x0000000109b3f251 nc::NdArray<float, std::1::allocator >::fill(float) + 33 (NdArrayCore.hpp:2880) 9 com.GuitarML.SmartAmpPro 0x0000000109b3f1d2 nc::NdArray<float, std::1::allocator > nc::full(unsigned int, unsigned int, float) + 66 (full.hpp:72) 10 com.GuitarML.SmartAmpPro 0x0000000109b3bb6a nc::NdArray<float, std::__1::allocator > nc::zeros(unsigned int, unsigned int) + 42 (zeros.hpp:73) 11 com.GuitarML.SmartAmpPro 0x0000000109b3c610 lstm::pad_init(nc::NdArray<float, std::1::allocator >) + 320 (lstm.cpp:123) 12 com.GuitarML.SmartAmpPro 0x0000000109b3bf82 lstm::setParams(int, int, int, int, int, nc::NdArray<float, std::1::allocator >, nc::NdArray<float, std::1::allocator >, std::1::vector<nc::NdArray<float, std::1::allocator >, std::1::allocator<nc::NdArray<float, std::1::allocator > > >, std::1::vector<nc::NdArray<float, std::1::allocator >, std::1::allocator<nc::NdArray<float, std::1::allocator > > >, nc::NdArray<float, std::1::allocator >, nc::NdArray<float, std::1::allocator >, nc::NdArray<float, std::1::allocator >, nc::NdArray<float, std::__1::allocator >, int, int, int) + 770 (lstm.cpp:77) 13 com.GuitarML.SmartAmpPro 0x0000000109b8f5ab SmartAmpProAudioProcessor::loadConfig(juce::File) + 699 (PluginProcessor.cpp:203) 14 com.GuitarML.SmartAmpPro 0x0000000109b8d4ce SmartAmpProAudioProcessor::SmartAmpProAudioProcessor() + 1742 (PluginProcessor.cpp:34) 15 com.GuitarML.SmartAmpPro 0x0000000109b8f805 SmartAmpProAudioProcessor::SmartAmpProAudioProcessor() + 21 (PluginProcessor.cpp:36) 16 com.GuitarML.SmartAmpPro 0x0000000109b90d08 createPluginFilter() + 40 (PluginProcessor.cpp:453) 17 com.GuitarML.SmartAmpPro 0x0000000109af19b8 juce::createPluginFilterOfType(juce::AudioProcessor::WrapperType) + 24 (juce_CreatePluginFilter.h:39) 18 com.GuitarML.SmartAmpPro 0x0000000109aebb14 AudioProcessorHolder::AudioProcessorHolder(bool) + 100 (juce_AU_Wrapper.mm:113) 19 com.GuitarML.SmartAmpPro 0x0000000109aeb2b7 JuceAU::JuceAU(ComponentInstanceRecord) + 103 (juce_AU_Wrapper.mm:136) 20 com.GuitarML.SmartAmpPro 0x0000000109aeb11d JuceAU::JuceAU(ComponentInstanceRecord) + 29 (juce_AU_Wrapper.mm:182) 21 com.GuitarML.SmartAmpPro 0x0000000109b17084 APFactory<AUBaseLookup, JuceAU>::Construct(void, ComponentInstanceRecord) + 36 (ComponentBase.h:231) 22 com.GuitarML.SmartAmpPro 0x0000000109b2cb44 ComponentBase::AP_Open(void, ComponentInstanceRecord) + 68 (ComponentBase.cpp:104)

vackva commented 2 years ago

I was running into the same use..

I think since JUCE 6 you have to use JUCE_MODAL_LOOPS_PERMITTED=1 in your CMakeList or Projucer to use the FileExplorer.

So I got the plugin running with a dirty hack.

For off all be sure using NumCPP Version >= 2.4.1 (otherwise you will run into some linking errors).

But the plugin still crashes at startup. The reason for the crash is due to this File -> NumCpp\include\NumCpp\NdArray\NdArrayIterators.hpp in Line 67-74 (Version 2.4.1)

explicit NdArrayConstIterator(pointer ptr) :
    ptr_(ptr)
{
    if (ptr == nullptr)
    {
        THROW_RUNTIME_ERROR("NdArray has not been initialized.");
    }
}

By commeting out the Line: //THROW_RUNTIME_ERROR("NdArray has not been initialized."); you can run and use the plugin. I didn't fount time yet to have a deeper look for that error.

Hope it helps someone!

GuitarML commented 2 years ago

@vackva Thank you for the help! SmartAmpPro has not been in active development for awhile, but it's on my list to bring up to date and improve the interface between the plugin and tensorflow. And yes, if you use later than JUCE 6.08 it will not be able to compile the file browser part of the code, reference this open issue on NeuralPi: https://github.com/GuitarML/NeuralPi/issues/28

vackva commented 2 years ago

Sure, took me some time to figure that out and I'm sure others will run into the same issue :)

I also have a working CMake build (CMakeLists.txt), I could share this as well if you are interested in that.

jamsden commented 2 years ago

Glad to see some activity. I hope to put some time into this once it's working again.