# Dynamic CC Switching - 14bit Signed

**URL:** <https://forum.electra.one/t/dynamic-cc-switching-14bit-signed/3767>\
**Category:** Developers\
**Created:** [June 19, 2025, 4:20pm UTC](https://forum.electra.one/t/dynamic-cc-switching-14bit-signed/3767 "2025-06-19T16:20:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mlanghausen](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.electra.one/mlanghausen/32/3221_2.png) [@mlanghausen](https://forum.electra.one/u/mlanghausen)\
**Post date:** [June 19, 2025, 4:20pm UTC](https://forum.electra.one/t/dynamic-cc-switching-14bit-signed/3767/1 "2025-06-19T16:20:10Z")

</div>

Hello!  
I am trying to get the following to work but keep going in circles -  
The Current script “Control B” the Fader is getting stuck at 0  
I know this has to do with the 14bit Signed Messages but i do not know how to fix it and ChatGPT keeps running in circles on this one.

The commented out Code on this works 100% for 7bit messages but gets buggy as well on 14bit messages. What I mean by buggy, A bipolar control when the control is touched… jumps to the far left negative value and does not respect the 0 (Middle position)

> **[Electra One App](https://app.electra.one/preset/3YcReB6cjsbseYxu4OtA)**

Any thoughts, help?  
@martin

---

<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:** [July 6, 2025, 5:37am UTC](https://forum.electra.one/t/dynamic-cc-switching-14bit-signed/3767/2 "2025-07-06T05:37:12Z")

</div>

Hi, I have played around with the preset and I am a little bit confused what you want to achieve (from the Lua code).

If you wanted the CC ASSIGN 01 list to set the 14-bit CC message parameter for the first fader, the simplest way of doing that is:

```auto
-- Assigned to Control A (ID 1)
function getValue(valueObject, value)
  currentCC = ccMap[value] or 3
  print("Selected CC from Control A: " .. currentCC)
end

-- Assigned to Control B (ID 3)
function getMidiMessage(valueObject, value)
  local cc = currentCC or 3
  local msg = valueObject:getMessage()
  msg:setParameterNumber(cc)
end

```

providing I left the rest of the code untouched, it relies on existence of the `currentCC` global variable.

This code (as well as your original) does not retain the current values of the parameters managed by the CC ASSIGN 01 list. When you change a parameter, the newly selected parameter will continue from where the previous one left off. If you wanted to retain the values, an extra logic needs to be added.

I hope this will help you to get out of the circles. If not, let me know 🙂
