I’m trying to get a footswitch’s LED to reflect a plugin’s bypass state.
Setup: A widget in my rackspace is MIDI-learned to CC82 on channel 2 (from a PaintAudio MIDI Captain foot controller) and correctly controls a plugin’s bypass. That direction works fine:
19:12:32.908 From MIDI Captain Control Ch2 CC82 (Gen Purpose 7) 127
What I want: when that plugin’s bypass state changes (from any source — the pedal, another widget, a variation change), send a different MIDI message back out to the pedal so its LED updates: CC26, channel 16, value 1 (engaged) or 2 (bypassed) — not a copy of CC82/channel 2 like SYNC does. This exact message is documented in the pedal’s own command spec as the way to externally set a key’s display state.
What I tried and why it doesn’t work: Gig Performer’s built-in widget “Sync” button, which just echoes the same CC/channel back out:
19:12:31.867 To MIDI Captain Control Ch2 CC82 (Gen Purpose 7) 0
The pedal receives this (confirmed via its own MIDI monitor — the input indicator lights) but the key’s LED doesn’t change, since it’s not the message format the pedal expects for external LED control.
What I’m stuck on: writing a GPScript rackspace script to do the translation. I got as far as this, using ParameterValueChanged/WidgetValueChanged and SendNow/MakeControlChangeMessageEx, but hit a string of type-declaration errors along the way (Type not found: Plugin, then Declarations of this type are not allowed for Block) before landing on Widget as a declarable type via “Auto declare blocks and widgets.”
Question: what’s the correct/current way to do this — is there a simpler built-in feature I’m missing, or does someone have a working scriptlet example for “translate an incoming CC into a different outbound CC/channel/value sent back to the same controller”?
Please post the actual script. Things like “Type not found” and "Declarations of this type are not allowed" aren’t helpful if we can’t see the actual script, etc
I should not have posted that part as I am pretty sure I am on the wrong path.
Here’s what I was working with
//$<AutoDeclare>
// DO NOT EDIT THIS SECTION MANUALLY
Var
FX3Widget : Widget
MyMidiOut : MidiOutBlock
//$</AutoDeclare>
On WidgetValueChanged(newValue : Double) from FX3Widget
if newValue > 0.5 then
SendNow(MyMidiOut, MakeControlChangeMessageEx(26, 1, 16))
else
SendNow(MyMidiOut, MakeControlChangeMessageEx(26, 2, 16))
end
End
What’s the actual idiomatic way to do this translation? is SendNow/MakeControlChangeMessageEx on the right track, or is there a cleaner built-in pattern for “receive on one CC/channel, send a different CC/channel/value back to the same port”?
One follow-up: I have 13 rackspaces, each with its own “FX Slot 3” widget bound to a different plugin’s bypass (same physical footswitch, different effect depending on which rackspace is active that part’s intentional). Example - for my DRIVE (which can be a different pedal from rackspace to rackspace)… The feedback-translation logic itself (turn a bypass change into CC26/ch16/value 1-or-2 sent to the controller) is identical across all of them. I’d rather not paste the same On WidgetValueChanged... SendNowExternal(...) block into all 13 rackspace scripts.
Is there an idiomatic way to share that logic… e.g. a Function defined at the Gig level that each rackspace script calls to make that midi translation, Widget Groups letting one callback cover multiple rackspaces’ widgets, or something else you’d recommend?