// Control the Mastermind GT 16 var RJMPrefix : string = "F000015B001D00" // Defined by RJM for the GT midiDeviceName : String = "Mastermind GT MMGT Input" // The standard MIDI port name // Construct a complete sysex message to send to pedal function MakeRJMLabelSysexMessage(pageNumber :integer, buttonNumber : integer, color : integer, buttonLabel : string ) returns String var pp : string = IntToHexString(pageNumber) bb : string = IntToHexString(buttonNumber) cc : string = IntToHexString(color) text : string = StringToHexString(buttonLabel) result = RJMPrefix + pp + bb + cc + text + "F7" end function RJMSendTitle(title : string) var sysexString : String = MakeRJMLabelSysexMessage(0x7f, 0, 0, title) SendSysexNowToMidiOutDevice(midiDeviceName, sysexString) end var disabledButtonColor : integer = 0 usedButtonColor : integer = 3 whiteColor : integer = 7 // Set the label text and color of the specified button function SendToRJM(buttonNumber : integer, color : integer, buttonLabel : String) var sysexString : String = MakeRJMLabelSysexMessage(0,buttonNumber,color, buttonLabel) SendSysexNowToMidiOutDevice(midiDeviceName, sysexString) End Initialization RJMSendTitle("Reelin Gig") // Name of gig - just confirms that everything is working SendToRJM(0,5,"Tap") // Use a button to do Tap Tempo SendToRJM(3,1,"Panic") // In case we need to reset audio - has never happened // The messages sent from the pedal need to be assigned Global MIDI settings as appropriate End // Iterate through song parts and create sysex messages // and send out sysex messages Function SendSongPartsToPedal() var count : integer = GetSongPartCount() i : integer partname : string myMidiMessage : MidiMessage sysexString : String firstPartButtonIndex : integer = 4 maxParts : integer = 6 buttonColor : integer for i = 0; i < maxParts; i = i + 1 do if i < count then partname = GetSongPartName(i) buttonColor = usedButtonColor else partname = " " buttonColor = disabledButtonColor end // Now send the part name SendToRJM(i + firstPartButtonIndex,buttonColor,partname) end End // Called when you switch to another song On Song(oldSongIndex : integer, newSongIndex : integer) var songname : String = GetSongName(newSongIndex) RJMSendTitle(songname) // Update the song name in the center large panel SendSongPartsToPedal() // Send the song part names to the individual buttons End