May 13, 2018 at 10:29 am #83854
So I’m still tinkering with my panel and have made some improvements and ironed out a few bugs. Now for completeness there is an issue I have noticed that would be good to address, it is as follows.
When entering values on the synth Ctrlr uiSliders mirror those changes perfectly. However Ctrlr uiCombos do not!
I am not referring to receiving tone edit Sysex dumps these work fine, the issue is with CC messages transmitted by the synth during parameter edits made via the synth.
For example I have a uiCombo with three values in the Combo contents window, these are:
The MIDI data for these is:
$08 (08) $yy yy= $00-$1f (0-31) 16' $20-$3f (32-63) 8' $40-$7f (64-127) 4'
So do I need amend the ‘Expression to evaluate when calculating modulator value from midi message value field’? Do I need to attach a method to the ‘Called to calculate new modulator value from midi value’ popup? I have fiddled around with both of these but not really knowing what I am doing all attempts failed.
Any assistance is always appreciated.
Thanks.May 13, 2018 at 2:02 pm #83861
I haven’t studied this problem so far but did you check what message the synth sends? E.g. when you entered in the Combo this:
But the synth sends something different like 16’=31 it would be clear that it does not work. If it does not work for some reason I would try a script attached to “Called to calculate new modulator value from a MIDI value”. Here’s what the Lua editor makes when you add a new method selecting the right template:
myNewMethod = function(–[[ CtrlrModulator –]] modulator, –[[ CtrlrMidiMessage –]] midiMessage, –[[ number –]] numericMidiValue)
endMay 13, 2018 at 9:15 pm #83918
Indeed to your first point the synth actually returns:
$54 (84) 16’
$24 (36) 8’
$00 (0) 4’
To your second point I attached the script as suggested, however this had no effect.
I will have a further dabble with scripts and see what I can achieve, I’ll report any kind of success.May 14, 2018 at 11:54 am #83942
So the synth returns completely different values? The range seems to be upside down compared to your previous list.
The script does not do anything, it is an empty template. You would have to enter code that converts the received values into the combo values. But I would first check if the synth really sends the wrong values. If it is a bug in the firmware there would be no other way than making a script that converts the wrong values into right ones.
May 15, 2018 at 12:05 am #83952
- This reply was modified 1 week, 5 days ago by Possemo.
Oh dear, the joys of dyscalculia.
My error that should have read:
$00 (0) 16’
$24 (36) 8’
$54 (84) 4’
So the synth firmware is fine, it is my firmware that is buggy!May 15, 2018 at 9:16 am #83954
No problem, I have a touch of dyslexia and in school numbers were not my friends either but I am learning to live with it – now at the age of 49… he he.
Well then, did you try to set the uiCombo to the same values as the ones the synth sends? The uiCombo is an awkward modulator with a couple of bugs. Maybe it just won’t react to incoming messages whatever you do. In this case my last resort would be to make a script. I will try to help you on that.May 15, 2018 at 9:20 pm #83961
I too have Dyslexia, however as I child my next door neighbour was a teacher and I had one to one tuition which helped a lot. But I still have problems if I am flustered or in a hurry and sometimes I cannot connect the middle of a journey although I can picture both the start and the finish. However on the plus side it means I can often approach problem solving from a different angle.
Well I tried adjusting the uiCombo values to match the synth values but with no avail, so I think the script route is best way forward.
I have a script that recognises incoming CC, but I would like to omit the MIDI channel character from this. I tried using BigInteger and (bi:getBitRangeAsInt(1,1), but didn’t entirely know what I was doing.
midiCcID = midiMessage:getLuaData():getByte(0) if midiCcID == 0xB0 then console("CC Detected") end
I am guessing I need to make a script for each uiCombo and attach it via the “Called to calculate new modulator value from a MIDI value” menu. Would that be correct? As opposed to one long script for all.May 16, 2018 at 1:01 pm #83965
My idea for this problem would be as follows:
Make a slider with the same midi cc. You can hide this slider or put it do a different layer and make the layer invisible. This one should react to the incoming midi cc, so you don’t have to deal with that in the script. Then add a script to this slider “when modulator value changes”. In this script you set the uiCombo accordingly when the slider gets the specific incoming values.May 24, 2018 at 12:50 am #84092
That seems like a good workaround, I have quite a lot of uiCombos on my panel however. With this in mind I have persevered with Lua scripting with some success.
So I have added the following to my ‘midiMessageReceived’ script which is attached to ‘Called when panels receives a MIDImessage’
midiMessageReceived = function(midiMessage) midiCcID = midiMessage:getData():getByte(0) if midiCcID == 0xB0 or midiCcID == 0xB1 or midiCcID == 0xB2 or midiCcID == 0xB3 or midiCcID == 0xB4 or midiCcID == 0xB5 or midiCcID == 0xB6 or midiCcID == 0xB7 or midiCcID == 0xB8 or midiCcID == 0xB9 or midiCcID == 0xBA or midiCcID == 0xBB or midiCcID == 0xBC or midiCcID == 0xBD or midiCcID == 0xBE or midiCcID == 0xBF then console ("CC Detected") end midiCcMod = midiMessage:getData():getByte(1) if midiCcMod == 0x08 then dcoOneRangeMessage(midiMessage) end end
Then I have a method for each uiCombo that is scripted as per the following.
dcoOneRangeMessage = function(midiMessage) midiCcData = midiMessage:getData():getByte(2) if midiCcData == 0x00 then DCO1Range:setModulatorValue((0), false, false, false) elseif midiCcData == 0x24 then DCO1Range:setModulatorValue((1), false, false, false) elseif midiCcData == 0x54 then DCO1Range:setModulatorValue((2), false, false, false) end endMay 24, 2018 at 8:40 am #84093
If you have lots of these uiCombos this is probably the the best way doing it. Instead of setModulatorValue you could use setValueMapped and assign the value directly:
midiCcData = midiMessage:getData():getByte(2)
DCO1Range:setValueMapped(midiCcData, false, false)
But this has the disadvantage that the modulator will send the new CC value to MIDI-Out – usually you don’t want that to happen.May 24, 2018 at 12:25 pm #84095
Thanks for the info I will try setValueMapped tonight and see what the result is.
Due to my lack of Lua knowledge I am not sure if the way I have formatted the first script is correct. In that I wish for it only to proceed to
midiCcData = midiMessage:getData():getByte(2)
if the result of
midiCcID = midiMessage:getData():getByte(0)
is positive. I have a suspicion that currently the second question is independent of the first.
Could you confirm and or advise if this is the case please. Cheers.May 24, 2018 at 9:29 pm #84100
yea then you should include midiCcData in the first if-statement:
midiMessageReceived = function(midiMessage) midiCcID = midiMessage:getData():getByte(0) if midiCcID == 0xB0 or midiCcID == 0xB1 or midiCcID == 0xB2 or midiCcID == 0xB3 or midiCcID == 0xB4 or midiCcID == 0xB5 or midiCcID == 0xB6 or midiCcID == 0xB7 or midiCcID == 0xB8 or midiCcID == 0xB9 or midiCcID == 0xBA or midiCcID == 0xBB or midiCcID == 0xBC or midiCcID == 0xBD or midiCcID == 0xBE or midiCcID == 0xBF then console ("CC Detected") midiCcMod = midiMessage:getData():getByte(1) if midiCcMod == 0x08 then dcoOneRangeMessage(midiMessage) end end end
the many “or’s” could be replaced by “greater or equal than” and “smaller or equal than”:
midiMessageReceived = function(midiMessage) midiCcID = midiMessage:getData():getByte(0) if midiCcID >= 0xB0 and midiCcID <= 0xBF then console ("CC Detected") midiCcMod = midiMessage:getData():getByte(1) if midiCcMod == 0x08 then dcoOneRangeMessage(midiMessage) end end end
I haven’t tested it but in theory it should work. Maybe it does not work with hex number but I wouldn’t see why. If it does not work for some weird reason you could use decimal numbers – replace 0xB0 with 176 and 0xBF with 191.May 24, 2018 at 11:13 pm #84101
Hey Possemo, that works brilliantly. I tested the >= and <= across all sixteen MIDI channels to be on the safe side and it works perfectly. Many thanks for your invaluable assistance.May 25, 2018 at 2:24 pm #84106
fine, one last thing I always do: remove the console output when you have finished debugging. the cosole() command slows down performance significantly. If you just send a fixed string like in your example it is probably not that bad but I would remove it anyway.
- This reply was modified 23 hours, 20 minutes ago by Possemo.
You must be logged in to reply to this topic.