Ranged Selections - Not Defaulting to the Top of a List When Receiving Values Not in a List

I’m working on a preset for Black Corporation’s Deckard’s Dream. There are a few sliders that have ranged selections. Specifically, there are Octave/Feet sliders that have 6 sections between 2’ and 16’. The slider has divets that stop at 6 places along the pathway.

The MIDI CC is a 0 - 127 slider, but the device recognizes ranges of: 0-21/22-42/43-63/64-84/85-105/106-127.

So I attempted to make a selection button. I determined the CC number of each of the 6 divets. So I made a list with 6 values at each of the stopping points along the slider.

However, when the EO receives a value in between the values on the list, it defaults to the first selection at the top of the list.

Is there a way to keep the current selection until the next value in the list is reached?

For example, the selection 16’ has a stopping point at the end of the slider at value 127. The next stopping point is 106 for the 8’ selection. The list has the first selection (2’) at the top of the list with value 0. So, under the current setup, when the slider moves off of the 16’ position, a value of 126 is received by the EO. Because 126 is not in the list, the EO defaults to the top item in the list so we move from 16’ to 2’, and then to 8’ when the slider gets to 106.

I propose a method of keeping the last item in the list displayed/selected until a new value in the list is reached/triggered.

My workaround for this required me to create a list of 128 items, which is tedious and wasteful of memory.

Hi, a way to resolve with some lua code.
You need to change the control into a virtual one and assign it a function, for instance ‘sixValues’.
In lua you create a function where you add a conditional statement saying if value > 105 then value = 127 elseif value >84 then value = 105 etc. Next you add a midi CC send instruction.

If you’re not familiar with lua and some one else hasn’t done it for you yet, I’ll post the correct instructions here tonight.

1 Like

I apologize as Lua is a bit above my pay grade, currently. I haven’t been able to wrap my head around it yet.

My solution won’t work, I just realised, as it is not bidrectional, which is what you expect from a Midi CC.
I have a solution in my head, but I’ll have to test it myself before I provide you the code.
As I’ve just been informed I 'm going to a concert tonight, it’s gonna be friday or saturday before I can do it.
But we’ll get it figured out !

Couldn’t resist testing it today :smiley:

I took a copy of your preset Electra One App
You should take over the lua code inside it and change the 2 CC’s 102 and 103 like I did with 102:

deviceId = 1
device= devices.get(deviceId)

function midi.onControlChange (midiInput, channel, controllerNumber, value)
   if channel == device:getChannel () and (controllerNumber == 102 or  controllerNumber == 103) then 
     if value >105 then value = 110
        elseif value > 84 then value = 88
        elseif value > 63 then value = 66
        elseif value > 42 then value = 44
        elseif value > 21 then value = 22
        else value = 0
   parameterMap.set (deviceId, PT_CC7, controllerNumber, value)

Maybe you might need to set other values than 110, 88, 66 etc but I love a bit of straightforwardedness.

But this should do what you need:

  • the first line assumes you used the first device (which you did)
  • the function checks if CC102 or CC103 is being ‘heard’ on the channel of that first device.
  • if it is, it sets those varying values to fixed ones, and then (via parameterMap) sets the appropiate controller of the E1 to that value.

Let me know if it works , then I take down my preset example

1 Like

Thank you SO much for doing the work on this. I’m honestly going to have to take some time and learn how to use Lua on the EO. I’m still a bit confused about the whole process but I’ll have to parse the code line by line and figure out how the EO is processing it.

for now, you can safely enter the code provided in lua to make it work.
keep me posted