Totally going to give credit to you two when I post this patch after it's finished!
-
On-air light, trouble receiving int via OSC
-
@jbaker said:
pd is printing like it should!
... wha...? I don't see what's different but... glad it's working!
Now... I guess.. How can I get the 0 or 1 value into the patch?
Pretty much like this -- the [pd ch1] etc. boxes just do
[inlet]
|
[route mix]
|
[route on]
|
[outlet]Think of the OSC address space like a tree. 'ch' says it's a channel-related message. That branch of the tree splits off into a branch for each channel. Then each channel has properties or commands, of which one is 'mix' and below that, 'on' is one of many properties. [route] "peels off" each descriptor one by one and you can build the responses literally as a tree.

hjh
PS I didn't use MrPeach in this example bc I'm too lazy to install it.
-
@jbaker Looks as though you are using MrPeach [unpackOSC] so you can strip the paths (message headers) with [routeOSC]
So a [routeOSC /ch/01/mix/on <space> /ch/02/mix/on... etc.]
for 0/1 for each path.It's a shame that the MrPeach objects from 2013 are still easier/better? than newer vanilla objects for OSC messaging.
They deal with string/float/symbol types without a user needing to know the formatting of the original.
David. -
@ddw_music said:
Think of the OSC address space like a tree. 'ch' says it's a channel-related message. That branch of the tree splits off into a branch for each channel. Then each channel has properties or commands, of which one is 'mix' and below that, 'on' is one of many properties. [route] "peels off" each descriptor one by one and you can build the responses literally as a tree.
Word!
Looks as though you are using MrPeach [unpackOSC] so you can strip the paths (message headers) with [routeOSC]
So a [routeOSC /ch/01/mix/on <space> /ch/02/mix/on... etc.]
for 0/1 for each path.And word!
Okay- Thank you both! Will report back with results today... Pd is awesome. -
Okay! I thought I was done... So I cleaned up the patch.
Since then, I realize my OSC commands to the lighting board aren't working
I opened up the version of the patch from 2023 that worked, and I realized that I was using the [sendOSC] object.
So mr peach I think? For some reason I can't get the sendOSC object to work on the pi... But I think I have other parts of Mrpeach external working like packOSC. The old version of the patch ran on windows, which isn't as hard (for me) to get the mr peach patch working.Here's the current version of the patch-
on-air-light-kmtr-v5-OSC.pd

