# How to deal with parsed sysex values which differ from the CC ones

**URL:** <https://forum.electra.one/t/how-to-deal-with-parsed-sysex-values-which-differ-from-the-cc-ones/2685>\
**Category:** General discussion\
**Created:** [February 9, 2024, 7:19pm UTC](https://forum.electra.one/t/how-to-deal-with-parsed-sysex-values-which-differ-from-the-cc-ones/2685 "2024-02-09T19:19:03Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![SWK82](https://avatars.discourse-cdn.com/v4/letter/s/59ef9b/32.png) [@SWK82](https://forum.electra.one/u/SWK82)\
**Post date:** [February 9, 2024, 7:19pm UTC](https://forum.electra.one/t/how-to-deal-with-parsed-sysex-values-which-differ-from-the-cc-ones/2685/1 "2024-02-09T19:19:03Z")

</div>

Hi there !

This is my first post here, and it certainly won’t be my last! 🙂

First of all, thank you very much to everyone for the wealth of information on this forum.

My problem: I’ve created an instrument to control the parameters of my synth in CC and everything is working fine, I’ve been able to make a sysex request and the patch parsing that allows me to retrieve almost all the values currently in my edit buffer on the Elecra One.

Unfortunately, for some parameters the CC values don’t match the concerned byte values of the sysex that I receive.  
For example: in midi CC I send the values 0; 26; 49; 73; 97 and in the sysex it’s the values 0; 1; 2; 3; 9 that I get back. This means that parsing will work for this parameter but I imagine there is a workaround for this problem.

Could someone explain how to get around this problem?

I haven’t found a similar topic in the forum, my apologies if this question has already been asked.

Thank you in advance for your help!

François

---

<div class="post-metadata">

**Author:** ![busa](https://avatars.discourse-cdn.com/v4/letter/b/d78d45/32.png) [@busa](https://forum.electra.one/u/busa)\
**Post date:** [February 10, 2024, 8:42am UTC](https://forum.electra.one/t/how-to-deal-with-parsed-sysex-values-which-differ-from-the-cc-ones/2685/2 "2024-02-10T08:42:48Z")

</div>

Hi Francoise

See this Thread. I had the same Question. If you get stuck, don’t hesitate to ask again.

BR

> [@Patching: Map incoming Sysex-Value to Midi Range](https://forum.electra.one/t/patching-map-incoming-sysex-value-to-midi-range/2667):
>
> Hi There I have a Fader configured with 4 Values A,B,C,D (0-3) and Midi-Range 0-127. So the outgoing Midi Values are 0 for “A”, 42 for “B” , 85 for “C” & 127 for “D”. The corresponding Sysex-Value consists only of 2 Bits to represent the 4 Values. If i Patch them with JSON, i only get Values 0-3 → “A”, as all Sysex-Values fall into the Range 0-42 which is “A”. Is there a easy way to map the parsed Sysex Value to the Midi Value? Something like “mappRange:” 0,3,0,127 thx Busa

---

<div class="post-metadata">

**Author:** ![SWK82](https://avatars.discourse-cdn.com/v4/letter/s/59ef9b/32.png) [@SWK82](https://forum.electra.one/u/SWK82)\
**Post date:** [February 17, 2024, 12:52pm UTC](https://forum.electra.one/t/how-to-deal-with-parsed-sysex-values-which-differ-from-the-cc-ones/2685/3 "2024-02-17T12:52:54Z")

</div>

Hi Busa,  
Many thanks for your quick response ! I did’t find your thread, sorry.

I tried the following lua code, but there is a problem :

![image](https://europe1.discourse-cdn.com/flex017/uploads/electraone/original/2X/b/b36883e285f044fba018e8c5129e9ae748e7d92a.png)

The problem is that I have to push the patch request button twice to get the the PT\_CC7 104 to update with the correct value and the second time it also sends out the CC value (which I actually don’t care because it sends the value which is actually set, so it doesn’t have any effet).

This is the behaviour when I change the parameter on my synth:

**First patch request button press:**  
The virtual parameter (1104) is correctly updated with the parsed sysex response from the synth but there’s no other change happening

**Second patch request button press:**  
PT\_CC7 104 is updated with the corresponding value according to the function and it does send out the CC value (which is not necessary).

Any idea what I’m doing wrong ? In advance, many thanks for your precious help !

---

<div class="post-metadata">

**Author:** ![busa](https://avatars.discourse-cdn.com/v4/letter/b/d78d45/32.png) [@busa](https://forum.electra.one/u/busa)\
**Post date:** [February 17, 2024, 6:35pm UTC](https://forum.electra.one/t/how-to-deal-with-parsed-sysex-values-which-differ-from-the-cc-ones/2685/4 "2024-02-17T18:35:19Z")

</div>

Hi  
I think you get the Value of the PT\_Virtual 1104 BEFORE it has been updated. So i would just use parameterMap.onChange to see if PT\_Virtual 1104 has changed and then based on this change, i would update the PT\_CC7 104.  
The Midi Messages are send as you are changing a PT\_CC7 Value which triggers the sending.

```auto
function parameterMap.onChange (valueObjects, origin, value)
    if(valueObject:getId () == "1104") then
            if (value == 0) then parameterMap.set (deviceId, PT_CC7, 104, 0) end
            ....
    end

end

```

---

<div class="post-metadata">

**Author:** ![SWK82](https://avatars.discourse-cdn.com/v4/letter/s/59ef9b/32.png) [@SWK82](https://forum.electra.one/u/SWK82)\
**Post date:** [January 12, 2025, 7:27pm UTC](https://forum.electra.one/t/how-to-deal-with-parsed-sysex-values-which-differ-from-the-cc-ones/2685/5 "2025-01-12T19:27:48Z")

</div>

Hi there,

First, many thanks for your help.

Almost a year later and I’ve got some time to work again on my presets. This time it was on my Maad Cheetah MS6, and I ran into the same problem. Finally, I’ve got it to work with patch.onResponse instead of patch.onRequest. I think that was the problem.  
Then I inspired myself form @NewIgnis 's code from your liked discussion.

Again, many thanks to all !

````auto
deviceId = 1
device = devices.get(deviceId)

function finishParsing()
    local parameterNumber={49, 17, 55, 56, 15, 27, 47, 48}
    local negativeFactor={0, 0, 0, 0, 48, 48, 32, 32}
    local value = 0 
    local sign = 0 
    for i = 1, 8 do
       value = parameterMap.get (deviceId , PT_VIRTUAL, 2000+parameterNumber[i])
       sign = parameterMap.get (deviceId , PT_VIRTUAL, 3000+parameterNumber[i])
       if(sign == 0)
        then
            value = value + 64
        else
            value = value + negativeFactor[i]
        end              
       parameterMap.set(deviceId, PT_CC7,parameterNumber[i],value)
       print ("Done!")
    end
  end

  function patch.onResponse (device)
    finishParsing()
end```
````
