I’ve been trying to make a MaxMsp external that uses the JUCE framework, but I seem to be getting nowhere.
I have tried plenty of things and for the moment I have minimised to something as simple as this,
Created a projuicer project.
Opened it in Xcode and implemented the necessary code.
In the same Xcode project I included an additional target - the .mxo object.
Linked the maxmspsdk.xcconfig and the Info.plist file to that object.
Included the C code to create the external (in fact copied from a previous project as for now I only want the project to compile).
Built the xcode project, both the .app and the .mxo were created.
AFAIK neither JUCE nor Cycling’74 officially support that trick. Thus it is rather dangerous to base your external on this. It could break at any time. At the time i did my tests Jules fixed some stuff to make it work again (5 years ago), but i’m not sure it is the ROLI policy and/or priority now. I’m not aware of people that to do this in a released product. Is there?
I don’t know if there will be a strong demand for such a solution in the future. But for now the ability to make your code portable is a big plus.
I really wish that due to the Max UI externals being limited (compared to the Juce library/framework) a solution to link the two in an easy way will be possible in the future…
Since you are here now, I would like to ask you one thing
So, I have made one of your examples (jojoSlider) compile. Both the .mxo and library are being created but the .mxo is an empty bundle, i.e. it doesn’t contain the executable that Max needs. Do you have any idea why?
Your settings, build phases, etc seem to be correct but something is not getting included in the final .mxo any thoughts?
First i have to say that i don’t use JUCE nor Max/MSP since many years… At that time I have struggled with the Projucer (Introjucer IIRC) to make it export the proper target for Xcode with all the filepath required.
I extracted above the specific “.jucer” settings (commented below):
An “.mxo” is just a macOS “bundle” (a dll wrapped in a specific file hierarchy). Thus you probably need to say to the jucer that your project is a plugin (audioplug).
Include the info.plist provided by Cycling’74.
Define the linker path to the framework maxAPI.
Ditto (a trick to make file path easily modifiable).
Just the compiler flags.
This is one is really important “WRAPPER_EXTENSION = mxo” others are not.
(After a quick build-and-look on the current Projucer app) i’m not sure at all that choosing “audio plugin” works nowaday. Probably that a best approach should be to export as a dll, and use a post-build script to make the package by yourself…
I never got this working for OSX with Projucer - I have to handcraft my own XCode project files - on Windows Projcer can create something that can build an mxe.
I finally had some time to look into it more. Thank you for the Juce settings, it was very helpful to verify what I’ve done… but unfortunately no great changes still…
I still cannot make it work… Even though it compiles, the final .mxo/Contents/Resources folder does not include the necessary executable…
I’ve also briefly tried with building the dynamic library but I don’t have much experience with dlls and so I didn’t get far.
Anyway i’m not even sure that a dll project is a good idea since the executable seems to be a “Mach-O bundle” type. Sorry it is too far in my memory (I switched to “PureData” since that time).
The problem with a handcraft Xcode project is that it can be hard to configure the JUCE machinery. And the problem with the Projucer is that it can be hard (if it is possible now) to configure it to make a Max/MSP external.
I don’t have valid licenses anymore (that’s why i dropped the JOJO examples) and so i can’t really help you more.