HISE Logo Forum
    • Categories
    • Register
    • Login

    DSP compiling error on WIN, works fine on MAC

    Scheduled Pinned Locked Moved General Questions
    65 Posts 9 Posters 1.3k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • ustkU
      ustk @Morphoice
      last edited by ustk

      @Morphoice About compiling DSPs on both OS, I found that a perfect cleaning is key, each time... no source folder nor build folder should be git synced between machines. And even on the same machine, I often end up emptying everything to recompile new versions after a modification.

      The folders I clean are:

      • general binaries
      • dspNetworks/binaries
      • dspNetworks/ThirdParty
      • the entire AdditionalSourceCode

      So be sure not to track those folders between OS. Maybe it shouldn't be an issue, I don't know, but that is what I found after days of trial and errors and now I can safely compile on both mac and win if I respect this procedure.

      On top of that I often need to disable the networks AllowCompilation flags, re-open the project, re-enable the flags, and only after all of those steps I can start the compilation process. This makes simple modifications, well, not so simple...

      Can't help pressing F5 in the forum...

      MorphoiceM 1 Reply Last reply Reply Quote 1
      • ustkU
        ustk @Morphoice
        last edited by ustk

        @Morphoice oh and when you do this, the networks still expect to load the old faust compiled node when there are such be, because the XML has been saved in that state. So this has to be replace with the interpreted node or errors will invite to the party...

        Can't help pressing F5 in the forum...

        MorphoiceM 1 Reply Last reply Reply Quote 0
        • MorphoiceM
          Morphoice @ustk
          last edited by

          @ustk said in DSP compiling error on WIN, works fine on MAC:

          dspNetworks/ThirdParty

          but how am I supposed to compile my third party nodes on another OS if I clear them out of the thirdparty folder?

          https://instagram.com/morphoice - 80s inspired Synthwave Music, Arcade & Gameboy homebrew!

          ustkU 1 Reply Last reply Reply Quote 0
          • MorphoiceM
            Morphoice @ustk
            last edited by Morphoice

            @ustk it's probably not a general problem but one specific to the airwindows.h I'm using.... MSVC seems to be more strict about something in the Airwindows.h wrapper which CLANG on mac doesnt bother about.... I know nothing about template resolution so iI'm homping someone familiar with C++ can help...

            here'S the file again

            #pragma once
            
            #include <JuceHeader.h>
            #include <math.h>
            
            #include <set>
            #include <string>
            
            #define __audioeffect__
            #define VstInt32 int32_t
            #define AudioEffect ::airwindows::AirWindowsBase
            #define AudioEffectX ::airwindows::AirWindowsBase
            #define audioMasterCallback ::airwindows::SampleRateCallback*
            #define VstPlugCategory int
            #define kPlugCategEffect 1
            #define kVstMaxProgNameLen 64
            #define kVstMaxParamStrLen 64
            #define kVstMaxProductStrLen 64
            #define kVstMaxVendorStrLen 64
            #define vst_strncpy strncpy
            
            namespace airwindows {
            inline auto float2string(float f, char* text, int len) -> void {
              int decimals = 0;
              if (std::fabs(f) >= 10.0) {
                decimals = 1;
              } else if (std::fabs(f) > 1.0) {
                decimals = 2;
              } else {
                decimals = 3;
              }
            
              juce::String str(f, decimals);
              str.copyToUTF8(text, (size_t)len);
            }
            
            inline auto int2string(float i, char* text, int len) -> void {
              juce::String str(i);
              str.copyToUTF8(text, (size_t)len);
            }
            
            inline auto dB2string(float value, char* text, int maxLen) -> void {
              if (value <= 0) {
                vst_strncpy(text, "-oo", (size_t)maxLen);
              } else {
                float2string((float)(20. * log10(value)), text, maxLen);
              }
            }
            
            struct SampleRateCallback {
              SampleRateCallback() = default;
            
              auto getSampleRate() const noexcept -> double { return sampleRate; }
            
              double sampleRate{0.0};
            };
            
            class AirWindowsBase {
             public:
              AirWindowsBase(SampleRateCallback* c, int prog, int param)
                  : numPrograms(prog), numParams(param), callback(c) {}
            
              int getNumInputs() { return numInputs; }
            
              int getNumOutputs() { return numOutputs; }
            
              int getNumParameters() { return numParams; }
            
              virtual bool getEffectName(char* name) = 0;
              virtual VstPlugCategory getPlugCategory() = 0;
              virtual bool getProductString(char* text) = 0;
              virtual bool getVendorString(char* text) = 0;
              virtual VstInt32 getVendorVersion() = 0;
              virtual void processReplacing(float** inputs, float** outputs,
                                            VstInt32 sampleFrames) = 0;
              virtual void processDoubleReplacing(double** inputs, double** outputs,
                                                  VstInt32 sampleFrames) = 0;
              virtual void getProgramName(char* name) = 0;
              virtual void setProgramName(char* name) = 0;
            
              virtual VstInt32 getChunk(void** data, bool isPreset) {
                juce::ignoreUnused(data, isPreset);
                return 0;
              };
            
              virtual VstInt32 setChunk(void* data, VstInt32 byteSize, bool isPreset) {
                juce::ignoreUnused(data, byteSize, isPreset);
                return 0;
              };
            
              virtual float getParameter(VstInt32 index) {
                juce::ignoreUnused(index);
                return 0;
              }
            
              virtual void setParameter(VstInt32 index, float value) {
                juce::ignoreUnused(index, value);
              }
            
              virtual void getParameterLabel(VstInt32 index, char* text) {
                juce::ignoreUnused(index, text);
              }
            
              virtual void getParameterName(VstInt32 index, char* text) {
                juce::ignoreUnused(index, text);
              }
            
              virtual void getParameterDisplay(VstInt32 index, char* text) {
                juce::ignoreUnused(index, text);
              }
            
              virtual VstInt32 canDo(char* text) = 0;
            
             protected:
              void setNumInputs(int numIn) { numInputs = numIn; }
            
              void setNumOutputs(int numOut) { numOutputs = numOut; }
            
              void setUniqueID(int) {}
            
              void canProcessReplacing() {}
            
              void canDoubleReplacing() {}
            
              void programsAreChunks(bool) {}
            
              int numInputs = 0, numOutputs = 0, numPrograms = 0, numParams = 0;
            
              SampleRateCallback* callback;
            
              double getSampleRate() { return callback->getSampleRate(); }
            };
            
            }  // namespace airwindows
            
            #define DECLARE_AIRWINDOWS_NODE(ClassName, Namespace)
            template <int NV>
            struct ClassName final : public data::base {
              SNEX_NODE(ClassName);
              struct MetadataClass {
                SN_NODE_ID(#ClassName);
              };
              static constexpr bool isModNode() { return false; };
              static constexpr bool isPolyphonic() { return NV > 1; };
              static constexpr bool hasTail() { return false; };
              static constexpr bool isSuspendedOnSilence() { return false; };
              static constexpr int getFixChannelAmount() { return 2; };
              static constexpr int NumTables = 0;
              static constexpr int NumSliderPacks = 0;
              static constexpr int NumAudioFiles = 0;
              static constexpr int NumFilters = 0;
              static constexpr int NumDisplayBuffers = 0;
              void prepare(PrepareSpecs specs) {
                _sampleRateSource.sampleRate = specs.sampleRate;
                _tmp.setSize(specs.numChannels, specs.blockSize);
              }
              void reset() {}
              void handleHiseEvent(HiseEvent& e) {}
              template <typename T>
              void process(T& data) {
                auto buffer =
                    juce::AudioBuffer<float>(data.getRawChannelPointers(),
                                             data.getNumChannels(), data.getNumSamples());
                processInternal(buffer);
              }
              template <typename T>
              void processFrame(T& data) {
                auto** ptr = (float**)alloca(data.size() * sizeof(float*));
                for (int i = 0; i < data.size(); i++) {
                  ptr[i] = data.begin() + i;
                }
                auto buffer = juce::AudioBuffer<float>(ptr, data.size(), 1);
                processInternal(buffer);
              }
              auto processInternal(juce::AudioBuffer<float>& buffer) -> void {
                _tmp.makeCopyOf(buffer);
                _engine.processReplacing(_tmp.getArrayOfWritePointers(),
                                         buffer.getArrayOfWritePointers(),
                                         buffer.getNumSamples());
              }
              int handleModulation(double& value) { return 0; }
              void setExternalData(ExternalData const& data, int index) {}
              template <int P>
              void setParameter(double v) {
                _engine.setParameter(P, static_cast<float>(v));
              }
              void createParameters(ParameterDataList& data) {
                for (auto i{0}; i < airwindows::Namespace::kNumParameters; ++i) {
                  char name[kVstMaxParamStrLen]{};
                  _engine.getParameterName(i, name);
                  auto parameter = parameter::data(name, {0.0, 1.0});
                  registerCallback(parameter, i);
                  parameter.setDefaultValue(_engine.getParameter(i));
                  data.add(std::move(parameter));
                }
              }
               private : template <typename Param>
                          auto
                          registerCallback(Param& parameter, int i) -> void {
                switch (i) {
                  case 0:
                    registerCallback<0>(parameter);
                    break;
                  case 1:
                    registerCallback<1>(parameter);
                    break;
                  case 2:
                    registerCallback<2>(parameter);
                    break;
                  case 3:
                    registerCallback<3>(parameter);
                    break;
                  case 4:
                    registerCallback<4>(parameter);
                    break;
                  case 5:
                    registerCallback<5>(parameter);
                    break;
                  case 6:
                    registerCallback<6>(parameter);
                    break;
                  case 7:
                    registerCallback<7>(parameter);
                    break;
                  case 8:
                    registerCallback<8>(parameter);
                    break;
                  case 9:
                    registerCallback<9>(parameter);
                    break;
                  case 10:
                    registerCallback<10>(parameter);
                    break;
                  case 11:
                    registerCallback<11>(parameter);
                    break;
                  case 12:
                    registerCallback<12>(parameter);
                    break;
                  case 13:
                    registerCallback<13>(parameter);
                    break;
                  case 14:
                    registerCallback<14>(parameter);
                    break;
                  case 15:
                    registerCallback<15>(parameter);
                    break;
                  case 16:
                    registerCallback<16>(parameter);
                    break;
                  case 17:
                    registerCallback<17>(parameter);
                    break;
                  case 18:
                    registerCallback<18>(parameter);
                    break;
                  case 19:
                    registerCallback<19>(parameter);
                    break;
                  case 20:
                    registerCallback<20>(parameter);
                    break;
                  case 21:
                    registerCallback<21>(parameter);
                    break;
                  case 22:
                    registerCallback<22>(parameter);
                    break;
                  case 23:
                    registerCallback<23>(parameter);
                    break;
                  case 24:
                    registerCallback<24>(parameter);
                    break;
                  default:
                    break;
                }
                jassert(false);
              }
              airwindows::SampleRateCallback _sampleRateSource{};
              airwindows::Namespace::ClassName _engine{&_sampleRateSource};
              juce::AudioBuffer<float> _tmp;
            }
            
            

            https://instagram.com/morphoice - 80s inspired Synthwave Music, Arcade & Gameboy homebrew!

            1 Reply Last reply Reply Quote 0
            • ustkU
              ustk @Morphoice
              last edited by

              @Morphoice said in DSP compiling error on WIN, works fine on MAC:

              but how am I supposed to compile my third party nodes on another OS if I clear them out of the thirdparty folder?

              I should have said the files created by Hise in there, not the actual 3rd party files you manually added in

              Can't help pressing F5 in the forum...

              MorphoiceM 1 Reply Last reply Reply Quote 1
              • MorphoiceM
                Morphoice @ustk
                last edited by

                @ustk ah ok I see. But the problem here is in the C++ code, something the windows compiler takes more strict than the mac, so deleting random stuff wouldnt solve it, I need someone to fix the C++ above

                https://instagram.com/morphoice - 80s inspired Synthwave Music, Arcade & Gameboy homebrew!

                LindonL 1 Reply Last reply Reply Quote 0
                • LindonL
                  Lindon @Morphoice
                  last edited by

                  @Morphoice so are you trying to compile your fx/HISE when its on a virtual machine external drive?

                  I have found that Faust based nodes WONT build on anything other than a real real real drive inside the machine - external drives are a no no.

                  HISE Development for hire.
                  www.channelrobot.com

                  MorphoiceM 1 Reply Last reply Reply Quote 0
                  • MorphoiceM
                    Morphoice @Lindon
                    last edited by Morphoice

                    @Lindon again, it's a problem with the c++ code I posted above. I am compiling on either a virtual machine, external drive and a dedicated machine with an internal drive which has the exact same problem whereas all other plugins that don't use that third party node compile fine on either of the systems. so it's for sure not a problem with an external drive and sorry to say so but if we live in a world where men can be women, people can travel to space and doctors can cure aids, an external properly mounted drive sure as hell should not break a compiler. y'all conjuring up some spiritual paranormal esoteric reasons why stuff doesn't work instead of having a look at the real problem.

                    MSVC (Microsoft Visual C++) which is the compiler on Windows/PC handles things more strict than CLANG (the C++ compiler on MAC). Whoever made that C++ did not account for that and probably worked on mac or linux. I posted the error codes, I don't know a lot of C++ though so if just someone who is pro at C++ could have a look and point me to a solution, I'm sure it's an easy one. Please no more suggestions to arrange my computers according to the teachings of Feng Shui, y'all driving me nuts ;) No offence, though, I love you all. It's just not the solution to the problem, so can we please get the point of that and stop trying random stuff ;)

                    https://instagram.com/morphoice - 80s inspired Synthwave Music, Arcade & Gameboy homebrew!

                    LindonL d.healeyD 2 Replies Last reply Reply Quote 0
                    • LindonL
                      Lindon @Morphoice
                      last edited by

                      @Morphoice well... let me get the hell out of your way then.

                      HISE Development for hire.
                      www.channelrobot.com

                      MorphoiceM 1 Reply Last reply Reply Quote 0
                      • d.healeyD
                        d.healey @Morphoice
                        last edited by

                        @Morphoice Usually compilers have flags you can set to control strictness. Maybe ask Chat GPT if such flags are available on Windows

                        Libre Wave - Freedom respecting instruments and effects
                        My Patreon - HISE tutorials
                        YouTube Channel - Public HISE tutorials

                        1 Reply Last reply Reply Quote 1
                        • MorphoiceM
                          Morphoice @Lindon
                          last edited by

                          @Lindon Please no hard feelings man, you know I appreciate your help. An external drive is just not the problem here, I've already tracked it down as good as I can

                          https://instagram.com/morphoice - 80s inspired Synthwave Music, Arcade & Gameboy homebrew!

                          LindonL 1 Reply Last reply Reply Quote 0
                          • orangeO
                            orange
                            last edited by orange

                            Yes, looks like it's related to Airwindows.h.

                            Maybe @oskarsh has an idea about this?

                            develop Branch / XCode 13.1
                            macOS Monterey / M1 Max

                            oskarshO 1 Reply Last reply Reply Quote 0
                            • LindonL
                              Lindon @Morphoice
                              last edited by Lindon

                              @Morphoice well I have a project that uses a single AirWindows scriptNode (its Air2) and it compiles fine on windows.

                              so the Additional Source code folder looks like this:

                              acd47eec-732e-4b4f-b688-29077553cbf1-image.png

                              the nodes folder looks like this:
                              c717c356-1e9f-4a2f-a6a0-78f6a468ab83-image.png

                              the Air2.h file in here looks like this:

                              // This just references the real file
                              
                              #include "../../DspNetworks/ThirdParty/Air2.h"
                              

                              The DspNetworks/ThirdParty folder looks like this:

                              36a962c2-5444-42e5-b9ce-e1a725fd7e41-image.png

                              Where the Air2.h file looks like this:

                              
                              #pragma once
                              
                              #include <JuceHeader.h>
                              
                              #include "../../AdditionalSourceCode/AirWindows.h"
                              
                              namespace airwindows::air2_ns {
                              JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE("-Wmultichar")
                              #include "../../External/airwindows/plugins/LinuxVST/src/Air2/Air2.h"
                              
                              #include "../../External/airwindows/plugins/LinuxVST/src/Air2/Air2.cpp"
                              #include "../../External/airwindows/plugins/LinuxVST/src/Air2/Air2Proc.cpp"
                              JUCE_END_IGNORE_WARNINGS_GCC_LIKE
                              }  // namespace airwindows::air2_ns
                              
                              namespace project {
                              
                              using namespace juce;
                              using namespace hise;
                              using namespace scriptnode;
                              
                              DECLARE_AIRWINDOWS_NODE(Air2, air2_ns);
                              
                              }  // namespace project
                              
                              

                              There is an External folder at the root of my project with these included files in there...

                              Im using VS2022 - I have not changed any flags in there...

                              HISE Development for hire.
                              www.channelrobot.com

                              1 Reply Last reply Reply Quote 0
                              • oskarshO
                                oskarsh @orange
                                last edited by

                                @orange yes some nodes seem to only work on windows and some only on macOS. The source code of my project can be compiled on windows and MacOS the same. Make sure to clear the binaries folder of the dsp networks. Do not delete any other folders.

                                When compiling make sure you first set all networks to not compile - then compile the dsp networks - open Hise and set your networks with Airwindows nodes to compile.

                                HISE Developer for hire :)

                                1 Reply Last reply Reply Quote 1
                                • First post
                                  Last post

                                10

                                Online

                                1.7k

                                Users

                                11.8k

                                Topics

                                102.4k

                                Posts