gen~, JUCE


    Jul 05 2017 | 8:35 pm
    hi
    I appreciate the effort that went into https://github.com/Cycling74/gen-plugin-export a few years ago....an example of exporting gen~ code into JUCE, and then buiding audio plugins. I tried it with macOS 10.12.5, Max 7.3.4, XCode 8.3.3, JUCE 5.0.2, and I get a few compile errors, pasted below.
    Any suggs, or advice to abandon this path and find some other route? I have an urgent need to share some DSP algorithms with film sound designers and unfortunately they don't all use Live (yet :-).
    The following build commands failed:
    CompileC build/C74GenPlugin.build/Debug/C74GenPlugin.build/Objects-normal/x86_64/PluginProcessor.o /Users/alex/JUCE/gen-plugin-export-master/Source-Plugin/PluginProcessor.cpp normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler
    CompileC build/C74GenPlugin.build/Debug/C74GenPlugin.build/Objects-normal/x86_64/PluginEditor.o /Users/alex/Dropbox/SubPac/JUCE/gen-plugin-export-master/Source-Plugin/PluginEditor.cpp normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler
    CompileC build/C74GenPlugin.build/Debug/C74GenPlugin.build/Objects-normal/x86_64/juce_AAX_Wrapper-30033AC6146DE144.o /Users/alex/JUCE/gen-plugin-export-master/JUCE/modules/juce_audio_plugin_client/AAX/juce_AAX_Wrapper.mm normal x86_64 objective-c++ com.apple.compilers.llvm.clang.1_0.compiler

    • Jul 06 2017 | 5:29 pm
      Hi Alex,
      I'm taking a look at this now and should have something for you shortly.
      Cheers!
    • Jul 06 2017 | 6:30 pm
      Hi Timothy,
      Thanks so much! Let me know if any additional info would be helpful. The errors vary depending on what plugin format I choose, and building for iOS seems to work. I've tried the older JUCE framework in the Git project as well as the latest.
      Thanks again for taking a look into this, much obliged.
      cheers
    • Jul 06 2017 | 7:27 pm
      Starting from the beginning... I'm on OS 10.12.4 with Xcode 8.3.3. I clone from https://github.com/Cycling74/gen-plugin-export and then open gen-example.maxpat in Max 7.3.4. I click the green message box that says "exportcode". And the Max window outputs a ton of stuff. 7 lines from the end it says:
      ** BUILD SUCCEEDED **
      I'm gathering that you do not experience this?
      If I open the Xcode project at VST-Builds/MacOSX/build/Debug/C74GenPlugin.xcodeproj and build then it also build successfully, albeit with 71 warnings.
      On second look though, I cannot tell what plug-in type are you targeting. I was assuming VST, but may this isn't true? The tip-off that it may not be true is the reference to "AAX" in your compiler errors.
      My next steps will be to upgrade my OS to 10.12.5 (and test) and then upgrade the version of JUCE to 5 (and test again).
      Thanks for any additional info you have.
    • Jul 06 2017 | 9:05 pm
      Yes, I was trying different plugin types. So I just did a regression test with a fresh clone, and still got:
      ...[tons of output, lots of warnings about multiple group membership, malformed project, etc.]...
      ** BUILD FAILED ** The following build commands failed: CompileC build/C74GenPlugin.build/Debug/C74GenPlugin.build/Objects-normal/x86_64/juce_VST_Wrapper-2E77B871A9FAD96A.o /Users/al ex/Downloads/gen-plugin-export-master/JUCE/modules/juce_audio_plugin_client/VST/juce_VST_Wrapper.cpp normal x86_64 c++ com.appl e.compilers.llvm.clang.1_0.compiler (1 failure)
      If I try building in Xcode, I get 128 linker errors that mostly mention AUMidiBase, AUEffectBase, etc. ?
      I remembered I was still using Max 7.3.3 so I tried again with 7.3.4. Same result.
      ------ If I change the exportscriptargs type to iOS, I get: ** BUILD FAILED ** The following build commands failed: CompileC build/C74GenPlugin.build/Debug/C74GenPlugin.build/Objects-normal/x86_64/juce_VST_Wrapper-2E77B871A9FAD96A.o /Users/al ex/Downloads/gen-plugin-export-master/JUCE/modules/juce_audio_plugin_client/VST/juce_VST_Wrapper.cpp normal x86_64 c++ com.appl e.compilers.llvm.clang.1_0.compiler (1 failure)
      BUT if I then build from Xcode, it succeeds and works in the iPhone simulator. ------ If I change to AU, now I get BUILD SUCCEEDED. However if I try loading the build (~/gen-plugin-export-master/AU-Builds/MacOSX/build/Debug/C74GenPlugin.component) the Max console reports: C74GenPlugin.component: no format AudioUnit exists I tried moving the component to /Library/Audio/Plug-Ins/Components/ and that didn’t help. Thanks again sooooo much for looking into this! cheers
    • Jul 06 2017 | 9:10 pm
      p.s. my intuition says when changing plugin type, maybe some intermediate output from the previous export needs to be cleaned up first. just a thought.
    • Jul 06 2017 | 9:47 pm
      The error in Max you posted is a VST plug-in build error. The next error you posted (from Xcode) is a link error for AudioUnit stuff (e.g. AUEffectBase) but the paths still look like you are build a VST. So that's strange.
      Have you followed the directions in the ReadMe to copy the various AudioUnit files into the Xcode application bundle? Sometimes updating Xcode will subsequently delete those files...
      FWIW, I did update to OS 10.12.5 and it made no difference -- things are still building fine for me for the VST.
    • Jul 07 2017 | 12:22 am
      Hi again... I've just pushed a new juce5 branch to the Github repository. It is working here but there could be wrinkles. At least we know it is possible to make it work!
    • Jul 07 2017 | 2:00 pm
      For the sake of this thread (Alex and I had moved the discussion to email), using the above "juce5" branch did indeed work for gen-plugin-export, JUCE 5, OS 10.12.5, Xcode 8.3.3, and Max 7.3.4.
      If anyone else is interested in how to get running with that, here is what I suggest...
      1. With the "juce5" branch version of the package, open the help patcher and click the green export button.
      If it succeeds, great! If not...
      2. Launch the Projucer app (in the JUCE folder).
      3. Open the jucer project in the Projucer. This will be called "tmp-C74-Gen-VSTPlugin.jucer" and located inside the "Jucer" folder.
      4. Click the little Xcode icon just right of center at the top of the window. This should generate an Xcode project and then open it in Xcode.
      5. Once it opens in Xcode, build the project in Xcode (click the "play" button).
    • Jul 07 2017 | 5:04 pm
      Indeed, the example is working now for all plugin formats. Thanks Tim for your phenomenal support!
    • Aug 11 2017 | 9:35 am
      I have a different issue...I'm not a programmer but know my way around max. when building in Xcode I get following issue: "Shell Script Invocation Error" please download and install the VST3 SDK Command /bin/sh failed with exit code 1
      in JUCE the right path is selected for VST (I followed the tutorial on their site...). I have googled quite a bit but not found a solution. Xcode 8.3.3, Max 7.3.4, macOS 10.12.6, JUCE 5.1.1
    • Aug 15 2017 | 5:49 pm
      some guidance for whomever wishes to add a UI

      Tutorial – Gen Patch going AU Plugin with UI

    • Aug 16 2017 | 9:43 pm
      Thank you Olav!!!
    • Aug 17 2017 | 2:15 am
    • Aug 17 2017 | 6:10 am
      ...with my mind on my patcher and my patcher on my mind....;-)
    • Nov 25 2017 | 1:03 pm
      Hi there . I spent hours trying to export gen~ and compile a vst . Under windows when using juce/introjucer (from original download) its working well and shows visual studio 2017, but when using the introjucer template in the folder from gen-code-export, it wont show . It just shows vs 2013 and then I get lots of errors when trying to compile.
      Any hints about hits? before i start a new thread
    • Nov 28 2017 | 2:10 pm
      introjucer needs to be updated for vs 2017. maybe use vs 2015 instead?
    • Nov 28 2017 | 3:18 pm
      Thats the funny fact wich is beyond my understanding. When using Juce normally an launching from its own recent donwloaded introjucer , it works just fine . But when trying code export , and using the provided templates with introjucer , It just shows vs 2015. Im wondering too if I should try to use vs2015 , but it can be tricky on Latest w 10 version maybe and cause some other problems perhaps
    • Dec 18 2017 | 5:58 pm
      Hi all , I had. the same problem here. please download and install the VST3 SDK Command /bin/sh failed with exit code 1
      I solved the problem by importing all the generated code from Source-Plugin ( overwriting the standard JUCE audio plugin files ) into a new projucer project. I also copied all the files from exported-code into the source directory without the nested directories. I might have had to add an absolute file path to find one of the header files . Can't remember. I succesfully built a .vst and component file from it. It seems to load and work in Cubase I will send it around to a few friends see if they can get it to load ..
      Sean
    • Dec 19 2017 | 12:49 am
      OLAV! I love your video! So helpful!! An easier way of solving the module paths that worked for me was to check "use global paths" in each module .. Sean
    • Dec 19 2017 | 12:01 pm
      you're very welcome! :-)...let's hope it still holds up for a while before some version of something changes and everything's different again...I'm happy to see it helps!
    • Dec 19 2017 | 10:13 pm
      Thanks Olav,
      I prefer PYO to max but I can't get it to compile properly inside juce. I am having a bit of trouble using the param in gen~ now.
      When I use the cycle operator with param it doesn't work in juce. Other operators combined with param seem to work .
      I am getting a tonne of compile errors once I include param ..
      int d8freq_dim = m_d8freq_18.dim;
      int d8freq_channels = m_d8freq_18.channels;
      "Member reference base type 't_sample' (aka 'double') is not a structure or union"
      I have a "cycle" in gen~ cycle d1freq and a "param" param d1freq 0.43 @min 0.1 @max 5 Can anyone shed any light here?
      Sean
    • Dec 20 2017 | 1:15 am
      I managed to solve the issue ... I created a float object above the cycle object with a param attached and sent the value of the float into the cycle object and it worked! Time to build a nice gui with Olav's help !!
    • Dec 21 2017 | 3:37 am
      OLAV! Look ! You rock !! Thanks!!!
      "I'm so happy I didn't have to type all that sh#t"
    • Dec 21 2017 | 8:48 am
      wow! happy to be of help! merry Christmas to all of you max-lers out there!
    • Dec 23 2017 | 1:50 am
      Merry Christmas! I have one final problem. When a sliders are saved as a preset in the DAW when a new preset is loaded the sliders head back to zero. I believe the preset is updated the values but not moving the sliders. Any clues out there on the internet ? Sean
    • Dec 23 2017 | 6:01 pm
      I am thinking of adding this to the JUCE processor class to snap the sliders to the position of all the parameters in the GEN74 struct
      I was thinking that I could try set the slider values in the processor class at this point .. ``` void C74GenAudioProcessor::setCurrentProgram (int index) {
      d1LevelSlider::setValue ( C74_GENPLUGIN::getparameter(1)) d2LevelSLier::setValue ( C74_GENPLUGIN::getparameter(2))
      } ```
      I might try that and see what happens ...
    • Dec 24 2017 | 12:44 am
      I came up with a sh#tty solution that works for now ..
      I created a textbutton called "Load Current Preset"
      The button just sets the value of the sliders to whatever is stored in the parameters of the C74 class
      eg :
      ``` d1LevelSlider->setValue(processor.getParameter(0)); d1freqSlider->setValue(processor.getParameter(1)); d1timeSlider->setValue(processor.getParameter(2)); ``` Perhaps it's better that only the editor class is messing with the slider pointers ...
      Calling all that stuff from setCurrentProgram (int index) within the processor class might cause threading issues I guess.
      Probably an experienced JUCE? C++ programmer ( not me! ) could figure out a more elegant solution. At lease it works pretty good! Sean
    • Jan 12 2018 | 3:55 pm
      :-) \m/
    • May 12 2018 | 12:43 pm
      OMGOMGOMG YES! I had been so stoked on this a couple years ago when I discovered it and got it working, but then I circled back around to it when I had more time and it didn't work, but just now thanks to this thread I got this working again using the new JUCE5 branch, and holy moly theres even a video about UI/JUCE.. Hell yes! I think that maybe this should become the main branch, because I was futzing around with the old version a few times this year and thought this got abandoned.. which would be kinda shocking.
      A few notes: The first time I tried with the new branch, I got an error from the script because I had a space in one of the directories names and it didn't even run anything. The second time It got pretty far but it couldn't find the VST SDK that I had installed based on the standard JUCE location of ~/SDKs/VST_SDK/VST3_SDK as the script was looking in ~/SDKs/VST3 SDK/ with the space instead of underscore and one directory up. This is odd in reference to my earlier error due to a space in the location of the patch folder having a space.
      Also in the new branch, do you really need the whole JUCE 5 distro? The examples and extras folder with all their subfolders for different platforms make this rather large, adding about 40mb to this. They have all also been superseded by tiny PIP projects in JUCE 5.3 for that matter.
    • May 20 2018 | 3:15 am
      Incidentally, the link in the max gen documentation for VST export results in a page not found : https://cycling74.com/wiki/index.php/error/404
    • May 20 2018 | 1:40 pm
      I have been working on figuring out a way to not have to copy-paste all the code as mentioned in the tutorial video by OLAV LERVIK to facilitate using the generated GUI directly without needing to copy paste, and in the process noticing a number of issues in the modifications to the JUCE project that I am trying to figure out how to fix. For one, the post compile script in the jucer project references the build-results directory which no longer exists, and also I can not quite figure out where the Xcode project is compiling to now.. it appears to be an alias thats directing the file to the user library vst plugins folder now.. so maybe this post compile script simply needs to be removed.
      Damn this is one hell of a wormhole..
    • Jun 19 2018 | 1:29 am
      hey'all,
      So I was very excited to find this thread as I'm having some of the same issues. Im on OS 10.12.5 using JUCE v5.3.2 and Xcode v8.3.2 So my initial error was the same as that of Sean and Olav: please download and install the VST3 SDK Command /bin/sh failed with exit code 1
      That was using the original package on github.
      I tried using the updated JUCE-5 branch and still had the same error code.
      I tried following Sean's tip above to open a new projucer project and move all my files into the source directory. this resulted in some different errors:
      Lexical or preprocessor issues > 'genlib.h' file not found
      I tried replacing it with an absolute path but then the next header wasn't found.I tried replacing all three with absolute paths and then everything broke real bad like dozens of errors, so I stepped back.
      maybe i should try moving all the stuff into the new Projucer project but with the original branch. not sure if Sean was using the original branch or the juce-5 branch.
      wondering if anyone knows what i might be doing wrong or how i could get this to work.
      Any help would be greatly appreciated! Thanks in advance!