Same control sends CC and Sysex?

I want to send a CC parameter from control 1. When I change the value of control 2, I want control 1 to change so that it sends a sysex parameter instead. How do I do that in LUA? I assume that setType(PT_CC7) and setType(PT_SYSEX) should be used to determine what type of message the control should send. And I assume that setParameterNumber(x) determines which parameter number the control should send. I assume that setRange() determines which range the control should have.

But how do I decide what the control should send when in sysex type mode (PT_SYSEX)?

F0 3E 13 00 20 00 01 48 XX F7

I’d suggest you create control 1 as a virtual control. Depending on the value of control 2 ( with parameterMap.get) you send out Midi CC or Midi Sysex, using the appropriate Midi functions as found in the documentation

1 Like

Do you have the time/desire to make a simple example as a starting point? I’m sure others on the forum would find it interesting as well.

sure, will look at it and i will come back

1 Like

I just made it, but without testing it. I’ll check it tonight.

https://app.electra.one/preset/ZAPwlVCm7icQq1Ew1LIL

1 Like

Thank you very much for the code. I’ll check it out and hope I learn something :grinning:

yep tested, and works as designed.
You’ll see 2 ports in the codes: first part is the initialisation of the device characteristics so I do not need to hardcode its MIDI channel and port.
The second part is the function, called by the fader, that will send a CC or SysEx based on the option list.

1 Like

Thanks @NewIgnis This is what I needed to understand how to solve my problem.

1 Like