Please add OSC support

Like the title says. Please add OSC support to KM, particularly sending, although receiving would also be nice.

There are a ton of apps and devices in the creative industries that now use OSC to control them, and often many in depth controls are possible by sending OSC to them.

At the moment the best work around I've found is to do a shell script from an AppleScript action:

set myOSC to "/{your OSC message goes here}"
set IPaddress to "{your IP & port goes here- eg 53535}"
do shell script "echo " & myOSC & "| nc -u -w 0 " & IPaddress

But this method only works for some applications. Those that recognise plain text sent over UDP so long as it is formatted like an OSC message. It is not a true OSC message. So to have a native action would be so much better, and would integrate with a massive (and growing) list of software and even more interestingly, external hardware.


1 Like

As far as I am aware, OSC is simply a format built on top of MIDI, and Keyboard Maestro can trigger on any MIDI sequence with the MIDI trigger and can send any MIDI sequence with the Send MIDI Packet action.

So OSC is fully supported as such. There is just not specific OSC support, which I probably cannot do because OSC is a very encompassing format which is different for each device.

Keyboard Maestro sends MIDI packets to the system which deals with routing to the specified devices.

OSC is not related to MIDI in any way, it is not simply MIDI over network at all, they bear no relation to one another other than the initial idea behind OSC was also for controlling synthesizers and music things. But its use has ballooned far beyond that.

OSC is a network data transfer specification for sending data packets with an address structure similar to a web address, making it very simple to configure and understand.

So as an example, Qlab is a software I use a lot. To tell Qlab to fire a particular cue you might use an OSC message such as:
/workspace/Hamlet/cue/16/go - this will fire cue number 16 in the workspace for Hamlet (if you had more than one workspace open), and also advance the playhead.

It supports wildcards in the address string, so I could send /cue/preshow*/active 0. this would deactivate any cue with "preshow" as a prefix in its cue number.

It also supports copying details from other cues places, in the case of Qlab I can send a message that uses the details from another cue, so /cue/16/levels/#cue/9 0 0#/ 0 0

This will copy the fader level for the master fader from cue 9 into cue 16.

These are specific examples for one piece of software, but as you can see it is nothing like MIDI at all. It can operate over UDP (often more common) and TCP, which allows for data feedback. Often feedback from requests is formatted as json strings meaning it is relatively straight forward to parse. And it also supports sending bundled packets of messages, so if there are many messages that are time sensitive so they all need to trigger at once then they can be sent as a bundle instead of a string of separate messages. Whereas MIDI is a strictly serial protocol, and extremely slow, low resolution, has very limited number of things it can control (16 channels) OSC has none of this limitations. With it's flexible address structure that can be defined on the fly it can access hundreds of thousands of potential parameters at once, and update the list as it goes.

Now I don't think that KM would need to support all those features, but to be able to send UDP OSC data messages that could be constructed using variables etc at the very minimum would be a great feature.

It may have been proposed as an alternative to MIDI, but that is where the connection between them ends.
Here is some further info on the protocol:

You say you can't support OSC because it's an encompassing format that is different for each device. But you don't need to support each device, you allow us to construct the message we need to send. I would just like a module that will send an OSC address. So I can enter an IP address (possibly from variable), a port number (possibly from variable), and then there is an empty box where I can write the message I need to send, with the ability to make use of variables in it.

That's the beauty of it, it can be completely generic and still control every OSC capable software and device out there, you don't need to do any work to support them, it's on the user to just write out the correct address

Then I can type in the box myself
/press/bank/1/5 1
and send it to the appropriate IP & port to press a button in Companion, without you needing to create a Companion module within your OSC support.

You have a Stream deck module, but stream deck itself is a bit rubbish, whereas Companion is fantastic, but we can't access it from KM because it doesn't allow us to send OSC.

Then if you also integrate OSC receiving we could send from Companion (for example)
to trigger my Logic Config macro in my Work Spaces group

Please reconsider

I'm not familiar with companion, but you could send OSC messages with something like GitHub - yoggy/sendosc: sendosc is a simple command-line tool for sending OSC packet. directly in keyboard maestro using the Execute a Shell Script action.

1 Like

OK, I must have been remembering something else.

In that case, no, there are no current plans to support OSC but I can look in to it in the future.

It is problematic since I don't have any devices to test it with tho, which makes it very hard to write code for it.

But I will note down on the wishlist to look in to it further.

Well Companion is a free software you can use for testing OSC reception. Qlab is available as a free version, but the unlicensed version will respond to OSC. Logic Pro of you have that responds to OSC. Reaper can respond to OSC and is also free to use for testing purposes. Open Stage Control is another free application for working with OSC, it will both send and receive.

There are many many options for testing it without needing specific equipment or buying specific software.

Thanks for putting it on the Wishlist!

Thanks for this, I'll look into it. Always preferable to have it integrated though as otherwise I have to make sure that all the extra things are installed on the different systems I work with, whereas KM just syncs across devices without effort.

But thanks for the tip

Yeah I totally get it. Keep in mind Keyboard maestro is just Peter developing, so I'd think the likelihood of seeing native OSC support is pretty slim, but not impossible.

I would also love native OSC trigger support. Sending OSC messages works fine with sendosc command line tool. I am making my own OSC to KM app that uses the KM cli to trigger macros. It works as a prove of concept. I wil try to clean it up and put it on github. I wil post a update when it's done.

1 Like

First release for my KMOSC app can be downloaded. Let me know if it's clear how to use it. Maybe i wil make a short youtube video how to use it.

Hey Gareth, thanks for developing this, very exciting prospect. I downloaded the apple silicon version, but just get a message that the app is damaged and do I want move it to the trash when I try to open it. MacBookPro M1, Ventura

If you cancel that popup and then go in to your System Settings -> Privacy & Security. There should be a option now to open the app anyway. I do not have Apple developer account so i can not Sigh my app.

Yeah, I'm not getting that option in privacy and security. I'm fairly used to running un signed apps, I usually get a message saying it can't run because it's not from a recognised developer, and then the option appears in Private & Security. But I've never had this message saying the app is damaged before, it's a different notification.

I see i get the same thing when i download it and try to run it. But if i do it from the source dmg that i uploaded to my site it works. I will have to look in to that why it does that.

You can run this in your terminal as a workaround while i wil try to find a permanent solution.

sudo xattr -d /Applications/

I created a separate topic so to keep this post about the feature request. So any questions for KMOSC app can go to KMOSC Using keyboard maestro with OSC