I re-built a num pad with pad widgets (overlayed with text labels as numbers).
I placed everything into the Global Rackspace, since this would be the most obvious place to use such a thing…
There are two scripts working in that gig file…
- a Gig-Script which would react to keystrokes 0-9 coming from the num-pad and then send a CC# midi message over the Local GP Port (CC#80-#89)
BTW: the correct “matching” value for the GP-Script callback is “NUMPAD 0” 
The number pads in the Gloabla Rackspace are midi-wise connected to the corresponding CC# of the Local GP Port, so that they will be triggered from the Gig Script.
Unfortunately there is no way to read the “Enter” key, so i left out the PC-keyboard assignments for the “CLR” and the “GO” pads - but maybe you want them to be learned with some other MIDI controller…
- a Global Rackspace script which will do the work for assembling the “typed in” number and then on pressing “GO”, selecting the matching song number.
I limited the input to a 3-figure number, which should be sufficient. Also the script takes care of some other unwanted situations, which could occur.
Pressing “CLR” clears the number, so you can type a new one.
That’s it.
There are only two caveats:
The key-stroke input only works if the GP’s main window has focus!
The Setlist mode must be active!
numpad_song-select.gig (378.0 KB)
This is the Gig-Script which reads the key strokes:
// Generate a MIDI message when pressing a key on the keyboard
On Keystroke matching "NUMPAD 0" Description "Toggle Widget"
InjectMidiEvent("Local GP Port", MakeControlChangeMessage(80, 127))
InjectMidiEvent("Local GP Port", MakeControlChangeMessage(80, 0))
End
On Keystroke matching "NUMPAD 1" Description "Toggle Widget"
InjectMidiEvent("Local GP Port", MakeControlChangeMessage(81, 127))
InjectMidiEvent("Local GP Port", MakeControlChangeMessage(81, 0))
End
On Keystroke matching "NUMPAD 2" Description "Toggle Widget"
InjectMidiEvent("Local GP Port", MakeControlChangeMessage(82, 127))
InjectMidiEvent("Local GP Port", MakeControlChangeMessage(82, 0))
End
On Keystroke matching "NUMPAD 3" Description "Toggle Widget"
InjectMidiEvent("Local GP Port", MakeControlChangeMessage(83, 127))
InjectMidiEvent("Local GP Port", MakeControlChangeMessage(83, 0))
End
On Keystroke matching "NUMPAD 4" Description "Toggle Widget"
InjectMidiEvent("Local GP Port", MakeControlChangeMessage(84, 127))
InjectMidiEvent("Local GP Port", MakeControlChangeMessage(84, 0))
End
On Keystroke matching "NUMPAD 5" Description "Toggle Widget"
InjectMidiEvent("Local GP Port", MakeControlChangeMessage(85, 127))
InjectMidiEvent("Local GP Port", MakeControlChangeMessage(85, 0))
End
On Keystroke matching "NUMPAD 6" Description "Toggle Widget"
InjectMidiEvent("Local GP Port", MakeControlChangeMessage(86, 127))
InjectMidiEvent("Local GP Port", MakeControlChangeMessage(86, 0))
End
On Keystroke matching "NUMPAD 7" Description "Toggle Widget"
InjectMidiEvent("Local GP Port", MakeControlChangeMessage(87, 127))
InjectMidiEvent("Local GP Port", MakeControlChangeMessage(87, 0))
End
On Keystroke matching "NUMPAD 8" Description "Toggle Widget"
InjectMidiEvent("Local GP Port", MakeControlChangeMessage(88, 127))
InjectMidiEvent("Local GP Port", MakeControlChangeMessage(88, 0))
End
On Keystroke matching "NUMPAD 9" Description "Toggle Widget"
InjectMidiEvent("Local GP Port", MakeControlChangeMessage(89, 127))
InjectMidiEvent("Local GP Port", MakeControlChangeMessage(89, 0))
End
and this is the Global Rackspace script:
var
num0, num1, num2, num3 ,num4, num5, num6, num7, num8, num9: widget
lbl_song : widget
pad_clr, pad_go : widget
StrSongNumber : String = ""
songChanged : boolean
// Called automatically after script is loaded
Initialization
StrSongNumber = ""
SetWidgetLabel (lbl_song, StrSongNumber)
End
// Called when any of several widgets changed
// The widget and index parameters are optional
On WidgetValueChanged(w : Widget, index: integer, newValue : double) from num0, num1, num2, num3 ,num4, num5, num6, num7, num8, num9, pad_clr, pad_go
If newValue == 1.0 Then //only if the pad widget is ON
//if it is a number-pad get the index and and it to the song-number (max. 3 fig.)
If index >= 0 and index <=9 and Length(StrSongNumber) <3 Then
StrSongNumber = StrSongNumber + IntToString(index)
SetWidgetLabel (lbl_song, StrSongNumber) //set the label with each input
end
//pressing the CLR pad will empty the song number
if w == pad_clr Then
StrSongNumber = ""
SetWidgetLabel (lbl_song, StrSongNumber)
end
//pressing the GO pad will select the song with the according number (if existing!)
if w == pad_go and StringToInt(StrSongNumber) <> 0 Then
if InSetlistMode() then
songChanged = SwitchToSongByIndex(StringToInt(StrSongNumber)-1, 0)
StrSongNumber = ""
SetWidgetLabel (lbl_song, StrSongNumber)
else
DisplayTemporaryMessage("This works in Setlist mode only!!!")
end
end
end
End
Maybe this helps… 