My situation is that I have a somewhat broken keyboard which on sustain pedal use sends only numbers on CC64 between 80 and 127 und sometimes randomly send 0s.
Im looking for a filter solution to filter those 0s out and maybe remap the 80-127 to 1-127.
What could be the best way to achieve this in Gig Performer?
I tried some plugins, but MIDI Filter Plugins all seem to be very old and therefore not available in x64 so I can’t get them loaded in GP.
I messed around a little bit with GPScript, but no success there yet.
Yes you can use a MIDI learned widget to your pedal with a recale curve. Than you can map this widget to a plugin parameter. This plugin parameter could even be the CC#64 of a MIDI in block. Does this solves your problem?
I’m… actually not sure what you are trying to say.
Can you elaborate what would I have to do? What is a “widget midi learns” and a “recale curve”?
My goal is to further use the pedal and just filter the erronous messages out, not to replace it by a widget, if that was your suggestion. (Could be a bit clungy to play piano pieces and use a mouse whenever pedal is required :D)
Might be that your problem can not be solved:
You want to scale cc64 80-127 to 1-127. This of course is possible using the input scaling function of GP.
But:
You cannot filter out “wrong” cc64 0, because the software does not know if the cc is not wanted or is simply sustain off.
Therefore your sustain would switch on - but never off.
This is much more likely to be a sustain pedal problem rather than your keyboard? Also, are you by chance plugging that pedal into an “expression” input? Sustain pedals should only have two values, 0 and 127
@Stoffel Well, filtering out the “wrong” 0s should be easy as there are no “right” 0s. Sustain offs would be around 80.
@dhj I already tried a different pedal - while that one only has 0 and 127, the keyboard still phases in incorrect 0s. Correcting that would be quite undoable.
@David-san Thats some information, thank you! Will read and try ASAP. From my first impression, maybe I just misjudged the power of widgets (therefore not understanding your intial answer )
Yeah, as in the initial post mentioned, I tried, but had no luck so far. Maybe im getting wrong where a script can/should be placed or which types I need (MidiInput something)?
So, here is a concrete Script I tried within a Scriptlet:
On ControlChangeEvent(m : ControlChangeMessage) Matching 64
if (m.GetCCValue() > 0)
SendNow(m);
End
What Im Getting is:
Scriptlet (Scriptlet) - - Syntax Error in “Main”: Line 3, Col 5: Unexpected or unrecognized token: ‘if’
Mismatched input ‘if’ expecting End
You don’t want to do this in a scriptlet - it should be in the GigScript as this is something that applies (I assume) to everything.
Below is a (working) example that I use in my GigScript to reverse the polarity of a sustain pedal that behaves backwards with the particular keyboard to which it is connected.
You need to make sure your keyboard is defined with an alias for it and then you use that name in the declaration (mine was called TopSurface)
Obviously change the implementation of the ControlChangeEvent
Initialization
Print("Auto Loaded - reverse sustain pedal polarity")
End
var
TopSurface : MidiInDeviceAlias
//Invert the sustain pedal plugged into the A800 controller
On ControlChangeEvent(m : ControlChangeMessage) Matching 64 from TopSurface
var val : integer = 127 - m.GetCCValue()
InjectMidiEventViaRigManager(TopSurface, WithCCValue(m, val))
End