# Same control sends CC and Sysex?

**URL:** <https://forum.electra.one/t/same-control-sends-cc-and-sysex/3189>\
**Category:** General discussion\
**Created:** [August 28, 2024, 3:49pm UTC](https://forum.electra.one/t/same-control-sends-cc-and-sysex/3189 "2024-08-28T15:49:02Z")\
**Posts on this page:** 8\
**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:** [August 28, 2024, 3:49pm UTC](https://forum.electra.one/t/same-control-sends-cc-and-sysex/3189/1 "2024-08-28T15:49:02Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![NewIgnis](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.electra.one/newignis/32/767_2.png) [@NewIgnis](https://forum.electra.one/u/NewIgnis)\
**Post date:** [August 28, 2024, 6:50pm UTC](https://forum.electra.one/t/same-control-sends-cc-and-sysex/3189/2 "2024-08-28T18:50:08Z")

</div>

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

---

<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:** [August 29, 2024, 5:33am UTC](https://forum.electra.one/t/same-control-sends-cc-and-sysex/3189/3 "2024-08-29T05:33:33Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![NewIgnis](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.electra.one/newignis/32/767_2.png) [@NewIgnis](https://forum.electra.one/u/NewIgnis)\
**Post date:** [August 29, 2024, 6:13am UTC](https://forum.electra.one/t/same-control-sends-cc-and-sysex/3189/4 "2024-08-29T06:13:21Z")

</div>

sure, will look at it and i will come back

---

<div class="post-metadata">

**Author:** ![NewIgnis](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.electra.one/newignis/32/767_2.png) [@NewIgnis](https://forum.electra.one/u/NewIgnis)\
**Post date:** [August 29, 2024, 11:13am UTC](https://forum.electra.one/t/same-control-sends-cc-and-sysex/3189/5 "2024-08-29T11:13:44Z")

</div>

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

[https://app.electra.one/preset/ZAPwlVCm7icQq1Ew1LIL](https://app.electra.one/preset/ZAPwlVCm7icQq1Ew1LIL)

---

<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:** [August 29, 2024, 11:51am UTC](https://forum.electra.one/t/same-control-sends-cc-and-sysex/3189/6 "2024-08-29T11:51:42Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![NewIgnis](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.electra.one/newignis/32/767_2.png) [@NewIgnis](https://forum.electra.one/u/NewIgnis)\
**Post date:** [August 29, 2024, 7:36pm UTC](https://forum.electra.one/t/same-control-sends-cc-and-sysex/3189/7 "2024-08-29T19:36:29Z")

</div>

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.

---

<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:** [August 30, 2024, 3:53am UTC](https://forum.electra.one/t/same-control-sends-cc-and-sysex/3189/8 "2024-08-30T03:53:23Z")

</div>

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