Is there a way to programatically set signMode to twosComplement on a virtual control?
I’m trying to use a control for differing value ranges depending on the setting of another control, but I can’t find a way to set the range to include negative values in a Lua function.
You might find inspiration in presets for synths with multi fx. They typically reuse the same controls for all the effects, but depending of fx type the name, color, range of the control is different.
For instance the preset for the korg 03R/W contains a method for this dynamic change in control behaviour. Having negative values is a part of it.
Thanks, Martin. I will take a look. I am not having any issue with dynamic changes of the controls, rearranging everything on and between pages, changing color, graphics, etc. It is one of the things I am loving most about E1.
It is just the signMode that I haven’t found dynamic access to. Maybe there is another way to switch this behavior dynamically that I’m not thinking of. Sometimes we don’t see the forest for the trees!
Excellent device, this E1. Kudos for what you guys are doing!
In the 03R/W preset’s lua, take a look at this function (I took out what was about names and colours): particularly look at the instructions ctrlValue:setMin (x) and ctrlValue:setMax (y)
Install the preset on your E1 and change the FX type , so you see the impact yourself
function setFx(valueObject,value) ---- hides the non used controls of effects
local fx2 = 0
local message = valueObject:getMessage ()
if message:getParameterNumber () == 152 then fx2 = 12 end
local visible = true
local ctrlValue= {}
local index =0
if value == 0 then visible=false end
for i = 115+fx2,116+fx2 do
control = controls.get (i)
control:setVisible (visible )
end
if value ~= 0 then index =fxIndirectRef[value] end
for i = 1,7 do
control = controls.get (j)
if value~=0 then name = fxNames[index][i] end
if value == 0 or name == 0 or name == nil then control:setVisible (false)
else
ctrlValue = control:getValue ("")
if ctrlMin[index][i]~=nil then ctrlValue:setMin (ctrlMin[index][i])
elseif string.sub(name,1,2) == "eq" then ctrlValue:setMin (-12)
else ctrlValue:setMin (0) end
if ctrlMax[index][i]~=nil then ctrlValue:setMax (ctrlMax[index][i])
elseif string.sub(name,1,2) == "eq" then ctrlValue:setMax (12)
else ctrlValue:setMax (99) end
end
end
end
Oh, I am familiar with you! I’ve read through hundreds of your posts and I very much appreciate all that you have contributed to this amazing thing. I have learned a great deal from you, especially your step by step patch parsing tutorial. I am very gracious.
I did look through the 03R/W preset and paid special attention to the section you mentioned. I just had a little confusion between display value and midi value and so far I think I have it worked out.
I am working on the Ensoniq DP/4 and configuring pages for each of the Units and their associated algorithms. So far I am happy with how the pages are being reconstructed when a new algorithm is selected or a patchResponse is received, but I still have a lot of work to do.
The bulk of the sysex messages on DP/4 are full 8-bit, constructed from the right 4 bits of two individual 7-bit midi messages, so the message contruction is happening in a Lua function. In particular, I was working out the handling of twosComplement values ranging from -128 to 127. I thought I would be able to simply set the absolute value and the signMode, but I didn’t see the signMode selection menu when the control was set for a Lua function, so I wasn’t sure if I was missing something.
I am constructing the two bytes to be sent within the Lua function and sending them with the midi.sendSysex function and the display values are correctly being shown. I think I am just having a little confusion with the difference between control values and message values and how they relate to the parameterMap and the sysex being sent/received explicitly via a Lua function. I am working through it, though.
I only found out about and subsequently purchased my Electra One a few weeks ago so we are still getting acquainted! I absolutely LOVE this device and the associated community and hope to be able to contribute more once I’m more familiar with the structure and method. Thanks to you and all of the other contributors here for the time you have put in.