Tutorials

Advanced Max: Standalones, Part 2

Want to build a standalone Mac or Windows application? With Max, you can do just that and I will show you how. The result is an independent application anyone can run on their Mac or Windows machine with no Max installation required.

Here’s the second in a series on creating standalone applications. Spend 42 minutes learning the basics on working with dependencies, scripting, and the fine art of trimming your standalone down to size.

All the tutorials in this series: Part 1, Part 2, Part 3, Part 4, Part 5

by Timothy Place on January 9, 2018

Ernest's icon

Again, thank you for the video. It seems we are on concurrent paths on this topic, so to speak, and there are a number of active topics on it. So I have shared the automation I have got done so far. before you make another 42-minute tutorial about it, in case you'd rather just press a single key in the future.

Greg Finger's icon

the lipo interlude and rabbit hole comment were perfect

i find this thread to be a good summary of the change standalones went through in Max7: https://cycling74.com/forums/standalone-file-size-in-max-7

Timothy Place's icon

Those are both great resources! Thanks for including links to them in this thread!

Ernest's icon

Apologies that I have been slow, but I needed to do quite a bit of structural design to make the script more usable. I'm currently adding dialog boxes so it doesn't need more hotkeys (currently it needs 2). v2 has a user guide here:

MaxMake2: Making Portable Collectives with your own Files

Philippe Montemont's icon

Hi Thimothy, hi friends,
Thank you for this interesting tutorial. I would like to know if you plan to tell us about [menubar] in standalones, especially this ******* "Quit" item: how to avoid abrupt and dangerous "quit" process, how to route it to a ( useful and much more secure) "save" routine, eventually how to (as in Max 4.x) route its shortcut to [menubar], etc.
On Windows machines, do you plan to telle us about missing .dlls?
Again, thank you for your work.
Best regards,
-P
www.toys-for-theater.com

Ernest's icon

A beta of the single-click makefile script is available for download at:

Timothy Place's icon

@Philippe We will definitely be getting into menubar and related topics in the coming weeks!

@Ernest Truly amazing!

billyanok's icon
Ernest's icon

I’m still investigating, and I found something which could be a big simplification for including writable files, because it lets you use arguments to specify filenames in buffer~, pattrstorage~, etc. The bit on the right of this patch sets Max searchpath in slot 5 to the absolute path of the {patcher-folder}/support/’ folder in patches and the {executable folder}/support/ folder in standalones.

Then on closing the patch, it returns the searchpath in slot 5 to the old value, if any, on closebang.

This result is that the patch thinks everything in the ./support/ folder is in the same folder as the patch. So arguments in objects now appear to work.

Max Patch
Copy patch and select New From Clipboard in Max.

Timothy Place's icon

Sweet!

I'll also note that we've solved the problems with the slow standalone build times on the Mac. So that improvement (along with some others for standalone building) will be coming in a future version of Max.

Greg Finger's icon

Nice! Looking forward to Max 8's standalone updates. Standalone is definitely one of the stronger features of Max, and it's continual development and refinement is very exciting.

I'm also wondering if in future tutorials videos we can get official instructions on codesigning an app. not sure if this is outside the scope of this video series, but it might be helpful to have this information available within this c74 official series instead of having to wade through forum threads of people piecing it together post by post.

cheers!

Timothy Place's icon

Yes, there is a plan to do a code-signing video. There is also one slot on the schedule to address any random questions that come in on the various comment threads -- so keep the great questions coming :-)

estevancarlos's icon

This is great. Would C74 ever consider creating a message for standalone, or something, that outputs the name of external used by the patch?

vokars's icon

I think the standalone feature is a key feature of Max. I am a Max user for several month now and I am really happy with it. Why so late? There are several reasons but one of them is: I always thought that a full Max installation and licence is necessary for running a Max patch and therefore Max patches seemed to have only limited value.
Yes: I regret my fault. And yes: I think it is really important, that the Cycling 74 marketing gives this feature a high priority.

mbmosher's icon

So lets say I have a patch with an sfplay~ object and several open messages going into it, like 'open myclip1.wav' and 'open myclip2.wav' etc. In Max if those clips are in the same directory as my patch it reads them fine, but if I drag them into the project window and build an application they don't seem to go with the build. Where would I put those audio files within the package contents for the sfplay~ open message to work?

Timothy Place's icon

@estevan If you use projects then it should list all of the externals used.

Also, if you go to the File menu in Max with your patcher open, there is an item at the bottom called "List Externals and Subpatcher Files".

Enjoy!

Timothy Place's icon

@MBMOSHER Within the Resources/C74 folder there a number of options. "media" and "misc" are probably where I would copy files like that.

Hope this helps!

tillfly's icon

Hey there,

as @PHILIPPE MONTEMONT I´m interested in missing dll files and its settings. if i´m building an app on PC 1 and when I execute it, everything works. when I transfer the app to PC 2, including a folder which has all the files I need in the app, it cant find the external plugin and settings have to be adjusted again with every start of the app.
how can I save the settings of the plugin within the built app?

roger.carruthers's icon

Hi,
Thanks for these tutorials - I am on the verge of putting my first app onto the AppStore, and this series has been absolutely invaluable...
However, I have a image file that's not showing up in the standalone - it's a .jpg that should be loaded into a jit.matrix on launch. All the other resources are loading fine, but this one is not playing ball.
I've tried including it via the Project manager, which didn't work, and also adding it manually to the package after it's been built - I'm dropping it into the /C74/Interfaces folder, which works when I test it on the machine it was built on, but not on another test machine - any ideas?

mohankumar v's icon


hi, i wish to build and distribute MAX MSP standalone apps with licensing. How do i secure my patch and code in windows and mac?Hi Patchers, I

Ernest's icon

Im sorry I had to give up on that. Hope you find a solution )

Roman Thilenius's icon

i dont even understand the question.