--
Contact support anytime: sup...@figure53.com
Follow QLab on Twitter: https://twitter.com/QLabApp
User Group Code of Conduct: https://qlab.app/code-of-conduct/
---
You received this message because you are subscribed to the Google Groups "QLab" group.
To unsubscribe from this group and stop receiving emails from it, send an email to qlab+uns...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/qlab/0ba85fec-871f-423b-ae7e-e8ec02eac807n%40googlegroups.com.
Do you know if there's a way to do this with one knob?
set userDuration to 10 -- This is the time remaining to which to load the selected cue(s) before starting themtell front workspacerepeat with eachCue in (selected as list)stop eachCueset eachDuration to ((pre wait of eachCue) + (duration of eachCue)) -- Include the Pre Wait for effective durationif eachDuration > userDuration thenload eachCue time eachDuration - userDurationend ifstart eachCueend repeatend tell
-- Only works properly when run as a separate process!-- This process will not nudge into pre / post waits: it only works on the "action" of a cue-- NB: the OSC command will NOT WORK if the workspace has a Passcode-- (Have to use OSC as AppleScript "load" inadvertently resets Audio Cues to their programmed levels – ie: ignores subsequent fades)set userNudge to -10set userWrapAround to true -- Set this to false if you don't want to start nudging from the beginning when you hit the end (or vice versa)
tell application id "com.figure53.QLab.4" to tell front workspace
repeat with eachCue in (selected as list)
if q type of eachCue is not "Script" then -- Protect the script from running on itselftry
-- Pause the cue, if necessary
if running of eachCue is true thenpause eachCueset startFlag to trueelseset startFlag to falseend if
-- Find out when we are
set eachDuration to duration of eachCue -- Need this again later, so store it
set elapsedTime to (percent action elapsed of eachCue) * eachDuration-- ###FIXME### As of 4.6.9, "action elapsed" reports differently between clicking in waveform and loading to time when rate ≠ 1-- Also, time reported by "action elapsed" _includes_ the pre wait whilst loadActionAt method will effectively add it back on again-- (AppleScript "load" doesn't add pre wait back; nor does "Load to time…" function in Edit mode)
-- loadActionAt method "number" (time) ignores rate, so all times have to be scaled accordingly
set eachRate to rate of eachCue
set variNudge to userNudge * eachRateset variDuration to eachDuration * eachRateset variElapsed to elapsedTime * eachRate
-- Calculate time to load to, including wrapping round if needed
set loadTime to variElapsed + variNudge
if loadTime < 0 then -- We've reached the beginningif userWrapAround is true and loadTime ≤ variNudge then -- Go to 0 before wrapping (if cue is running it will never wrap…)set loadTime to variDuration + variNudgeelseset loadTime to 0end ifend if
if loadTime > variDuration then -- We've reached the endif userWrapAround is true and loadTime - variDuration ≥ variNudge then -- Go to end before wrappingset loadTime to 0elseset loadTime to variDurationend ifend if
-- Load the cue: loadTime is the time into the _action_ of the cue as, according to the OSC API:-- "QLab will automatically add the pre-wait [sic] of the specified cue … in order to load the cue to the correct time"
set eachID to uniqueID of eachCue
tell me to do shell script "echo '/cue_id/" & eachID & "/loadActionAt " & loadTime & "' | nc -u -w 0 localhost 53535"
-- Restart the cue if it was running
if startFlag is true thenstart eachCueend if
end tryend ifend repeatend tell
-- to skip to the last 10 seconds of the most recently started group cue
tell application id "com.figure53.QLab.4" to tell front workspace
try
set theselected to last item of ((cues whose running is true and q type is "Group") as list)
stop theselected
delay 0.1
load theselected time ((pre wait of theselected) + (duration of theselected)) - 10
delay 0.1
start theselected
end try
end tell
You will have to check that the way QLab handles OSC cues in a timeline group when it is loaded to time is appropriate for your needs, but using this script is not dissimilar in this respect to scrubbing the group cue in active cues.
Mic