Make OSC from Midi LX

duquesne9 Jun 26th, 2019 216 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. (*
  2. Tested with QLab v3.2.14 Oct 2018
  3. Please report any issues to with subject "QLAB 3 template issues"
  4. .*)
  6. tell application id "com.figure53.qlab.4" to tell front workspace
  8.     set oscPatch to 1 -- Change this to the patch you're using in your workspace to send OSC to the Eos/Ion/Gio/Nomad
  10.     set eosPreamble to "/eos/cue/"
  11.     set eosPostamble to "/fire"
  13.     set selectedCues to (selected as list)
  15.     --gather details of existing midi cues
  16.     repeat with eachCue in selectedCues
  17.         if q type of eachCue is "MIDI" and message type of eachCue is msc and command number of eachCue is 1 then -- OK, it's an MSC cue sending a GO
  19.             set eachCueID to uniqueID of eachCue -- necessary for deleting later
  20.             set qNumber to q_number of eachCue -- MSC q number field
  22.             -- If there's a cue list number in the MSC cue, use it. Otherwise, use the default "1"
  23.             if q_list of eachCue is not "" then
  24.                 set qlist to q_list of eachCue -- MSC q list field
  25.             else
  26.                 set qlist to "1"
  27.             end if
  29.             -- Gather cue properties to duplicate in new cue
  30.             set cueNumber to q number of eachCue
  31.             set cueName to q name of eachCue
  32.             set continueMode to continue mode of eachCue
  33.             set preWait to pre wait of eachCue
  34.             set postWait to post wait of eachCue
  36.             set selected to cue id eachCueID
  38.             --make new OSC with gathered details
  39.             make type "network" -- make the new OSC cue
  40.             set newCue to last item of (selected as list)
  42.             set patch of newCue to oscPatch
  43.             set osc message type of newCue to custom
  44.             set custom message of newCue to eosPreamble & qlist & "/" & qNumber & eosPostamble
  46.             delete cue id eachCueID of parent of eachCue -- delete MSC cue
  48.             -- Duplicate MSC cue's properties on the new OSC cue
  49.             set q number of newCue to cueNumber
  50.             set q name of newCue to cueName
  51.             set continue mode of newCue to continueMode
  52.             set pre wait of newCue to preWait
  53.             set post wait of newCue to postWait
  55.         end if
  56.     end repeat
  57. end tell
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand