Midi messages in particular modes

It would be great if we could set the midi messages to external devices to send only in certain modes. I’d like to use scene mode to just send pc messages to an external pedal but the messages also send when in stomp mode.