Stop audio cue on next silence

179 views
Skip to first unread message

micpool

unread,
Mar 15, 2022, 10:54:39 AM3/15/22
to QLab
This could be improved by making the detection more sophisticated but as a proof of concept is quite interesting. (Don't use for anything important until you have determined it will work for your purpose)

Screen Shot 2022-03-15 at 14.51.18.png

Screen recoding and demo workspace bundle attached

Mic
Stop on silence.zip
StopOnSilence.mov

Roly Botha

unread,
Mar 15, 2022, 11:16:50 AM3/15/22
to QLab
This is so useful! And pretty much exactly perfect for my current show. I’ve just been using loads of slices and revamps but this will be so much more simple! 

Thank you as always Mic!

All my best,
Roly (they/them)

--
Roly Botha

Actor, Composer, Sound Designer

www.spotlight.com/9738-1272-3687 
www.rolybotha.co.uk

As a freelancer, I will sometimes send emails at unusual times. I never expect anyone to respond outside their own normal working hours. 

On 15 Mar 2022, at 14:54, micpool <m...@micpool.com> wrote:

This could be improved by making the detection more sophisticated but as a proof of concept is quite interesting. (Don't use for anything important until you have determined it will work for your purpose)

<Screen Shot 2022-03-15 at 14.51.18.png>

Screen recoding and demo workspace bundle attached

Mic

--
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/e0805b2e-5925-4584-8e3b-71feff4b8164n%40googlegroups.com.
<Stop on silence.zip><Screen Shot 2022-03-15 at 14.51.18.png><StopOnSilence.mov>

micpool

unread,
Mar 15, 2022, 11:30:33 AM3/15/22
to QLab
On Tuesday, March 15, 2022 at 3:16:50 PM UTC Roly Botha wrote:
This is so useful! And pretty much exactly perfect for my current show. I’ve just been using loads of slices and revamps but this will be so much more simple! 

I'd test it thoroughly before you put it on a show.

You can make it  safer by adjusting the threshold in the script . 0 will pretty much need  digital silence before it triggers a stop.

Further refinements would involve putting the stops in a separate group with a  pre wait of say 1 second with the script stopping that group any time the threshold was exceeded again  (or you could have 2 thresholds) That would mean a silence would have to last for 1 second before the stop fired.  The script  would also have to set the target for one of the stop cues   to the audio cue that was being analysed .


Mic

Roly Botha

unread,
Mar 15, 2022, 11:37:44 AM3/15/22
to QLab
Oh absolutely - test and test and test.

Thanks for the info on refinements!

All my best,
Roly (they/them)

--
Roly Botha

Actor, Composer, Sound Designer

www.spotlight.com/9738-1272-3687 
www.rolybotha.co.uk

As a freelancer, I will sometimes send emails at unusual times. I never expect anyone to respond outside their own normal working hours. 
--
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.

olivie...@gmail.com

unread,
Mar 16, 2022, 10:38:20 AM3/16/22
to QLab
Hi !
I my case it's not really accurate, as the reverb tails are detected as zero but sound is still there...
I trier to set the threshold at 0, and the "repeat until theLevel < theThreshold" with an "=" to have really the minimum but it's not working anymore...

So I trier to achieve this with the revamp slice method, and I felt on another problem : the devamp cue have a « stop target when it reaches the end of the current slice » (that's what I want) and it’s only available when the « start next cue when the target reaches the end of the current slice » is activated. So I put a dummy memo cue below, so the stop is good, the memo (or whatever) cue is played BUT the playhead stays on the memo cue… I tried with a fade cue, I can see it running an playhead just stays on it ! 
do you have any idea ? Thanks !

Roly Botha

unread,
Mar 16, 2022, 11:05:54 AM3/16/22
to ql...@googlegroups.com
Re: slices and devamping. 

I tend to put the devamp with “stop cue at end of current slice” and “start next cue” in a “Start first child and go to next cue” group along with a dummy memo cue.

That way your play head will advance to your next GO point and the devamp should function as planned.

If you don’t like dummies, you could replace the memo with a “Go To” cue targeting your next GO point (though I tend to find that a bit overboard with the hassle of reprogramming). 

Hope that helps!

All my best,
Roly (they/them)

--
Roly Botha

Actor and Composer


As a freelancer, I will sometimes send emails at unusual times. I never expect anyone to respond outside their own normal working hours.

On 16 Mar 2022, at 14:38, olivie...@gmail.com <olivie...@gmail.com> wrote:

Hi !
Message has been deleted

jimsta...@zoho.com

unread,
Mar 16, 2022, 1:44:33 PM3/16/22
to QLab
Haha! This could work nicely for automatic band wind ups at sound check.
Start a cue at the next silence, choosing random jokes or insults.
An audible version of old SSL studio desks (was it the 4000 or 5000) that insulted the engineer for making mistakes.
Fun!
Jim
On Wednesday, March 16, 2022 at 9:22:59 AM UTC-7 micpool wrote:
On Wednesday, March 16, 2022 at 2:38:20 PM UTC olivie...@gmail.com wrote:
Hi !
I my case it's not really accurate, as the reverb tails are detected as zero but sound is still there...
I trier to set the threshold at 0, and the "repeat until theLevel < theThreshold" with an "=" to have really the minimum but it's not working anymore...

That may be because you have a lot of gain after QLab, and therefore are running the QLab audio levels low which is restricting resolution.

This version of the script may work better for you.
The threshold is fixed at 1
The gain adjusts the maximum value of the scale measuring the sound and is read from the cue name of cue "SC"  and is logarithmic

Put  an integer value for the gain  as  the q name of cue "SC" between 1 for very loud sounds to 9 for very quiet sounds.
Change the script source of cue "SC" to this:


tell application id "com.figure53.QLab.4" to tell front workspace
        try
                set theGain to (10 ^ (q list name of cue "SC")) as integer
                if theGain < 1 then set theGain to 1
                if theGain > 9 then set theGain to 9
                set theTargetCue to last item of (cues whose running is true and q type is "audio" as list)
                set theMessage to "/cue/LEV/name" & space & quote & "#/cue/" & (the q number of theTargetCue) & "/liveAverageLevel/1 0 " & theGain & "#" & quote
                set the custom message of cue "AN" to theMessage
                set theLevel to 10000
                start cue "SOS"
                repeat until theLevel < 1
                        set theLevel to q list name of cue "LEV"
                        delay 0.05
                end repeat
                stop theTargetCue
                stop cue "SOS"
        end try
end tell


olivie...@gmail.com

unread,
Mar 17, 2022, 4:57:40 AM3/17/22
to QLab
Sorry, but this is not the source of the problem, my wav file has decent level peaks, gain is generally near zero on the cue (sometimes -3).
The new script is not much accurate.
Perhaps there is something I do wrong, but I tried just replacing the wav source on your workspace and still... Cut happening too early, with still some reverb tail running and audible. (headphones on my macbook)

 

Le mercredi 16 mars 2022 à 17:22:59 UTC+1, micpool a écrit :
On Wednesday, March 16, 2022 at 2:38:20 PM UTC olivie...@gmail.com wrote:
Hi !
I my case it's not really accurate, as the reverb tails are detected as zero but sound is still there...
I trier to set the threshold at 0, and the "repeat until theLevel < theThreshold" with an "=" to have really the minimum but it's not working anymore...

4Japan Style.m4a

olivie...@gmail.com

unread,
Mar 17, 2022, 8:13:23 AM3/17/22
to QLab
Thank you for the idea ! this works well for me...

micpool

unread,
Mar 17, 2022, 11:30:29 AM3/17/22
to QLab
On Thursday, March 17, 2022 at 8:57:40 AM UTC olivie...@gmail.com wrote:
Sorry, but this is not the source of the problem, my wav file has decent level peaks, gain is generally near zero on the cue (sometimes -3).
The new script is not much accurate.

Hi
Thanks for sending me the audio you were using.
The peak level is of little interest as the audio is looking at the end of the tail to see where to stop the audio. Your Koto recording has a strong attack but dies away to a very low level very quickly. In the context of silence detection this makes it similar to a quiet cue.

However, the previous script I posted was an earlier version to the one I was using and had a major error which means it was worse than the original one.  I have now revised the script and workspace. It was very useful to have your recording and I have now made a v2 workspace with the following improvements:

A threshold can be set as a float between 0.0 and 8.0 in the post wait of the script cue. Because the liveAverageLevel value  scale is linear, the script converts this range 1-8  to a threshold between 1 and 100000000, logarithmically. It's also worth noting that the metering level is affected by the min volume limits  in settings/audio. I am using -60dB. Anything less than -70dB means that the meter will not fall back to 0 in shorter  gaps. If you use the OSC /cue/SC/postWait {number between 0-8} you can set the threshold on a per cue basis as in the demo.

I have speeded up the operation by removing all number to text conversions. The meter value is now stored in the x translation of a dummy  text cue, and the threshold as mentioned previously is now in a post wait.

The audio cues no longer need to be numbered as they are recognised in the script and OSC by their IDs

This now works well for your recording with a threshold of 0. The slice method is always going to be better, as there are likely to be tricky edge cases with any silence detection method, but I think this is now working well as a proof of concept and may be useful for some uses.

Here's a screenshot of the new workspace running

Stpo on Silence V3 Screenshot.png


And here is the new script:

tell application id "com.figure53.QLab.4" to tell front workspace

try

set theThreshold to (post wait of cue "THRESH")

if theThreshold < 0 then set theThreshold to 0

if theThreshold > 8 then set theThreshold to 8

set theThreshold to 10 ^ theThreshold as integer

set the q name of cue "LEV" to theThreshold as text

set theTargetCue to the last item of (cues whose running is true and q type is "audio" as list)

set theMessage to "/cue/LEV/translationX  #/cue_id/" & (uniqueID of theTargetCue) & "/liveAverageLevel/1 0 100000000#"

set the custom message of cue "AN" to theMessage

set theLevel to 100000000 as integer

start cue "SOS"

repeat until theLevel < theThreshold

set theLevel to translation x of cue "LEV"

end repeat

stop theTargetCue

stop cue "SOS"

end try

end tell


Attached is a screen recording of your cue in action, and a workspace bundle with your audio removed. (I'll send you a workspace with your cue programmed off list)

Best Mic


stop on silence hires.mov
Stop on silencev2 no Japan.zip
Reply all
Reply to author
Forward
0 new messages