Advertisement
duquesne9

Looping x_Fade Playlist

Jun 5th, 2019
1,046
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. tell application id "com.figure53.qlab.3" to tell front workspace
  2.    
  3.     set mySelected to (selected as list)
  4.     set myCount to (count mySelected)
  5.     set loopStartTarget to first item of mySelected
  6.    
  7.     repeat with myCurrentCue in mySelected --repeatA
  8.        
  9.         --get the unique id of current cue
  10.         set myID to uniqueID of myCurrentCue
  11.        
  12.         --move playback position
  13.         tell the current cue list
  14.             set playback position to cue id myID
  15.         end tell
  16.        
  17.         --set level and continue of current cue
  18.         tell front workspace
  19.             set originalLevel to myCurrentCue getLevel row 0 column 0
  20.             myCurrentCue setLevel column 0 row 0 db -120
  21.         end tell
  22.         set the continue mode of myCurrentCue to auto_continue
  23.         set myPostWait to ((duration of myCurrentCue) - 8)
  24.        
  25.         --if first cue is selected
  26.         if myCurrentCue's contents is the first item of mySelected then
  27.            
  28.             --make first fade
  29.             make type "Fade"
  30.             --find it's name
  31.             set myNewCueList to selected
  32.             set myNewCue to last item of myNewCueList
  33.             set the cue target of myNewCue to myCurrentCue
  34.             tell front workspace --tellD
  35.                 myNewCue setLevel column 0 row 0 db originalLevel
  36.             end tell --tellD
  37.             set duration of myNewCue to 6
  38.             set post wait of myNewCue to myPostWait
  39.             set the continue mode of myNewCue to auto_continue
  40.             --set previous cue
  41.             set myPreviousCue to myCurrentCue
  42.             set myCount to myCount - 1
  43.            
  44.             --otherwise
  45.            
  46.         else if myCount is 1 then
  47.             make type "Fade"
  48.             set myNewCueList to selected
  49.             set myNewCue to last item of myNewCueList
  50.             set the cue target of myNewCue to myCurrentCue
  51.             tell front workspace
  52.                 myNewCue setLevel column 0 row 0 db originalLevel
  53.             end tell
  54.             set the continue mode of myNewCue to auto_continue
  55.             set the duration of myNewCue to 6
  56.             --put in fade in or fade out??
  57.             --set the post wait of myNewCue to myPostWait
  58.            
  59.            
  60.             --make new faded and stop
  61.             make type "Fade"
  62.             set myNewCueList to selected
  63.             set myNewCue to last item of myNewCueList
  64.             set the cue target of myNewCue to myPreviousCue
  65.             tell front workspace
  66.                 myNewCue setLevel column 0 row 0 db -120
  67.             end tell
  68.             set stop target when done of myNewCue to true
  69.             set continue mode of myNewCue to auto_continue
  70.             set duration of myNewCue to 8
  71.             set the post wait of myNewCue to myPostWait
  72.             set myPreviousCue to myCurrentCue
  73.             set myCount to myCount - 1
  74.            
  75.             --make last fade and stop
  76.             make type "Fade"
  77.             set myNewCueList to selected
  78.             set myNewCue to last item of myNewCueList
  79.             set cue target of myNewCue to myPreviousCue
  80.             tell front workspace
  81.                 myNewCue setLevel column 0 row 0 db -120
  82.             end tell
  83.             set the continue mode of myNewCue to auto_continue
  84.             set duration of myNewCue to 8
  85.             set stop target when done of myNewCue to true
  86.             set the post wait of myNewCue to myPostWait
  87.             set myPreviousCue to myCurrentCue
  88.             set myCount to myCount - 1
  89.            
  90.         else
  91.             --make new fade
  92.             make type "Fade"
  93.             set myNewCueList to selected
  94.             set myNewCue to last item of myNewCueList
  95.             set the cue target of myNewCue to myCurrentCue
  96.             tell front workspace
  97.                 myNewCue setLevel column 0 row 0 db originalLevel
  98.             end tell
  99.             set the continue mode of myNewCue to auto_continue
  100.             set duration of myNewCue to 6
  101.             --set the post wait of myNewCue to myPostWait
  102.            
  103.             --maek new fade and stop
  104.             make type "Fade"
  105.             set myNewCueList to selected
  106.             set myNewCue to last item of myNewCueList
  107.             set the cue target of myNewCue to myPreviousCue
  108.             tell front workspace
  109.                 myNewCue setLevel column 0 row 0 db -120
  110.             end tell
  111.             set the post wait of myNewCue to myPostWait
  112.             set the stop target when done of myNewCue to true
  113.             set the continue mode of myNewCue to auto_continue
  114.             set duration of myNewCue to 8
  115.             set myPreviousCue to myCurrentCue
  116.             set myCount to myCount - 1
  117.            
  118.         end if
  119.        
  120.     end repeat
  121.    
  122.     make type "Start"
  123.     set loopStart to last item of (selected as list)
  124.     set cue target of loopStart to loopStartTarget
  125.    
  126. end tell
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement