Hi folks,
This rackspace contains a switchable matrix of 4 banks by 8 knob widgets, which can be used through 8 physical knobs of your MIDI controller. By switching the active widget bank, it is possible to control up to 32 plugin parameters!
The very top row of knobs are called “Control XY”, they should be midi-mapped to the physical knobs of your controller only (not to plugins!).
Below are 4x8 knobs which can be parameter-mapped to plugins (but not a midi controller!).
On the side there are 4 pads to select the knob-bank which will be actually affected from the “Control” knobs (the pads can also be midi-mapped to physical buttons).
That way you can select which row of the 32 matrix-knobs (=plugin parameters) will be controlled if you dial your physical knobs).
So, in short, the value of a “Control” knob is mirrored by the respective matrix knob of the selected bank.
If you change the active bank, the values of the activated bank’s knobs are copied to the control knobs, so you always have the actual state at hand!
A RESET ALL button will do what it says: Reset all the widgets!
knobmatrix.gig (628.0 KB)
Have fun with it…
Cheers!
Erik
…just for the curious ones - here is the script code:
var
frame_01, frame_02, frame_03, frame_04 : widget
padBank01, padBank02, padBank03, padBank04 : widget
knbDummy01, knbDummy02, knbDummy03, knbDummy04, knbDummy05, knbDummy06, knbDummy07, knbDummy08 : widget
knbB1_01, knbB1_02, knbB1_03, knbB1_04, knbB1_05, knbB1_06, knbB1_07, knbB1_08 : widget
knbB2_01, knbB2_02, knbB2_03, knbB2_04, knbB2_05, knbB2_06, knbB2_07, knbB2_08 : widget
knbB3_01, knbB3_02, knbB3_03, knbB3_04, knbB3_05, knbB3_06, knbB3_07, knbB3_08 : widget
knbB4_01, knbB4_02, knbB4_03, knbB4_04, knbB4_05, knbB4_06, knbB4_07, knbB4_08 : widget
btnResetAll : widget
markerFrames : widget Array = [frame_01, frame_02, frame_03, frame_04]
bankPads : widget array = [padBank01, padBank02, padBank03, padBank04]
dummyKnobs : widget Array = [knbDummy01, knbDummy02, knbDummy03, knbDummy04, knbDummy05, knbDummy06, knbDummy07, knbDummy08]
bank01Knobs : widget Array = [knbB1_01, knbB1_02, knbB1_03, knbB1_04, knbB1_05, knbB1_06, knbB1_07, knbB1_08]
bank02Knobs : widget Array = [knbB2_01, knbB2_02, knbB2_03, knbB2_04, knbB2_05, knbB2_06, knbB2_07, knbB2_08]
bank03Knobs : widget Array = [knbB3_01, knbB3_02, knbB3_03, knbB3_04, knbB3_05, knbB3_06, knbB3_07, knbB3_08]
bank04Knobs : widget Array = [knbB4_01, knbB4_02, knbB4_03, knbB4_04, knbB4_05, knbB4_06, knbB4_07, knbB4_08]
padIsActive, copyInProgress : boolean = false
activeBank : integer
//user function to copy the control row (dummies) to the matrix row
function dummyTobank (bank : widget Array)
var
index : integer
copyInProgress = True //set flag for scripted copy action
for index = 0; index < Size(dummyKnobs); index = index +1 Do
SetWidgetValue(bank[index], GetWidgetValue(dummyKnobs[index]))
end
copyInProgress = false // scripted copy action is over
End
//user function to copy the matrix row to the control row (dummies)
function bankTodummy (bank : widget Array)
var
index : integer = 0
copyInProgress = True //set flag for scripted copy action
for index = 0; index < Size(dummyKnobs); index = index +1 Do
SetWidgetValue(dummyKnobs[index], GetWidgetValue(bank[index]))
end
copyInProgress = false // scripted copy action is over
End
//show and hide the frame around the knob rows
function setFrame(VisibleIndex : integer)
var
index : integer = 0
for index=0; index < Size(markerFrames); index = index +1 Do
SetWidgetHideOnPresentation(markerFrames[index], true)
end
SetWidgetHideOnPresentation(markerFrames[VisibleIndex], false)
End
//executed on first load & script compile
Initialization
var
index : integer = 0
//check if at least one pad is lit
for index=0; index < Size(bankPads); index = index +1 Do
if GetWidgetValue(bankPads[index]) >0.6 Then
padIsActive = true
activeBank = index
setFrame(activeBank)
end
end
//if no pad is lit, activate bank 1
if padIsActive == false then
SetWidgetValue(bankPads[0],1.0)
padIsActive = true
bankTodummy(bank01Knobs)
setFrame(activeBank)
end
End
//reset all widgets
On WidgetValueChanged(bVal : double) from btnResetAll
var
index : integer
//reset the control knobs
for index=0; index < Size(dummyKnobs); index = index +1 Do
SetWidgetValue(dummyKnobs[index],0)
end
//and copy the control knobs to the matrix banks
dummyTobank(bank01Knobs)
dummyTobank(bank02Knobs)
dummyTobank(bank03Knobs)
dummyTobank(bank04Knobs)
//activate bank 1
SetWidgetValue(bankPads[0],1.0)
End
//switch the matrix banks by pads
On WidgetValueChanged(w : Widget, index: integer, pVal : double) from padBank01, padBank02, padBank03, padBank04
activeBank = index
Select
activeBank==0 do bankTodummy(bank01Knobs)
activeBank==1 do bankTodummy(bank02Knobs)
activeBank==2 do bankTodummy(bank03Knobs)
activeBank==3 do bankTodummy(bank04Knobs)
end
setFrame(activeBank)
End
//whenever a control knob is dialed
On WidgetValueChanged(w : Widget, index: integer, kVal : double) from knbDummy01, knbDummy02, knbDummy03, knbDummy04, knbDummy05, knbDummy06, knbDummy07, knbDummy08
if copyInProgress == false Then //only react if it's no scripted copy action (means, if it's done by the user)
Select //set the corresponding knob of the selected bank
activeBank==0 do SetWidgetValue(bank01Knobs[index], kVal)
activeBank==1 do SetWidgetValue(bank02Knobs[index], kVal)
activeBank==2 do SetWidgetValue(bank03Knobs[index], kVal)
activeBank==3 do SetWidgetValue(bank04Knobs[index], kVal)
end
end
End