Event blocking volume

Hello,

I use my Yamaha analog expression pedal to control the slider widget (MIDI CC11), connected to the
Gain and balance plugin (see attached GIG). In some songs, I want to block my expression pedal, so I set up a switch witget to control Midi IN plugin (BlockExpression parameter). This works fine and blocks the Midi CC11 (confirmed with a Midi Monitor), but the pedal/witget with volume function still works.

What am I missing?

Block Expression pedal .gig (268.8 KB)

1 Like

Do you need to block midi cc 7. Master volume (I think)?

I use CC11 to control volume. :slightly_smiling_face:

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 :nerd_face:) 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)

2 Likes

Turns out there’s a much easier way to accomplish this by using a simple scriptlet to conditionally inject a message into the Local GP Port. The scriptlet needs a single parameter to set that condition.

I’ve implemented a simple gig file to test this and I’ll write the steps up in a blog article.

Edit: here’s the link to the blog article

4 Likes

Wow… this is really elegant and yet so easy to use! Chapeau! :+1:

1 Like

Nice, we could have a second parameter to chose the CC# we let go through.

This make me remember that I made for my own use a, LGPP MIDI out block. It is simply a Scriptlet which injects every MIDI message it received in the LGPP. I would perhaps find even more elegant to have two Scriptlets for this: a CC# only MIDI thru with an ON/OFF and a CC# parameter (easier to use than the regular GP MIDI filter plugin), and a second one being this LGPP MIDI out block. This way the user can immediately follow what happens.

It was a quick hack….

There is a reason they say that software is never finished, merely abandoned. Same goes for songs.

1 Like