A couple standalone application questions…
I’ve been building a dynamic score system for use over a local network, and it’s finally ready to get used. In order to facilitate deployment I’m going with a standalone app as there are a few dependencies (using Bach externals, which are also dependent on fonts).
Making an app gets all the Bach stuff in order, and I found a plist attribute that lets you define a local font folder (inside the application itself), so it’s fully standalone at the moment, which is great.
Now I’ve been using Dan Nigrins amazing tutorial for making standalone apps:
But between all the steps required there, and the steps required to have the fonts be local, it’s a bit time consuming to produce a new version every time I change one of the core files. I’ve built it so the display/rendering engine is separate from everything else to avoid problems like this, but it’s still early days, so I am still working the files a bit.
So I have a few kind of advanced standalone app questions.
1) If nothing else changes (in terms of externals/dependencies), can I just save the patch as a new collective file, and place it inside the /Contents folder as a .mxf with the same name? (to avoid having to do all the grooming steps mentioned above)
2) Is it possible to declare a local assets folder, or a place for the files to look for files that are needed? Basically image/text files that are part of the composition the system will be displaying. It would be great if I can just throw all the required images into the /Resources folder, and have them show up when referenced in the patch as local files. OR, do you declare a folder structure for the file location like /Resources/1.jpg when referring to them inside Max?
3) If I have a settings.txt file, that contains each performers information, can that be placed in the /Resources folder too? Can I edit/change/replace it in there after the fact?
Ok, after some testing, I figured out answers to the questions, so for forum search-ability, here is what I know!
1) You can export a new collective, and just drop it in the /Contents folder and it works fine. I just launching the application just refers to that file. I don’t know if this will work once updating to a new Max/build engine or what, but in my brief tests, it was fully functional.
2) It seems like the /Resources folder is treated as the top level directory as far as the patch goes. Anything that is referred to with just a local file name (read file.wav, etc..) loads perfectly from the /Resources folder. You can add whatever you want to it, and it acts fine.
3) This applies to a settings.txt file, or any dependencies that aren’t abstractions/externals. Just stick them in /Resources, and you’re good to go!
I am now having a osc port issue as Max seems unhappy about having an application AND max being on the same port.
I’m trying to read/write a text (.txt) file as a preference file from a standalone application.
Do you know how to specify where to read/write from once the standalone application is built?
Currently it is writing a file to the directory the application resides in, which isn’t what I want.
Yeah, if you put it in /Contents/Resources, it shows up as ‘root level’ (ie, you can just refer to it).
Oh wait, I misunderstood your question I think.
inlets = 1;
outlets = 2;
autowatch = 1;
outlet(0, app_path + "your_app_name_here.app/Contents/Resources/the_nane_of_your_pref_file.txt");
Absolute head in hands business as usual!
The above JS takes the app path and spits out a path that you can prepend with ‘read’ or ‘write’ to read and write the text file, using the [text] object.
Not sure if this works on Windoze?!
Max patch below finds the app path..
----------begin_max5_patcher---------- 417.3ocwTF0aBBCDG+Y3SQSe1oTPbp6IS1C6E+DLMlJzIcAZIzRFaF+tu1CT YSLScIaubI8ti692e8N155fWKqXJLZJ5YjiyVWGGvk0gSyYGbFsJJkpfzvB1 ax0uh6UGRypzf6TIMdMUrYe.YoNko0umypKNFBhV1D9EoPq3e.AI988ZbmS0 QIbwlUErHc8GNJvDEQlXsi7rVei8PgDkYbgoSf3HMN4wflL57t.bqNJnYPGw yJ3zT7wRTq15ZXcty00Z5cgLIioTzMrSfxB7bZDWnkpDzSONcvr77TdDUykB 0f4zpvAKvmEX2Br7u2BnICs1fPfVjwmiV9mRK++BZclInBDMOek4RkbsHgb. IQxTYQcxVmHu9CaLjVTnCvEDBjq1dbjqav4cJ3FOw6+bP6gEEl7PJlH1.QKC OAlobAKRVJzse5udB20FZHfN.3jg.AC7thgNh2neE7fFA2uu8iLPqV+eknJY YQz9Kby+HPGkaLSo4BXIsUN0hrUZI73Xln83PFONWZ11aTAZYmOvWpnfIpeT VlEVD4F0j4vN2OgMsiFN -----------end_max5_patcher-----------
- This reply was modified 9 months by Mike S.
Forums > MaxMSP