Opening a max patch when computer turned on
I'm working on a max patch to some installation and I was wandering if I could make a specific max patch to be opened whenever the computer is turned on/reboot?
The computer I'll using is Windows PC.
It is straightforward(ish). I have my X-Mixer/X-Touch/CuBase executable load on each re-boot. It will work better if you "build" your patch into an executable as it will load faster into a much smaller footprint. Plus you can still open Max to work on other things whilst your executable runs in its own space. However, you will need to rebuild your executable any time you edit it.
1) Locate your .maxpat file (or .exe executable) using File Explorer. Right click on the file and select Send To and then Desktop (create shortcut). A shortcut to your patch will now be on your desktop.
2) The tricky bit - as it depends a bit on your version of Windows! You need to find where your start-up folder is. In order to find it, you will need to make sure that system folders are not hidden - there will be an option for this somewhere under the "View" menu. You now need to navigate from your user folder to the start-up folder. On my version of Windows 10, the path is:
C:\Users\<yourusername>\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup
3) Now copy or move your newly created shortcut from the desktop into this start-up folder.
You should only need to do steps 1 and 2 once provided that you don't move or rename your file. It won't matter if you edit/rebuild the file later - as the shortcut will still point to the correct location.
Now re-boot to check that it works.
run shell:startup
takes you to folder path :
/User/AppData/Roaming/Microsoft/Windows/Start Menu/Programs/Startup
place the patch there.
Patch will get launched if Max is set to open .maxpat files.
I'd rather build Standalone app.
I may suggest to use this crucial software https://w-shadow.com/blog/2009/03/04/restart-on-crash/
In my installations is the conditio sine qua non...
Not only will the program automatically start Max and the patch but it will monitor it and automatically restart the program in case of crash
Thank you all for the comments. If an audio file is involved as part of the patch ( I have one audio file and one max patch file located in the same folder) Can I do the above as well?
I'd rather build Standalone app.
Can I build a standalone app on my mac and open in late on Windows?
1) Locate your .maxpat file (or .exe executable) using File Explorer. Right click on the file and select Send To and then Desktop (create shortcut). A shortcut to your patch will now be on your desktop.
What if an audio file is involved as part of the patch? I need to shortcut to the audio file as well?
For the moment my audio file is located within the same folder of the max patch and when I load the patch I send a loadbang to trigger a message to the play~ object like below image:

you can not place patch and audio file in start folder.
Could you think of a reason ?
Also no sub-folder in start folder.
You would need absolute path to audio file.
Rather place that folder including both files somewhere
like Documents, and create shortcut to patch
in start folder.
It is possible to build Win standalone on Mac,
and oposite, but it needs more knowledge than max programming
and also some tools to extract windows installer, hack executables, resources etc.
you can not place patch and audio file in start folder.
Could you think of a reason ?
Because it will start and play the audio file when the computer will start?
Rather place that folder including both files somewhere
like Documents, and create shortcut to patch
in start folder.
so I should place the folder contains my max patch and audio file in Documents ,then create a shortcut only to the max patch is start folder?
I'll try it as soon as possible.
Thanks!
It is possible to build Win standalone on Mac,
and oposite, but it needs more knowledge than max programming
and also some tools to extract windows installer, hack executables, resources etc.
Thanks. Not at the moment for me
I doubt if the Mac and Windows executables will be directly interchangeable as the run-time library will be different. As Source Audio said, you’d have to hack the executable around to make it work.
If you use a shortcut to point to your patcher then that is enough. The file will actually be launched from its original location. Putting whole files/applications in the startup folder is not a good idea in Windows.
If you create a shortcut to your audio file and put that in the startup folder as well, then it will play the audio file using your default music player every time you start using the computer! Just create a shortcut for the patch and let Max (and your patch) do the rest.
P.S.
playing mp3 files is a fake.
Everytime you tell sfplay to play non-native audio format, it will get converted to wave file
in temporary folder, and even more stupid, it will be re-converted every time
you open the file, allready converted files get overwritten,
if not used again, max does not delete them,
so after a while one has a nice collection of unused wave files in temp folder.
I'd rather use wave file instead.
If you use a shortcut to point to your patcher then that is enough. The file will actually be launched from its original location.
Great! that's is all I need!
Everytime you tell sfplay to play non-native audio format, it will get converted to wave file
in temporary folder, and even more stupid, it will be re-converted every time
you open the file, allready converted files get overwritten,
if not used again, max does not delete them,
so after a while one has a nice collection of unused wave files in temp folder.
Wow! did not know that! I should locate those files and delete them! And change to wav format of course