Sending 'GO" from an Apple Watch Ultra Action Button

144 views
Skip to first unread message

Ben Jackson

unread,
Jun 30, 2024, 5:53:29 PM6/30/24
to QLab

I have not been able to find any solution to this from anyone. Apple Watch doesn't allow "Apple Scripts" to be run, but it does allow SSH and shell scripts to run. So I figured there must be a way to send OSC messages over SSH, but no solution was apparent. Here's a way to do it.

First install brew, python3, pip etc and all that. I'm doing all this on macOS, so also turn on 'remote login' in sharing.

install python-osc:

python3 -m pip install python-osc

make a file called send_osc.py, i used bbedit

paste in this:

from pythonosc import udp_client

# Define the IP address and port of the QLab machine

ip = "ENTER_IP_OF_MAC_WITH_QLAB"

port = 53000

# Create the UDP client

client = udp_client.SimpleUDPClient(ip, port)

# Send the "/go" OSC message, will just send go on whatever workspace is front but you can set whatever OSC message you want here

client.send_message("/go", None)

Then make a shell script file, call it 'send_qlab_go.sh'

put this in the script:

#!/bin/bash

# Use the full path to Python

/opt/homebrew/bin/python3 /yourlocation/send_osc.py

Then make a shortcut in Apple Shortcuts. Select the 'run script over ssh'

Put the command as /yourlocation/send_qlab_go.sh changing yourlocation to the location of the script on your mac

put in the other details, IP, username password.

Then save the shortcut, and then add the shortcut as the 'action button' shortcut in watch settings app.

Activating the shortcut on the mac is instant, via the apple watch there's about 1 second delay. But it works.

So not useful for cues that need exact to the millisecond timing, but for my purposes (and to save the $1200 cost of AUDIO APE) it's fine.

Hope it's useful to someone else.

Rich Walsh

unread,
Jul 1, 2024, 7:48:12 AM7/1/24
to ql...@googlegroups.com
Three things that I would have thought would be easier, so did you confirm these don’t work?

  1. Use osascript as your shell command, eg: osascript -e "tell application id \"com.figure53.QLab.5\" to tell front workspace to go”. You might have to include “of machine "eppc://username:passsword@IPaddress"” and send this as a remote Apple event…
  2. Use netcat to send an OSC-like message: echo /go | nc -u -w 0 127.0.0.1 53535 (with the right IP address).
  3. Use MIDI instead, eg: https://uwyn.com/midiwrist/ – which appears to be a MIDI controller app for watchOS?

I also found three ways of apparently sending OSC without having to install Python:


Could any of those have been directly via the Shortcut?

Rich

--
Contact support anytime: sup...@figure53.com
Follow QLab on Threads: https://threads.net/@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/ef12a0be-9737-4945-9c0a-1035a2f55221n%40googlegroups.com.

Ben Jackson

unread,
Jul 2, 2024, 6:31:05 AM7/2/24
to QLab
Oh I love this even more. No python. First one didn't work, the netcat one did though! Basically i got to the python solution as I was nutting out the issue with chatGPT and it suggested i try python script, but yes being able to directly do it without installing is much better, and it doesn't need to have any actual script files on a mac. So i just put the command in the 'run script over ssh' in shortcuts, and then put in the IP of my Qlab machine with a username and password and voila! Much slicker. I'm so glad I posted!! Thanks Rich!
Message has been deleted

Rich Walsh

unread,
Jul 6, 2024, 7:55:02 AM7/6/24
to ql...@googlegroups.com
Maybe the smart quotes screwed up the osascript version? I tested both of these from my iPhone, and they both felt OK – but not as fast as QLab Remote. A sluggish GO, but not anywhere near 1s or above. I couldn’t think of a way of actually timing the latency… I did notice that there was a sense of it going to sleep, ie: the first GO for a while felt slower to react than subsequent GOs.

(I used the shared key authentication described here as I didn’t feel like storing a root password in Shortcuts; I don’t know if it’s faster than a password?)

I would try an app that sends MIDI directly from the Apple Watch if possible: that should be very fast.

