Get host application?

wackazong's icon

Hi, is there a way for my M4L device to find out whether it is opened in Max (for editing) or in Live?

Thanks, ALEXander.

broc's icon
Max Patch
Copy patch and select New From Clipboard in Max.

A main difference is the availability of midi ports. So [midiinfo] will give different results.
Here is an example patch (on Mac).

AlexHarker's icon
Max Patch
Copy patch and select New From Clipboard in Max.

I don't run M4L here so I don't know what this will do. However, you could try running this in each environment and seeing what happens - you might need regex or something to deal with th output if it works.

broc's icon

For some reason the 'max sendapppath' message doesn't seem to work.
It gives me the same path in each environment, namely path to Max5.

amounra's icon

Last outet of live.this_device I think...

broc's icon

I've just checked that [live.thisdevice] last outlet delivers following states:

0: device in editor non-preview mode
1: device in editor preview mode (default)
1: device in performance mode

So unfortunately, it doesn't just separate editor vs. performance mode.