So I’ve been playing around with setting up Electra as a DAW controller.
In some implementations, things like muting a channels is achieved by sending Note ON 127. Unmuting that channel requires a Note ON 127 as well, not a Note OFF - which seems to be the default behavior with the Note pad. Having on value/off value in the Note pad would achieve this - I tried changing the JSON preset file directly, but I believe those values are not implemented in the case of Note.
I understand this is quite a fringe situation, thus I’ve been trying to implement this behavior via Lua sending the MIDI message I want and setting the pad as virtual instead of Note.
But in this case, the limitation I have is when receiving the status from the DAW. Is there any way to handle that callback? parameterMap.onChange is the closest I’ve seen, but it seems to be triggered only when “something” happens in the controller, not when something external is sent to it.
The console reacts to incoming messages (processMIDI), but as the pad does not have a note assigned (it’s virtual), I guess it’s not sent to any control.
do i understand it correctly that when you send a note on message from e.one to your daw you want to trigger another action based on what the daw sends back?
there are some lua examples on martins git.
I think its really possible to do something not only on the message type but as wel on the actual message.
‘’‘if midiMessage.type == SYSEX and data == … then’’’
Thanks @Flyweight . That would indeed work for what I want to do given that I cannot easily change the Note pad via the GUI or JSON for what I see.
But my understanding is that the examples in that particular repo from Martin (GitHub - martinpavlas/electra.lua) is for running Lua in standalone mode, not in preset Lua. And for that a special firmware is required. Is that not the case?
I’ve tried the example you mentioned but I cannot get it to trigger at all while the console indicates ElectraMidi::processMidi is called…
Electra’s Midi controller firmware is designed to track and maintain the state of the MIDI parameters (all types including note on/off). It is a feature that allows us to do many cool things but it can represent a limitation in certain situations.
Yes, it does. The parameterMap is responsible for keeping the values of the parameters and distributing the changes to all controls and MIDI devices linked to it. It means it also reflects changes coming via the MIDI.
In order for a parameter to be tracked, it needs to exist in the map. Normally this happens when you add a Control (with given parameter). As you created a Control with a virtual parameter, the actual note on parameter is not present there. This is easy to resolve in Lua.
The harder part is that the Lua extension does not give you a way to register a callback or call processMidi when MIDI message is received. I will check that but it should be fairly easy to do for me. I am very close to releasing a new version of the firmware. I might be able to squeeze this in.
Once, you would be able to run the callback function on incoming MIDI data, you could use the parameterMap functions to set the parameters as you need and Electra will update all linked Controls accordingly.
Thanks Martin, I believe it’d be cool to have loopbacks on virtual parameters.
Also, having a NoteOff/NoteOn value on the GUI of the app for the Note type would be great. If I could set both of those up to 127, I believe my particular issue would be fully resolved. I’m aware this is quite a special case though…