I’m trying to set up a KORG nanokontrol 2 as a real time controller for my rig. It only has 6 knobs, so I was hoping to set up a feature whereas a ‘selection matrix’ would allow those 6 knobs to be dynamically assigned to a MIDI controller depending on what was selected. I got a hack around working through a rackspace script but without writing a lot of additional code I’m not able to reproduce the ‘catch’ behavior when the widgets are directly assigned (which is a nice feature). So as of now the second I touch a knob on the nanokontrol the widget jumps to wherever the knob is.
Has there been any talk of adding the ability to reassign a widget’s MIDI control through GPScript?
That’s not quite what I meant. I meant reassigning what MIDI control a widget responds to.
A better example: I use the Morgan Amp Suite from Neural DSP. I want to be able to use the nanokontrol for adjusting the stomp box FX as well as the amp. So I have two buttons on the rackspace. If one is selected, the nanokontrol knobs work with the stomp FX parameters. If the other is selected the nanokontrol knobs works with the amp dials instead.
I thought of another method overnight that uses hidden controls that are hard linked to the nanokontroller. I’ll see if it works tonight.
But… It would be a lot easier if I could just change the MIDI assignment on a widget through GPScript…
This rackspace script will use a button on the controller (in this case cc39 value 127 ) to change the mapping of a given widget. You can then use learn the knob widget to control the parameter currently assigned to it.
Var
CS : MidiInBlock
//$</AutoDeclare>
var
toggle : integer = 0
w1: Widget
sektor:PluginBlock
On ControlChangeEvent (c: ControlChangeMessage) matching 39 From CS
if GetCCValue(c) == 127 then
toggle = toggle^1
Print("Control Change 39 Value is " + toggle)
End
if toggle == 1 then
MapWidgetToPlugin (w1 ,sektor, 10)
else
MapWidgetToPlugin (w1 ,sektor, 11)
End
End
OK, this is an unusual request. I though he wanted to use a single knob (CC value) to control different parameters on a given plugin.
Apparently he wants to re-assign a different MIDI messages to a given Widget.
In my example, if a given value is selected my knob controls my Sektor synth OSCA pan, if the other is selected it controls OSCA level. So I think it will provide the right end result, however just in a different way. I’m using a single widget to control 2 different parameters and with some modification it doesn’t even have to be on the same plugin. Of course with multiple knobs, you would have to switch the set of knobs to point to the other plugin (one for each paramter).
Alternatively, you could use a button to alter the channels on the nanoKontrol input allowing you to set up separate widgets (with different MIDI learn) for each plugin you want to control.
Essentially the nanoKontrol2 would look like a controller with twice as many controls.
Keep in mind, that if you have one parameter set to a different value then the other parameter, the second you turn the knob after changing parameter, the value will jump to the physical value of the knob. So if you are using the same knob to control different parameters while playing, you might get some unwanted audio effects. To solve this, the would need to be another layer of abstraction to ignore the incoming knob until it crosses that last known parameter value (catch). Widgets have this in the widget editor but with this script, it won’t work. There would need to be logic added to the script to ignore sending the new knob value until it reaches the last known value.
In the past I’ve used Bome MIDI Translator Pro to do this. I’m sure it can probably be done in GPscript as well. I have yet to experiment with this.
That’s the logic I was trying to avoid writing initially.
But your idea of dynamically remapping CC control messages to a different controller and then MIDI learning the widgets to those remapped controllers has potential. That way I get the ‘catch’ behavior.
So for example knob 1 on the nanokontrol is CC16. I remap that to, say, CC50 and then MIDI learn a widget to respond to CC50. Then if the other option is selected it remaps it to something like CC51 instead.
So I got a system to work, but it’s super hacky and required some extra coding to account for some interesting behavior with the ‘catch’ option on MIDI mapping a widget, and I’m not sure if it’s a bug or not. Sorry this is going to be long so I can explain what’s going on.
I put two MIDI filters in series that reassign the nanokontrol CC numbers to a different set (CC 16-23 become CC 102-109 for example) and rebroadcast them into the “Local GP Port”. With radio grouped selector buttons, only one block can be active at a time. I then mapped the appropriate knobs manually (since the original nanokontrol messages were still getting through in addition to the modified Local GP Port messages). I set the knobs to have the ‘catch’ behavior and for the initial switching back and forth it worked correctly, but then something interesting happened: every time I switched from one set of controls to the other, the knobs exhibited ‘Jump’ behavior. I had to add this little nugget to ‘jiggle’ the controls a bit to set them back to ‘Catch’ mode:
var ampWidgets : Widget Array = [MorganMaster, MorganKnob1, MorganKnob2, MorganKnob3]
pedalWidgets : Widget Array = [PedalComp, OD1Drive, OD1Level, OD1Tone, OD2Gain, OD2Level, OD2Bass, OD2Treble]
On WidgetValueChanged(w : Widget, index: integer, newValue : double) from PedalControl, AmpControl
var i : Integer
select
index == 0 && newValue == 1 do
For i = 0; i < Size(pedalWidgets); i = i + 1 do
SetWidgetValue(pedalWidgets[i], GetWidgetValue(pedalWidgets[i]) + 0.01)
End
index == 1 && newValue == 1 do
For i = 0; i < Size(ampWidgets); i = i + 1 do
SetWidgetValue(ampWidgets[i], GetWidgetValue(ampWidgets[i]) + 0.01)
End
End
End