Can we map keyboard commands/presses to widgets/system actions?

Is it possible to map standard keyboard presses - not an instrument, the typing keyboard - to widgets and/or commands in GP? I only know there’s PLAY/STOP and I’m not even sure what it does; i think it’s for backing tracks in setlist mode?

I would really like to see this built-in to GP, and not have to resort to an external app like MIDIKey or similar to intercept the keyboard (HID) messages and transform them to MIDI.

Maybe an opportunity for an extension?

Use a gig script like this

// Use the ‘a’ key
On Keystroke matching “a” Description “a”
InjectMidiEvent(“Local GP Port”,MakeNoteMessage(C3, 127))
End

And MIDI learn a widget this message

4 Likes

Would that be encapsulable as a scriptlet? And/or does it have to be in the gig script, or can it be in the rackspace script?

It does make sense in a gig script

No

Yes

No, though that’s somewhat interesting — one could imagine having different key sequences available depending on the currently active rackspace - not sure if there is a real use case for that though.

That works quite nicely! And after searching some more for simple QWERTY-to-MIDI apps, this actually seems like the best option too, vs an external app. BOME is too pricey to justify for just this use case. (There are plenty of MIDI-to-QWERTY apps, but almost no QWERTY-to-MIDI apps.)

FWIW i tweaked the code to be a toggle:

var
  val: integer = 0

On Keystroke matching "b" description "yo"
  val = 127 - val
  InjectMidiEvent("Local GP Port", MakeControlChangeMessage(1, val))
end

The value of val flip/flops with each keypress.

There doesn’t seem to be a list of available keystrokes to trigger on - and which can be reassigned from their existing function. For example, I don’t need PLAY/STOP for the spacebar, but I don’t know how to re-assign it.

Does On Keystroke always have to match something? Can we just print the return value?

Beyond the build in items (which are not configurable) there aren’t any predefined keystrokes — the whole point of the On Keystroke callback is to allow you to define EXACTLY what you want. Note that you can have multikey keystrokes, e.g.

On Keystroke matching "hello" 
   ...
End

That callback will occur if you type the sequence ‘h’ ‘e’ ‘l’ ‘l’ ‘o’

so, can i trigger on Spacebar? or Return?

OSC or just more midi might be an easier option here, but i’d still love to have the option!

Have you tried this?

1 Like

nice, i hoped it would be as simple as that!

Can I use this script to move between variations in a rackspace nad another between racks? How it would that look like? Thanks in advance

Yes you can. This is the list of script functions. If you have a look at the section for “Rackspace” there are functions called NextRackspace() and NextVariation()

https://gigperformer.com/docs_5_0/SystemFunctionList.html

1 Like