Launching a specific file when Max/MSP opens, following a crash

Apr 9, 2013 at 5:09pm

Launching a specific file when Max/MSP opens, following a crash

I’m looking at trying to find a way to reopen a specific file if a crash occurs within Max/MSP.

I’m using Lingon to check whether or not Max has crashed, and whenever a crash occurs, it triggers Max to reopen. Which is great for reopening the program itself, the problem being I also want to have a specific patch open when Max reopens. I was wondering if there is some place that I can add something that would allow for this to happen.

Unfortunately this has come up regarding a patch that I can’t turn into a standalone app at this point in time and so I’m hoping to find a way to have this happen as I’ve described above. Anyone have any suggestions?

Apr 9, 2013 at 6:13pm

Which OS? You could do this with a shell script on OSX.

Apr 9, 2013 at 6:21pm

I’m using OSX. How does that work with a shell script? I hadn’t thought of trying it that way….

Apr 9, 2013 at 7:44pm

I used to use a script like:

watcher () {
while [ forever ]
	export TMOUT=10
	read a b c
	echo "OSC input $a $b $c"
        if [ $b -eq 1 ] ; then
		echo "Installation is running."
		echo "Restarting installation."
 		open -a /Applications/MaxMSP 4.6/ "/Users/mzed/Desktop/Watchdog/bad_installation.mxb"
 		# The next line sends an alert email
 		#echo "Your installation is being restarted" | mail -s "Restart!"
dumpOSC -quiet 1750 | watcher

CNMAT’s dumpOSC seems a little difficult to find, though.

I was calling it with cron, although it could be adjusted to run in a loop and sleep between checks.


Apr 9, 2013 at 9:33pm

Cool. Thanks so much. I’ll check it out… I’m toying around with a couple of other ideas with all of this. The dumpOSC etc is giving some issues, but I may get around that. Thanks again!

Apr 9, 2013 at 9:54pm

I would probably check if:

ps aux | grep | wc -l

was greater than 1, and ignore OSC.



You must be logged in to reply to this topic.