# Send a MIDI message every time a preset is loaded in Electra, possible?

**URL:** <https://forum.electra.one/t/send-a-midi-message-every-time-a-preset-is-loaded-in-electra-possible/2187>\
**Category:** General discussion\
**Created:** [June 19, 2023, 3:03pm UTC](https://forum.electra.one/t/send-a-midi-message-every-time-a-preset-is-loaded-in-electra-possible/2187 "2023-06-19T15:03:58Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Electrolove](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.electra.one/electrolove/32/2440_2.png) [@Electrolove](https://forum.electra.one/u/Electrolove)\
**Post date:** [June 19, 2023, 3:03pm UTC](https://forum.electra.one/t/send-a-midi-message-every-time-a-preset-is-loaded-in-electra-possible/2187/1 "2023-06-19T15:03:58Z")

</div>

Is it possible to send a MIDI message every time a preset is loaded in Electra? Just like MIDI Control/Configuration but in reverse. It would be good if, for example, Electra could send a program change to mioXL every time a preset is loaded.

---

<div class="post-metadata">

**Author:** ![phonaak](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.electra.one/phonaak/32/1822_2.png) [@phonaak](https://forum.electra.one/u/phonaak)\
**Post date:** [June 19, 2023, 4:08pm UTC](https://forum.electra.one/t/send-a-midi-message-every-time-a-preset-is-loaded-in-electra-possible/2187/2 "2023-06-19T16:08:01Z")

</div>

Hey!

I used to want the E1 send a midi cc message when changing pages.  
An m4l device was the solution, because e1 sends a sysex message when changing pages, the m4l device converts this sysex message into a midi cc message.

---

<div class="post-metadata">

**Author:** ![martin](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.electra.one/martin/32/145_2.png) [@martin](https://forum.electra.one/u/martin)\
**Post date:** [June 19, 2023, 4:16pm UTC](https://forum.electra.one/t/send-a-midi-message-every-time-a-preset-is-loaded-in-electra-possible/2187/3 "2023-06-19T16:16:15Z")

</div>

> [@Electrolove](#):
>
> Is it possible to send a MIDI message every time a preset is loaded in Electra? Just like MIDI Control/Configuration but in reverse. It would be good if, for example, Electra could send a program change to mioXL every time a preset is loaded.

I’d suggest to create a copy of a preset so that you have your own version. Then add the following to that preset using the Lua editor:

```auto
function preset.onLoad()
    midi.sendProgramChange (PORT_1, 1, 10)
end

```

The `preset.onLoad` is called whenever you switch a preset on the E1 controller. You can do any type of messaging in there. The above example demonstrates sending a program change message.

You can find more info on both function at [docs.electra,.one / Lua Extension](https://docs.electra.one/developers/luaext.html#a-brief-overview).

---

<div class="post-metadata">

**Author:** ![Electrolove](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.electra.one/electrolove/32/2440_2.png) [@Electrolove](https://forum.electra.one/u/Electrolove)\
**Post date:** [June 19, 2023, 5:20pm UTC](https://forum.electra.one/t/send-a-midi-message-every-time-a-preset-is-loaded-in-electra-possible/2187/4 "2023-06-19T17:20:28Z")

</div>

Thanks Martin. I will try it but how do I know the name of the mioXL Preset Selector port? I can only see PORT\_1, PORT\_2, PORT\_CTRL in the documentation. I’m guessing it’s the ports on the Electra.

---

<div class="post-metadata">

**Author:** ![martin](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.electra.one/martin/32/145_2.png) [@martin](https://forum.electra.one/u/martin)\
**Post date:** [June 19, 2023, 6:56pm UTC](https://forum.electra.one/t/send-a-midi-message-every-time-a-preset-is-loaded-in-electra-possible/2187/5 "2023-06-19T18:56:38Z")

</div>

This needs to be checked in MioXL documentation / forum. The Preset Selector port is be available only as a USB interface port on the computer where MioXL is connected. I tried to configure my Mio so that messages sent to MIDI IO DIN 1 are routed to the Preset Selector port. Just to see if program changes would work then. No luck though…

You might want to check this discussion… [https://gearspace.com/board/electronic-music-instruments-and-electronic-music-production/1297690-iconnectivity-mioxl-midi-interface-owners-here-20.html#post15991547](https://gearspace.com/board/electronic-music-instruments-and-electronic-music-production/1297690-iconnectivity-mioxl-midi-interface-owners-here-20.html#post15991547)
