# Making faders work in reverse

**URL:** <https://forum.electra.one/t/making-faders-work-in-reverse/1679>\
**Category:** General discussion\
**Created:** [September 13, 2022, 1:30pm UTC](https://forum.electra.one/t/making-faders-work-in-reverse/1679 "2022-09-13T13:30:40Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![stuhoss](https://avatars.discourse-cdn.com/v4/letter/s/54ee81/32.png) [@stuhoss](https://forum.electra.one/u/stuhoss)\
**Post date:** [September 13, 2022, 1:30pm UTC](https://forum.electra.one/t/making-faders-work-in-reverse/1679/1 "2022-09-13T13:30:40Z")

</div>

I wonder if anyone with more experience creating presets can help me.

I am struggling to work out how if there is a way to make one of my faders work in reverse. I am trying to make a preset for my Yamaha TG33. One of the parameters expects a MIDI value of 127 to correspond to 0 and value of 0 to correspond to 99, rather than both going up together. Is there a simple way to account for this in the JSON?

Here is the JSON I have written for the parameter if that helps:

[  
“43”,  
“10”,  
“26”,  
“02”,  
“02”,  
“00”,  
“00”,  
“09”,  
“1”,  
“7f”,  
“00”,  
{  
“type”: “value”,  
“rules”: [  
{  
“type”: “sysex”,  
“parameterNumber”: 11,  
“parameterBitPosition”: 0,  
“byteBitPosition”: 0,  
“bitWidth”: 7  
}  
]  
}  
]

Thanks

---

<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:** [September 14, 2022, 6:51pm UTC](https://forum.electra.one/t/making-faders-work-in-reverse/1679/2 "2022-09-14T18:51:22Z")

</div>

Is this a control from a fader on the E1 into the TG33 only? In other words it is not the TG33 that sends a value you want to E1 fader to respond to?  
If it is only that, I’ll make you an example preset with such fader.

---

<div class="post-metadata">

**Author:** ![stuhoss](https://avatars.discourse-cdn.com/v4/letter/s/54ee81/32.png) [@stuhoss](https://forum.electra.one/u/stuhoss)\
**Post date:** [September 14, 2022, 9:54pm UTC](https://forum.electra.one/t/making-faders-work-in-reverse/1679/3 "2022-09-14T21:54:50Z")

</div>

Yes thats right, just from the E1 to the synth.  
That would be very kind, thanks so much!

---

<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:** [September 14, 2022, 10:02pm UTC](https://forum.electra.one/t/making-faders-work-in-reverse/1679/4 "2022-09-14T22:02:05Z")

</div>

I’ll look into it this weekend

---

<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:** [September 16, 2022, 7:58am UTC](https://forum.electra.one/t/making-faders-work-in-reverse/1679/5 "2022-09-16T07:58:19Z")

</div>

Check if this preset does what you look for (not a SysEx transmission but a CC transmission though).  
[https://app.electra.one/preset/M4ihuldZSRasuE2QtER7](https://app.electra.one/preset/M4ihuldZSRasuE2QtER7)

The ‘inverse fader’ itself is a virtual one, running from 0 to 99. But it sends out its value from 99 to 0 as a CC number with the same parameternumber (in this case 12).  
This is doen by ginve it the function “inverseValue” which then you need to program in lua:

> deviceId = 1  
> device = devices.get(deviceId)  
> devPort = device:getPort()  
> channel = device:getChannel()
> 
> function inverseValue(valueObject,value) ---- converts 0 to 99 and vice versa  
> local message = valueObject:getMessage ()  
> local paramNum = message:getParameterNumber()  
> midi.sendControlChange (devPort, channel, paramNum, 99-value)  
> end

The first 4 lines is just to initialise the values needed to find the right port abd MIDI channel. This preset is assuming you assign your fader to the first device.

The function itself first looks up the message the valueObject wants to send, then looks for the paramterNumber in the message. Then it reconstructs a MIDI CC message with the desired value.

If you need a SysEx example, let me know.

---

<div class="post-metadata">

**Author:** ![stuhoss](https://avatars.discourse-cdn.com/v4/letter/s/54ee81/32.png) [@stuhoss](https://forum.electra.one/u/stuhoss)\
**Post date:** [September 16, 2022, 8:38am UTC](https://forum.electra.one/t/making-faders-work-in-reverse/1679/6 "2022-09-16T08:38:27Z")

</div>

Thanks very much for this.

Would I need to copy the lines you have written into the start of the JSON I have for the fader? And replace ‘ControlChange’ with ‘Sysex’?

I’m not sure what you mean by ‘lua’?

---

<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:** [September 16, 2022, 10:10am UTC](https://forum.electra.one/t/making-faders-work-in-reverse/1679/7 "2022-09-16T10:10:24Z")

</div>

nope, that won’t work. My mistake.

By the way you answer, it’s clear the lua code is not yet your solution, as you need to address the TG33 via SysEx, not via CC, correct? It is indeed possible to add a function to a SysEx as well, but I need to test this, as I have not used a function in a SysEx json a lot myself.

I’ll come back to this in the weekend
