Advertisement
duquesne9

Make OSC from Midi LX

Jun 26th, 2019
1,144
0
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 robotlightsyou@gmail.com with subject "QLAB 3 template issues"
  4. .*)
  5.  
  6. tell application id "com.figure53.qlab.4" to tell front workspace
  7.    
  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
  9.    
  10.     set eosPreamble to "/eos/cue/"
  11.     set eosPostamble to "/fire"
  12.    
  13.     set selectedCues to (selected as list)
  14.    
  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
  18.            
  19.             set eachCueID to uniqueID of eachCue -- necessary for deleting later
  20.             set qNumber to q_number of eachCue -- MSC q number field
  21.            
  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
  28.            
  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
  35.            
  36.             set selected to cue id eachCueID
  37.            
  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)
  41.            
  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
  45.            
  46.             delete cue id eachCueID of parent of eachCue -- delete MSC cue
  47.            
  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
  54.            
  55.         end if
  56.     end repeat
  57. end tell
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement