Hi guys
Thank you for your quick response, and sorry, mine is considerably slower!
Rich, I'm aware the commands discussed aren't actually MIDI SysEx.
However, if you want to (or need to) use hexadecimal MIDI commands to control a piece of hardware, these can only be entered in QLab by setting the MIDI cue's 'Message type' to ... drumroll ... 'MIDI SysEx message'! Hence the confusion. I'm sorry if I went over that detail rather lightly in my original question.
Perhaps it's worth renaming this option to 'Hexadecimal MIDI string', or something of the sort?
(I'm surprised you're so appalled by the A&H MIDI documentation. I'm not saying you're wrong - it's the only brand I've ever tried this kind of stuff with, but I've never NOT found what I needed in the documentation.
However, I can imagine that some other brands use a, well, let's say, more organised scheme or something.)
I tried out your template script for creating MIDI cues, it's impressive and it works very well! However, it seems to have no option for creating the hexadecimal strings I needed.
micpool, you were correct to assume that I already had the command working and just needed a way to increment one of the hex bytes.
I liked your first script better (not creating groups of two MIDI cues, but creating just one MIDI cue for each command), but I played around with it to create neater cue names.
This is what I ended up using:
tell application id "com.figure53.QLab.4" to tell front workspace
set hexChars to "0123456789ABCDEF"
set theMIDIconstant to "B9 00 00 C9 "
repeat with x from 0 to 127
set hexString to (character (x div 16 + 1) of hexChars) & (character (x mod 16 + 1) of hexChars)
set hexString to theMIDIconstant & hexString
make type "midi"
set theCue to last item of (selected as list)
set the message type of theCue to sysex
set the sysex message of theCue to hexString
set nametypeofcue to "Recall scene "
set numberofCue to x + 1
set the q name of theCue to nametypeofcue & numberofCue
set numbertypeofcue to "RS"
set the q number of theCue to numbertypeofcue & numberofCue
end repeat
end tell
I have created several instances of this script, the second version changes the theMIDIconstant to B9 00 01 C9 and the numberofCue to x + 129, and so on. I didn't necessarily need to create all 500 scenes with one script, I just needed a script that's simple enough for me to work with ;)
And now I can use this to create all kinds of commands for the dLive, eg. controlling the mutes for input channels. This uses a completely different MIDI string. The script looks like this:
tell application id "com.figure53.QLab.4" to tell front workspace
set hexChars to "0123456789ABCDEF"
set theMIDIconstant1 to "99 "
set theMIDIconstant2 to " 7F "
set theMIDIconstant3 to " 00"
repeat with x from 0 to 127
set hexString to (character (x div 16 + 1) of hexChars) & (character (x mod 16 + 1) of hexChars)
set hexString to theMIDIconstant1 & hexString & theMIDIconstant2 & hexString & theMIDIconstant3
make type "midi"
set theCue to last item of (selected as list)
set the message type of theCue to sysex
set the sysex message of theCue to hexString
set nametypeofcue to "Input channel MUTE for Input "
set numberofCue to x + 1
set the q name of theCue to nametypeofcue & numberofCue
set numbertypeofcue to "IM"
set the q number of theCue to numbertypeofcue & numberofCue
end repeat
end tell
Thank you so much for handing me this useful tool!