variables in an osc statement

171 views
Skip to first unread message

Craig K

unread,
Jun 12, 2025, 3:36:44 PM6/12/25
to QLab
I would like to ask the user for a number (specifically a channel number) and then use that number in a series of OSC commands.

something like :

where the normal OSC command is

/channel/1/mute T

it would be something like this
variable
   c=channel number

/channel/c/mute F

Any thoughts?

Thanks 

Craig K

Sam Kusnetz

unread,
Jun 12, 2025, 3:42:04 PM6/12/25
to ql...@googlegroups.com
Do it with a Script cue containing this script:


tell application id "com.figure53.qlab.5" to tell front workspace
display dialog "Enter a number:" default answer "" with title “Mute" buttons {"Cancel", "OK"} default button "OK" cancel button "Cancel"
set theNumber to text returned of result
try
do shell script "echo /cue/selected/mute" & theNumber & “toggle >/dev/udp/localhost/53535"
end try
end tell

Best
Sam

Sam Kusnetz (he/him) | Figure 53



--
Contact support anytime: sup...@figure53.com
User Group Code of Conduct: https://qlab.app/code-of-conduct/
 
Instagram: https://www.instagram.com/Figure53
Bluesky: https://bsky.app/profile/qlab.app
---
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 visit https://groups.google.com/d/msgid/qlab/64e985aa-2304-41b1-8602-5681ff837ea2n%40googlegroups.com.

Craig K

unread,
Jun 12, 2025, 4:08:06 PM6/12/25
to QLab
Thanks Sam, 

I was hoping to have a way not to involve scripts as there are a few dozen cues that this one variable would target. I'm sending out of QLab in to a console to make several changes (approx 50, at different times) to a single channel, but the channel number might be different night to night.


CraigK

Sam Kusnetz

unread,
Jun 12, 2025, 4:12:05 PM6/12/25
to QLab
Understood!
 
I don’t know of any way to ask for user input without using a script.
 
Mic Pool might have an answer that’s wild and bizarre but highly functional!
 
Best
Sam

––
Sam Kusnetz [he/him/his] (what is this?)
Figure 53
https://qlab.app | https://figure53.com

Craig K

unread,
Jun 12, 2025, 4:30:19 PM6/12/25
to QLab
I was hoping for a script to get the number and then insert that number into each of the cues (inside the OSC string.
 A wild and bizarre idea to be sure!
It's not a show critical thing, more a learning exercise/testing things

Thanks

Craig K

Alexander R. Taylor

unread,
Jun 12, 2025, 5:05:21 PM6/12/25
to ql...@googlegroups.com, QLab
I've gotten away with using memo cues as variable placeholders, I have the same ultimate desire as you.  Using your example:

Create a Memo cue with the number "c" and the Notes containing your channel number, 123 for this example.

Your OSC command would then read:
/channel/#/cue/c/notes#/mute T

I usually keep all my config memos in a different cue list called "Settings".  It won't prompt, but does get all your settings to one place so it's easy to change.

Alexander


Sent from my iPhone!

On Jun 12, 2025, at 4:08 PM, Craig K <audio....@gmail.com> wrote:

Thanks Sam, 

Jeremy Lee

unread,
Jun 14, 2025, 11:59:33 AM6/14/25
to QLab
The easiest way to do this is simply to have a second cue list with the commands. One cue per channel. And your main cue list targets those cues. Then change it once in the second cue list when needed and you’re done. 
Message has been deleted

Craig K

unread,
Jun 14, 2025, 3:40:12 PM6/14/25
to QLab
Thanks all for the ideas. As the cue stack addresses over 40 distinct OSC commands per channel to the console, I have come at the situation from a different angle. ( the mute was just an example )


CraigK

Paul

unread,
Jun 17, 2025, 7:55:08 AM6/17/25
to QLab
I would do this with a combination of script and network cues using the variable.
The script would prompt the user for the channel number and set the notes of cue

-- set channel variable in notes of cue

set cueNum to "chref" -- this can be this script cue or another cue


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

set notes of cue cueNum to text returned of (display dialog "Enter channgel number " default answer "6")

end tell


You can the use the channel number "variable" in your various network cues, for example

     /mixer/command/#/cue/chref/notes#/some/param 


Here is a demo script which generates some network cues with arbitrary mixer commands

-- make network cues to control variable channle on mixer - DEMO

set cueNum to "chref" -- the cue to store the "variable" in the Notes

set networkPatchNum to 2


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

-- just testing - make a network cue using the variable set above

set paramValue to "abc1" -- demo value

set baseOSCmessage to "/mixer/channel/" -- demo value

repeat with mixerParam in {"Mute", "unMute", "Pan", "HighPass"}

make type "Network"

set networkCue to last item of (selected as list)

set network patch number of networkCue to networkPatchNum

set parameter values of networkCue to baseOSCmessage & "#/cue/chref/notes#/" & mixerParam & space & paramValue

end repeat

set notes of cue cueNum to text returned of (display dialog "Enter channgel number " default answer "6")

end tell


When you run the Network cues you will get this output (shown in Protokol monitor software) with change of channel shown

Screenshot 2025-06-17 at 12.52.24.png


Reply all
Reply to author
Forward
0 new messages