Trying To Send MIDI to Load a Song In Mobilesheets

Hi All

I’m trying to load a song in mobilesheets on my android Samsung Tab S7+ tablet.
Can anyone see what I’m doing wrong in the binding shown.

When I press a key on my Stream Deck to load a new song into Cantabile, I would like to send a MIDI program change to my tablet to load the same song in Mobilesheets.

My tablet is connected to my laptop computer by a USB cable. When I put a number (say 4) in the Result box in the binding Mapping area, everything works and the song with the ID of 4 is loaded in Mobilesheets.
When I try to use the variable “SongProgram” in the result box nothing happens.

The green button in the picture shows that SongProgram has the correct ID for the song.

I’m assuming that this variable can be used in the Result box because I don’t get any syntax errors even though this and many other variables are not shown when I click the arrow next to the Result box.
Perhaps @Brad can confirm that these variables can be used in the Result box.

Otherwise, after playing around with this binding for a few hours, I’m stuck.

Hope someone can help.
Thanks
Baz

Have you tried triggering the binding by hand (using the right-facing triangle to the left of the binding in the list-view of bindings)?

Another debugging thing I do is to bring down the target application (MobileSheets) and replace it with a MIDI monitor app (I use MidiView). You should be able to select the MIDI port that MobileSheets is listening on (if the port is not available - maybe because MobileSheets is still running) then MidiView will complain … If you can connect using MidiView, you’ll see what Mobile Sheets is receiving.

You can also launch a MIDI Monitor window in Cantabile on the output port to see what C4 is sending.

Try an alternative binding:

This will send the associated program change whenever you load a different song in your setlist - without needing any expression magic…

Thanks for your suggestions @ClintGoss and @Torsten

@Torsten’s suggestion of another binding solved it.

It would be interesting to know if those variables I mentioned work or not - for future reference.

Many thanks @Torsten

The problem with the original binding is related to the use of SongProgram which is a string, and possibly 1 based (not zero based).

Firstly, the SongProgram variable is intended to be used as a string replacement variable like “The current song program is $(SongProgram)” and the program number will be formatted according to the program number format setting in options.

So, you could use it in the binding expression as int(SongProgram).

However, if you’ve selected to display 1 based program numbers you’ll need to subtract 1 to make it zero based again as required by MIDI messages.

int(SongProgram)-1

But, if it’s a banked program number, the int isn’t going to work.

Hrm, that’s a bit of a mess. Let me have a think about ways to clean this up.

Some possibilities:

  1. I could fix the numeric based variables to only be formatted when used in a string replacement (this would be ideal, but not sure of the dev cost/impact)
  2. Provide a function to parse a program number back to a raw integer. (least impact, less ideal).
  3. Provide an alternate set of variable for string replacement vs expression use. (ugh, duplication).

In the meantime, Torsten suggestion is best.

Thanks for reporting this.

Hi Brad
Thanks for the explanation. I am using Torsten’s suggestion for now.

I hope my original effort can be made to work as it seemed logical to me.
Baz