This is caused by the fact that a midi message which is used to control a widget is coming directly from the hardware device, and the handling of those midi messages happens before they go to a midi-in block!
The same effect causes i.e. a note to not being played anymore through a midi-block, if this note was used to midi-learn a widget.
So what you have to do, is to “intercept” the CC11 coming directly from your hardware controller and pass it on, or not - depending on the state of a local widget (your “Block CC” button.
Unfortunately these two things happen at very diffrent places and you’d have to use some tricks (means: scripting
) to connect those two “places”.
To make this work, you’d have to setup your hardware controller as a Rig-Manager alias!
In my case i use an alias named “Main_keys” which is connected to my “Roland A-800 Pro”.
The name of the hardware device which is used in the scripts has to be exactly the same like it is in the Rig-Manager! (just in case you decide to use other names)
First you’d have to use a so called “Gig-Script” - the Gig-Script thrones over every other kind of script and components like plugin blocks (the midi-in block also is just some kind of plugin block).
In this Gig-Script you will check for any CC11 coming in from your hardware controller, and because the Gig-Script isn’t able to connect to widgets in rackspaces directly, we have to use an environmental variable" which can be set and read from everywhere i named this variable “ccForbidden”, and i decided to use the values “yes” and “no” as its possible states.
So if “ccForbidden” is set to “no”, the CC11 will be passed back to the Rig-Manager Device, else nothing will happen (and this means, it will be “blocked”).
This is the Gig-Script:
var
Main_Keys : MidiInDevice
Initialization
SetEnvVariable("ccForbidden", "no")
End
On ControlChangeEvent(m : ControlChangeMessage) Matching 11 from Main_Keys
If GetEnvVariable("ccForbidden") == "no" then
InjectMidiEventViaRigManager(Main_Keys, m)
end
End
Now there is also another script in the local rackspace where you set this EnvVariable according to your needs (ccForbidden = “yes” or “no”) depending on the state of the button widget.
This is the local script:
var
Main_Keys : MidiInDevice
btnBlockCC : widget
function CheckBlockCC ()
If GetWidgetValue (btnBlockCC) >0.6 Then
SetEnvVariable("ccForbidden","yes")
Else
SetEnvVariable("ccForbidden","no")
end
End
// Called automatically after script is loaded
Initialization
CheckBlockCC()
End
// Called when rackspace is activated
On Activate
CheckBlockCC()
End
// Called when a single widget value has changed
On WidgetValueChanged(bVal : double) from btnBlockCC
CheckBlockCC()
End
BTW: the button has to be given a so called “handle” (means: name) so it can be accessed by the local script. (see widget’s “Advanced” tab)
I tried it on my PC and it worked as it should (at last i think it does)
This is the modified gig file - i hope this helps somehow…
Block Expression pedal (scripted).gig (269.5 KB)