Onsong to GP Setlist Integration

I discovered a game changer when it comes to navigating your setlist using OnSong.

No need to use msb/lsb or limit yourself to program changes.

I found an option in OnSong that sends the name of the song in a Midi SysEX message when changing songs. You can capture this SysEx message using a scriptlet and have GP switch to that song.

The key is that you want the song titles to match exactly, including casing.

Since there were no ascii scripting functions, I had to write scripting that converts Hex to Ascii.

var ascii : string array = [" β€œ,”!β€œ,β€β€œβ€œ,”#β€œ,”$β€œ,”%β€œ,”&β€œ,”'β€œ,”(β€œ,”)β€œ,”*β€œ,”+β€œ,”,β€œ,”-β€œ,”.β€œ,”/β€œ,β€œ0”,β€œ1”,β€œ2”,β€œ3”,β€œ4”,β€œ5”,β€œ6”,β€œ7”,β€œ8”,β€œ9”,”:β€œ,”;β€œ,”<β€œ,”=β€œ,”>β€œ,”?β€œ,”@β€œ,β€œA”,β€œB”,β€œC”,β€œD”,β€œE”,β€œF”,β€œG”,β€œH”,β€œI”,β€œJ”,β€œK”,β€œL”,β€œM”,β€œN”,β€œO”,β€œP”,β€œQ”,β€œR”,β€œS”,β€œT”,β€œU”,β€œV”,β€œW”,β€œX”,β€œY”,β€œZ”,”[β€œ,”\β€œ,”]β€œ,”^β€œ,”_β€œ,”`”,β€œa”,β€œb”,β€œc”,β€œd”,β€œe”,β€œf”,β€œg”,β€œh”,β€œi”,β€œj”,β€œk”,β€œl”,β€œm”,β€œn”,β€œo”,β€œp”,β€œq”,β€œr”,β€œs”,β€œt”,β€œu”,β€œv”,β€œw”,β€œx”,β€œy”,β€œz”]

function GetAscii(a : int array) returns string
var s : string
var i : int
var c : int

//Print ("Ascii")

for i = 0; i < Size(a); i = i + 1 do
    if a[i] > 31 && a[i] < 123 then
        c = a[i] - 32
        s = s + ascii[c]        
    end 
end

result = s

end

include β€œASCII”
//Called when a MIDI System Exclusive (sysex) message is received

On SysexEvent(s : SysexMessage)

var len : int
var val : integer array
var i : integer
var sngint : integer array
var sng : string
var index : int
var switch : Boolean
var slmode : Boolean

slmode = InSetlistmode()

If slmode == True Then

	//Print("OnSysex")
	len = SM_Length(s)
	//Print(len)
	for i = 0; i < len; i = i + 1 do
         val <-- SM_GetValue(s,i)
	end

	If val[0] == 240 && val[1] == 0 && val[2] == 2 && val[3] == 36 && val[4] == 13 && val[5] == 83 Then
         Print("IsHeader")
         for i = 6; i < len - 1; i = i + 1 do
       	sngint <-- val[i]
         end
    End
 
    //Print(Size(sngint))
    sng = GetAscii(sngint)

    index = GetSongIndex(sng)

    switch = SwitchToSongByIndex(index,0)
    Print(sng)
    Print(index)

End 

End

Wrapped the SysEx script in an If statement to prevent script from crashing when GP is not in SetListMode.

OnSongToGP.zip (1.2 KB)

Here’s the two gpscript files.

Save to the scripts directory, then create a Scriptlet widget and load the OnSongToGP.gpscript file into the scriptlet. Route your Midi In from your source with SysEx enabled.

Is that option here? OnSong | Manual | Broadcast MIDI Settings

Don’t see how that would be useful in GP unless it doesn’t actually send the program change

That is correct.

@dhj Using the files I posted, GP will read the Song Name from the SysEx message and no matter what position it is in your setlist will switch to that song. The name just has to match exactly and GP has to be in Setlist mode with that song in the current Setlist.

Great stuff!

@npudar Did you get it to work?

We’ll feature this in the newsletter! :slight_smile:
That is why I was curious where was that option in OnSong.

Is there anyway you could possibly do a video showing how this is done? I’m fairly new to the Mac and gig performer although I’ve been using on song for many years. Thanks in advance!

Meanwhile, you can read this: [blog] How to use OnSong with Gig Performer - #27 by npudar

@lbkeys I’m not sure when I’ll have the time to make a video. I’ll explain the steps and if you run into issues just reply and I’ll help where I can.

  1. Start by turning on Midi Broadcast messages in Onsong. You’ll find this under Settings β†’ Midi Settings β†’ Sync β†’ Broadcast. Enable Broadcast Midi option and remove all the tags except Song Title.

  2. Connect iPad to Computer running Gig Performer

  3. In GP go to Options β†’ Midi Ports and make sure that the iPad shows up as a Midi port and that it is checked as enabled.

  4. Run a quick test in GP by opening the Global Midi Monitor under the Window menu.

  5. You should see System Exclusive Midi messages from the Onsong beginning with F0 00 02 24. This is Onsong’s exclusive header for any SysEx messages.image

  6. In my example above you can see the song title β€œKryptonite”. After the header is a carriage return, followed by the 53 which is an acii β€œS”, Onsong’s code for Song title. The rest is asii text till the ending F7.

  7. If you’re successful with receiving Onsong’s SysEx messages, now you just need to download my scipts and place them in your GP Scripts folder.

  8. Open your Global Rackspace and add a Midi In block for the iPad midi device. Make sure that you are not blocking Midi Sysex in the Midi In Block’s settings. Optionally from this step you can add a Midi Monitor, connect your Midi In Block to the monitor and verify that you are seeing the same SysEx messages that you saw in the Global Midi Monitor.

  9. Add a Scriptlet block to the Global Rackspace and connect your iPad Midi In block to the Scriptlet block.

  10. Open the Scriptlet block. Chose the Edit Script button.

  11. Click the Load Script From File button

  12. Load the file titled OnSongToGP2.gpscript

  13. Save your Gig file so you don’t have to repeat these steps.

  14. In Setlists you will want to have a Song listed that matches the title in Onsong Exactly.

  15. When you select the song in Onsong, GP will automatically switch to that song if it is listed in the Set List.

  16. One note, I have been working with Onsong on a bug in the Section Name broadcast that should be fixed in the next Onsong 2026 release. After that release I plan to post an updated script that will also automatically switch Song Parts in GP to match the currently selected Section in Onsong.

Best,

Hi Shawn. I’ve tried everything but to no avail. For some reason, my fourth generation iPad Pro 11 inch is somehow not compatible with my 2024 MacBook Pro. Also, broadcast MIDI is not an available option in the settings of OnSong 2020. Any ideas?