As we keep seeing on this forum, chatGPT is essentially doing the equivalent of Amazon’s “people who used this word also used this word” to churn out its harvest of what humans have already created and so is frankly useless if you are asking a question about QLab that a human hasn’t already answered. If there’s no solution on the Internet for it to copy, it’s not “intelligent” enough to create an answer – why reach for Python when you can control QLab directly by UDP strings on port 53535? You’d have to _understand_ the manual to know that, not just build a statistical model of sentence structure relating to pre-existing human output on using QLab.

Rich

On 2 Jul 2024, at 11:37, Ben Jackson <benjac...@gmail.com> wrote:

Only issue with netcat is it's about 3 times as long delay

On Tuesday 2 July 2024 at 20:31:05 UTC+10 Ben Jackson wrote:
Oh I love this even more. No python. First one didn't work, the netcat one did though! Basically i got to the python solution as I was nutting out the issue with chatGPT and it suggested i try python script, but yes being able to directly do it without installing is much better, and it doesn't need to have any actual script files on a mac. So i just put the command in the 'run script over ssh' in shortcuts, and then put in the IP of my Qlab machine with a username and password and voila! Much slicker. I'm so glad I posted!! Thanks Rich!

On Monday 1 July 2024 at 21:48:12 UTC+10 Rich Walsh wrote:
Three things that I would have thought would be easier, so did you confirm these don’t work?

  1. Use osascript as your shell command, eg: osascript -e "tell application id \"com.figure53.QLab.5\" to tell front workspace to go”. You might have to include “of machine "eppc://username:passsword@IPaddress"” and send this as a remote Apple event…
  2. Use netcat to send an OSC-like message: echo /go | nc -u -w 0 127.0.0.1 53535 (with the right IP address).
  3. Use MIDI instead, eg: https://uwyn.com/midiwrist/ – which appears to be a MIDI controller app for watchOS?

I also found three ways of apparently sending OSC without having to install Python:


Could any of those have been [triggered] directly via the Shortcut?

Rich


osascript.pngnetcat.png

Ben Jackson

unread,
Jul 8, 2024, 5:18:45 AM7/8/24
to QLab
Oh from my iPhone it's almost instant. Apple Watch has always been super slow - that goes for any shortcut. I'm using Tailscale and it's quite fast that way. 

I'll try that fix for the oascript.

As for chatGPT - yes, I think if you use it knowing it's limitations it can be helpful - after all, if nobody else has 'put it on the web' then i'm not going to find it anyway. So when you think about it, I wasn't going to be able to (as a non coder) figure out how to do this without help. Given nobody had put it on the web, at least I got *some* solution from chatGPT that is workable and just as fast as the non-python method. In the end, I couldn't even find a human who had suggested the python method - so it least it got me going. And then posting it here got you thinking, which means I got to a great solution. Without chatGPT, I would have given up. I've found that if I ask a question on a forum nobody ever answers or I get attacked. So I'm often left on my own, whereas chatGPT always at least responds to me hahah! That's sounds sadder than it is lol

But yes. I've been using chatGPT for all sorts of things that definitely do give results beyond just 'this word goes next' but only because it's able to collate SO much data and mix it all up, so it seems more intelligent than it really is, even though the results aren't quite just what another human has already written or coded. I've been using it to help me with my scripts (theatre scripts, not coding scripts), to be creative, and as long as I prompt it in a way that's very clear, I can get a lot of good results out of it. But I agree that it's not really 'intelligent', which is why I also think this 'AI is coming to kill us' fear is way overblown. This 'AI' is not intelligent in any way. It really is just fancy auto-complete. That's not intelligent, it's just sorting huge amounts of data from HUMAN intelligence/output/creativity. I wish people would stop referring to it as AI as it's just not (just marketing fluff). It doesn't do any actual thinking or have any feelings or have any actual 'thoughts'. It's really, to me, no different than ANY computer program that could 'seem' intelligent, it just spits out the next most probable word, sentence, pixel - whatever you ask of it. Just like you said.

Thanks again Rich! My staff our loving being able to activate Qlab from their watches and phones!

Reply all
Reply to author
Forward
0 new messages