Using CC data from VST to control Widget

Hello -

Total newbie here. I have a VST that spits out midi modwheel data continuously. I was thinking about controlling another VST’s parameter via a widget with that data. How do I get the CC data to the widget? Is that a scripting issue or something simpler?

Thanks for your help.

Chris

You can use a script to send the CC message to GP’s internal MIDI port which can then be learned by a widget.

Does the plugin to which you want to send messages support MIDI learn? While we normally eschew using plugin MIDI learn to respond to hardware (because the hardware can change), having one plugin send MIDI messages directly to another plugin is not particular unreasonable.

1 Like

This particular one doesn’t support MIDI learn, but I have my answer. Seems like a good first script to write. Thanks!

You’ll find it in the forum. Nice and short: 3 lines of code :slight_smile:

Further reading: Gig Performer | How to automate switching rackspace variations and song parts using the MIDI File Player

Thanks - I tried it out last night and it worked great. Technically great anyway, musically questionable. Since y’all are being so helpful, the plugin sending the CC only sends it as CC1. Is there away to move that to a lesser used CC in the scriptlet?

Thanks again.

You might want to review the SystemFunction list for GP Script.

In particular, there is

WithCCNumber

which can be used to change the CC Number of a message

Yup. That did the trick, although I had to

On ControlChangeEvent (c : ControlChangeMessage)

rather than

On MidiEvent (m: MidiMessage)

in order to use WithCCNumber, which may be obvious but I’m just mentioning for posterity.

Thanks for your help.

In fact, On ControlChangeEvent is what you should use anyway given that you only need to respond to a CC message.

The MidiEvent callback responds to every incoming message and is going to be more expensive since you then have to test the received message to find its type. When you use specific message callbacks, the callback is only invoked when the appropriate message is received and other messages are just blocked or passed through directly. Granted there’s not much difference if you know there’s only going to be one type of message but even if you want to deal with multiple message types, it’s better to just use multiple callback events, one for each type of message of interest.

The MidiEvent callback while generic, is really intended just to handle non-channel messages.

Glad you have it working.

This is a fantastic optimization for what I’m doing right now! Great tip!

1 Like