Example) Display message on KORG Keystage OLED

Hi,

I would like to share an example of displaying message from Gig Performer on KORG Keystage OLED. Confirmed it worked in my environment.

It uses Keystage Native Mode and the CC behaviors in the mode are not so convenient to be handled with Gig Performer. So, added some codes to convert the behaviors.

I hope this is useful.

  • Gig Script
// Use KORG Keystage Native Mode (Gig Script)
// ==========================================
// Keystage Native Mode enables users to control OLED on Keystage, 
// but many of transmitted CC in Native Mode are different from the normal mode. 
// This script activates Keystage Native Mode and convert the most of CC like the normal mode.

Const
    KSMemberID : String = "09"                  // Keystage-49 = 01 / Keystage-61 = 09
    KSMidiOutDeviceName : String = "Keystage"   // Name shown in MIDI Output Ports
    KSCCChannel : Integer = 1                   // CC is transmitted from Keystage via this channel
    KSKnobCCStart : Integer = 24                // Keystage Knob 1-8 are assigned from this CC number
    KSPedalCC : Integer = 119                   // Pedal Control Change (if not useing set 0)

Var    
    Keystage : MidiInDeviceAlias                // Keystage device alias defined in Rig Manager

// Activate Keystage Native Mode
Initialization
    var sysexHexStr : string = "F04240000169" + KSMemberID + "0200000001F7"

    SendSysexNowToMidiOutDevice(KSMidiOutDeviceName, sysexHexStr)
End

// Change Native Mode CC numbers of Keystage Knob 1-8 
// from CC0-CC7 to a group of numbers beginning with KSKnobCCStart  
// and change the channel from 16 to KSCCChannel.
On ControlChangeEvent(m : ControlChangeMessage) Matching [0..7] from Keystage
    var new_m : ControlChangeMessage

    If m.GetChannel() == 16 then
        new_m = WithCCNumber(m, GetCCNumber(m) + KSKnobCCStart)
        InjectMidiEventViaRigManager(Keystage, WithChannel(new_m, KSCCChannel));
    Else
        InjectMidiEventViaRigManager(Keystage, m);
    End
End
    
// Change Native Mode behavior of Keystage buttons from momentary to toggle 
// and change the channel from 16 to KSCCChannel.
// So that it is convenient to assign buttons to Next/Prev Rackspace/Song.
On ControlChangeEvent(m : ControlChangeMessage) Matching 41,42,45,46,47,48,49 from Keystage
    If m.GetCCValue() == 127 then   // this means 0 is ignored
        InjectMidiEventViaRigManager(Keystage, WithChannel(m, KSCCChannel));
    End
End

// Change Native Mode CC number of Keystage pedal CC (if using)
// from 2 to KSCCChannel.
On ControlChangeEvent(m : ControlChangeMessage) Matching KSPedalCC from Keystage
    If KSPedalCC <> 0 then
        InjectMidiEventViaRigManager(Keystage, WithChannel(m, KSCCChannel));
    Else
        InjectMidiEventViaRigManager(Keystage, m);
    End
End
  • Global Rackspace Script
// Display message on Keystage OLED (Global Rackspace Script) 
// ==========================================================
// Keystage Native Mode enables users to control OLED on Keystage, 
// This script is an example to display rackspace name on main OLED and message on each knob OLED.

Const
    KSMemberID : String = "09"                  // Keystage-49 = 01 / Keystage-61 = 09
    KSMidiOutDeviceName : String = "Keystage"   // Name shown in MIDI Output Ports

    
// Keystage Native Mode Display Message 
//  col=0: Main, col=1-8: Knob 1-8
//  row=0: Upper, Row=1: lower
Function DisplayKeystage(col : int, row : int, text : string)
    var 
        textLenHexStr : string = IntToHexString( 3 + Length(text))
        sysexHexStr : string = "F04240000169" + KSMemberID + textLenHexStr + "000028" 
            + IntToHexString(col) + IntToHexString(row) + StringToHexString(text) + "F7"

    SendSysexNowToMidiOutDevice(KSMidiOutDeviceName, sysexHexStr)
End

    
// Display messages on Keystage knob OLED at the initialization
Initialization

    var i, j : int

    // init OLED
    For i = 0; i < 9; i = i + 1 Do
        For j = 0; j < 2; j = j + 1 Do
            DisplayKeystage(i, j, "")
        End
    End

    // Display message on each knob
    DisplayKeystage(1, 0, "PAD Volume")
    DisplayKeystage(2, 0, "Delay")
    DisplayKeystage(2, 1, "MIX")
    DisplayKeystage(3, 0, "HPF Freq")
    DisplayKeystage(4, 0, "Modulator")

    DisplayKeystage(8, 0, "Delay")
    DisplayKeystage(8, 1, "Feedback")
End


// Display rackspace name on Keystage main OLED
On Rackspace(oldRackspaceIndex : integer, newRackspaceIndex : integer)
    DisplayKeystage(0, 1, GetRackspaceNameAtIndex(newRackspaceIndex))
End

P.S.: Thanks to Gig Performer, my band’s one-month, 21-venue tour (via high-speed rail) went off without a hitch!
Gig Performer and Keystage (with USB bus powered and internal audio I/F) are the perfect combination for me to downsize significantly. :smiley:

6 Likes

Great to hear! :beers:
Thanks for sharing!

2 Likes