Nudge without reloading

220 views
Skip to first unread message

Rich Walsh

unread,
Feb 22, 2018, 9:42:34 AM2/22/18
to ql...@googlegroups.com
I have a little script for nudging cues backwards and forwards, but as it relies on loading to time a fundamental flaw has come to light: when you nudge an Audio Cue it resets its levels to those stored in the cue, not those set by subsequent fades. Dragging the yellow bar in the Active Cues pane doesn’t do this. Is there a way of scripting action elapsed that I’ve missed?

Rich

Chris Ashworth

unread,
Feb 22, 2018, 9:52:07 AM2/22/18
to Rich Walsh, ql...@googlegroups.com
Hi Rich,

The approach that the active cues pane uses is to do:

- a hard pause
- load at time
- resume

Rich Walsh

unread,
Feb 22, 2018, 10:02:24 AM2/22/18
to ql...@googlegroups.com
The mechanism is different from load to time. Make an Audio Cue, set it to silent. Make a Fade Cue to fade it in. Play sequence. Drag yellow bar around: Audio Cue does not reset to silent. Pause it and use the load to time slider: it does reset to silent.

Rich

Chris Ashworth

unread,
Feb 22, 2018, 3:06:08 PM2/22/18
to Rich Walsh, ql...@googlegroups.com
Hm, I can’t necessarily speak to the load-to-time slider itself; that may be unloading and then reloading to ensure it “takes”. 

Also, if you try “loadActionAt” (at least available via OSC; I don’t recall if there’s an AppleScript hook) does that work differently?

Rich Walsh

unread,
Feb 22, 2018, 3:46:26 PM2/22/18
to ql...@googlegroups.com
AppleScript:

loadv : Load a cue or workspace to a given time.
load specifier : The cue(s) or workspace(s) to load.
[time real] : Load time.

With OSC:

-- Only works properly when run as a separate process!

set userNudge to 5

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 itself
try
if running of eachCue is true then
pause eachCue
set startFlag to true
else
set startFlag to false
end if
set currentTime to action elapsed of eachCue
set eachID to uniqueID of eachCue
tell me to do shell script "echo '/cue_id/" & eachID & "/loadActionAt " & currentTime + userNudge & "' | nc -u -w 0 localhost 53535"
if startFlag is true then
start eachCue
end if
end try
end if
end repeat
end tell

This is pretty ugly, but it doesn’t reset the levels when nudging – so the OSC mechanism is more like the yellow bar mechanism. (loadAction is like the load to time slider.)

Only problem is, if I have a 2s pre wait userNudge of 5 goes forward by 7s while -5 goes backwards by 3s… I tried including “pre wait elapsed” but that seems to report exactly the same time as “action elapsed” so doubles the problem. I don’t recall playing with “pre wait elapsed” before, but I’d expect it to get to 2s and stop? Bit confused, but a bit distracted this evening: this will have to go on a pile for later.

I don’t like relying on OSC inside AppleScript – and clearly I can’t do the calculation using #OSC variables# – so I think I’ll develop something that loads fades to just before completion if they are selected at the same time so as to crash them along with the audio.

Rich

Rich Walsh

unread,
Feb 22, 2018, 5:25:18 PM2/22/18
to ql...@googlegroups.com
Figured it out as it was annoying me:

-- Only works properly when run as a separate process! [Won't work if workspace uses Passcode…]

set userNudge to 5

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 itself
try
if running of eachCue is true then
pause eachCue
set startFlag to true
else
set startFlag to false
end if
set currentTime to ((action elapsed of eachCue) - (pre wait of eachCue)) -- loadActionAt method adds pre wait back to time argument!
set eachID to uniqueID of eachCue
tell me to do shell script "echo '/cue_id/" & eachID & "/loadActionAt " & currentTime + userNudge & "' | nc -u -w 0 localhost 53535"
if startFlag is true then
start eachCue
end if
end try
end if
end repeat
end tell

There are some issues with pre wait elapsed, action elapsed & post wait elapsed. The percent versions are more predictable – action elapsed, for example, reports a different time if rate≠1 between clicking in a waveform to load and loading with the slider to the same point. There seems to be no difference between pre wait elapsed & action elapsed, which is counter intuitive. Post wait elapsed seems to be the only one that reports what you’d expect: the number you can see in the Post Wait column.

Rich

--
Contact support anytime: sup...@figure53.com
Follow Figure 53 on Twitter: https://twitter.com/Figure53
User Group Code of Conduct: https://figure53.com/help/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/AA7127E5-992F-4E57-9027-50EB54401EDB%40mac.com.
For more options, visit https://groups.google.com/d/optout.

Matt Padden

unread,
Feb 22, 2018, 5:36:14 PM2/22/18
to QLab
I tried variations of:

/cue/selected/loadAt (#/cue/selected/currentFileTime# + 5)

on a paused cue to check if the nudge occurred, but it doesn't. Not sure if I have the #variable# delimiters correctly set (or do I need a second set outside the () brackets?).

I wonder what is different in the way the AppleScript and OSC 'load' methods behave that causes this level-resetting discrepancy.

Matt

Rich Walsh

unread,
Feb 22, 2018, 5:44:14 PM2/22/18
to ql...@googlegroups.com
I am 99% sure you can’t do calculations inside an OSC message, even QLab’s “sort of OSC” messages. The form /cue/1/property/+ {delta} is using the + as part of the OSC Address Pattern, not the OSC Arguments. It can’t be extrapolated to do sums…

Rich
Reply all
Reply to author
Forward
0 new messages