I was SO ready to set it all up but I might have to come back to this tomorrow.
I figure it's still possible to use [netsend -u -b] since we did it with the X32...
But yeah, it's not working from what I tried.It's a colorsource AV 20 board.. There's an IP, then an OSC IP, a receive port, and a send port. The netmask is 255.255.0.0 which is weird.. But I don't want to change it because we use a streamdeck to send OSC commands to the board and they work. I did change it for a minute and didn't see anything different.
-
@jbaker said:
Okay! I thought I was done... So I cleaned up the patch.
Since then, I realize my OSC commands to the lighting board aren't working
There's no oscformat or packOSC before the lower netsend here, so, in that version of the patch, you aren't sending OSC-formatted messages to the lighting board. If the lighting board expects OSC, it won't respond to plain streams of ascii bytes.
hjh
-
@ddw_music Fair enough! I guess that makes sense because sendOSC (mrpeach library I think) doesn't need that. I appreciate all the specifics about the syntax specifics for OSC that's needed when dealing with these more, 'standard' objects in pd. @whale-av maybe mrpeach can come out of retirement? I did find the git page where some externals are but yeah I couldn't get them to work without pd-extended which doesn't seem to be supported on 32bit bullseye armhf. Or- just as likely- I made a mistake while trying to install it.
I'm going to approach this tomorrow hopefully a little more fresh.. I feel like there is enough information in this thread to solve the problem. Here's what I made really quick, will experiment and modify it tomorrow. I realized your patch i was referencing (@ddw_music) was for simulating the X32 (to test getting responses back). But- there's some overlapping elements. I wasn't sure if the [oscformat -f i] was right... I think the -f initiates the "formatting", and then the i is for integer in the message being fed in the objects inlet? Which.. for the message [set /cs/chan/select/47(, might make sense, because there's the 47? I'll try it when I'm in front of the light tomorrow.
Not sure if I need the 'list' or 'route' objects because I'm just trying to send..anyway, going to leave before I ramble too much more than I already have. Thanks -
I'd like to make a suggestion: Pick one set of objects to handle OSC, and just use those. It's in the nature of a tech forum for different people to have different opinions and offer multiple suggestions, but mixing and matching many different approaches can also lead to confusion.
So, for example, your screenshot -- at the top left, you have [packOSCstream] (why this and not [packOSC]? ** ) and then below, [oscformat]. That's a source of confusion. These two objects have quite different ways of handling OSC addresses (or what I've been calling "command paths") -- two idioms. Nah, this is a good way to introduce mistakes. So, pick one that you're more comfortable with.
** Ah, I see, [packOSC} help says "[packOSCstream] is a way to send OSC over TCP or serial connections" -- but you're using UDP, so, not relevant. Again, simplify: [packOSC] or [oscformat], pick one and stick with it.
Also -- you've got elements of this patch where it's already been explained why they are incorrect. If you connect a "send..." message box directly to a [netsend -u -b], it will not send an OSC-formatted message. Since you are sending to devices that expect OSC-formatted messages, for OSC it is always incorrect to pass a "send..." message directly to [netsend]. Never do this. But, in the top left part of your patch, I count 3 "send" message boxes that are patched directly to [netsend]. Delete those patch cables.
(Similarly, at the bottom of your patch, the line of objects coming directly down from [list trim] --> [route ch] --> [route 1 2 3 4] -- this is a part of my example patch that I had labeled with a comment saying "this will not work." Copying and pasting the non-working part is again going to be a source of confusion.)
~~
An OSC message has two parts.
- An address (for command) with slashes, e.g. /cs/chan/at/0.
- A list of arguments.
- The argument list always has datatype tags, even if you don't specify them.
- If you didn't write type tags, it will guess. In Pd, all numbers are floating-point, so outgoing OSC will format numbers as floating-point by default.
- The X32 documentation says that it expects an integer 1 or 0. So, in [oscformat], you can force a number in a specific position to be integer-formatted by giving "i" as the type tag.
So...
Which.. for the message [set /cs/chan/select/47(, might make sense, because there's the 47?
No, it's not the 47. The 47 is part of the command path. How do you know it's part of the command path? Because it's connected with slashes in the device docs. The command path is totally excluded from the type tags -- it's always a string.
It gets a bit confusing with [oscformat] because the vanilla OSC objects write both the OSC address and the arguments as lists (no slashes).
- [packOSC] way: [send /cs/chan/select/47(
- [oscformat] way: [set cs chan select 47, bang(
OK, let's look at those.

packOSC: 47 99 115 47 99 104 97 110 47 115 101 108 101 99 116 47 52 55 0 0 44 0 0 0 oscformat: 47 99 115 47 99 104 97 110 47 115 101 108 101 99 116 47 52 55 0 0 44 0 0 0Notice that these are byte-for-byte identical. So these are just two different ways of expressing the same idea. (I do see in your screenshot where you're mixing and matching syntax, trying to use [oscformat] syntax with [packOSC] -- nope, this is not going to work. They have different programming interfaces.)
I suggest to slow down and do some smaller scale tests to make sure you can get the right result from the lighting board. Integration should come later.
hjh
-
@jbaker Just a little more info that might help, although you might already have everything that you need.
Anything in the string /x/y/z/etc is part of the osc header.... the address.
The data that follows..... that is then sent to that address.... /x/y/z <space> data ..... is the part that needs to be specified as i, f, s, bThe address string should always be comprised of symbols (even though parts may "seem" to be integers or floats) and problems can arise using vanilla [oscparse] when they are not..... so [fudiparse] and [fudiformat] can solve that problem as demonstrated here...... vanilla_bug_oscparse_solution.pd
Unfortunately quite a few devices send malformed osc headers.
MrPeach objects don't care.
David. -
@ddw_music Yes- that was needed. I was getting very sloppy and just trying things because I was tired. I agree- at the least I should just stick to 1 set of objects. I appreciate the explaining of address space and command space. Honestly that screenshot comparisons of the 2 message's bytes is now in my onenote haha. And I appreciate the clarification about data type specifications (i, f, s, b ) applying to the data-half of OSC messages. Okay! Going to slow down, move sequentially, and yeah. Thanks. Will post back here with results per usual.
-
Success!

Here's the patch...
on-air-light-kmtr-v6-OSC.pd
Thank you both! I waited a long time to ask for help and.. All I can say is that I wish I did it much earlier!
Funny how people tend to wait..I think I'm going to deploy it today and see how it goes. Hoping for as low-maintenance as possible.

Obviously- feedback/suggestions are welcome.I guess... Where would a good place to put a pd patch for people to use? I know there's this site... I see github pages a lot.
-
@jbaker Just leaving it here it will be found, but if you can give it a good title and description (which will help people to find it when they are trying to accomplish something similar) you could post it under the "patch" section that you will see on the home page for this forum.
Well done....!
David. -
Thanks!
it means a lot. To both @ddw_music and @whale-av ! In the past, while digging around the internet for info on puredata, I've come across posts from both of you that ended up being the best information I could find, so yeah, I've been pretty stoked for help from both of you. It's working! I'll setup another patch for another studio here.. It has a different lighting board, but I feel fine about setting up OSC for that. I'll write back with a report on the patch's resilience after some time has passed. -
@jbaker said:
Success!

A-ha! Fantastic

I had a feeling you were just that close -- happy that you got it working.
hjh
-
Hi! Just wanted to follow up-
The patch you two (@whale-av & @ddw_music) helped me with is still working as designed!
I just deployed the second pi with the slightly modified patch for the second studio-
For those who could use it, here's the program with OSC commands EOS Element 2 lighting board, and X32 audio board by Behringer.

-
This post is deleted!