Send midi value when Device is Selected ?

bob mo's icon

Hi everyone,

Well sorry but my first steps on max are going very badly... I thought I could easily reach my goal without help... but I have to resolve to call on the community:

I have a simple m4l device that allows to send a midi message "bank pgm 1" to a midi controller, for this part it's good,

But I would like to send the midi value "1" each time the device is selected and only when it is selected. It may be simple but. i've been struggling for over a week.

I've tried a lot of useless things: "live.observer is active" "live.thisdevice" "live.observer selected_device"

Nothing works... but I think I'm not far from succeeding

Thank you for your precious help !

Om