Hi
Maybe no need for custom module. Edit : sorry but indeed as you want to trigger when receiving a midi signal as @abstrus said you have to use custom module. @abstrus do you confirm ?
Maybe this post can help you.
I haven't tried. Good luck