Potscrubber wrote:Hi MC
Some wishful thinking but here goes. Is there any chance to also transmit the (0 based) channel number as a value not just in the address?
For example:
/output/28/name ADI 7/8 (string)
becomes:
/output/28/num 28 (integer)
/output/28/name ADI 7/8 (string)
Use case: when an OSC receiver is listening with OSC wildcards, and a handler function can only receive the value and data type, not the address that triggered the (wildcard) listener.
wildcards are supported by the OSC 1.0 standard...
I think, its not something TotalMix itself needs to change for. You can get this today with a some lines in shell using some code and libs which are solid an lightweight (like liblo f. ex)
Well, as I personally play a lot with OSC, too, I made osctool (open source OSC test/relay tool) for my own testing and dev stuff. Which grew a little over time..
Just cleaned my repo up and pushed it to github (in case it might be useful for you - feel free - prebuilt static linked bins are also there).
https://github.com/huddx01/osctools
So, a small pipeline using osctool and jq does what you need... It listens for TotalMix's OSC output, and for every /input/N/name or /output/N/name it sees, it forwards that message unchanged and additionally sends a companion /input/N/num (or /output/N/num, same for playback) message with the channel index as an integer.
So your wildcard handler might be happy as it gets the number as a value, not just embedded in the address...
osctool -l 9001 -m -j -q --no-discover --no-rc | \
jq --unbuffered -r '
select(.path | test("^/(input|output|playback)/[0-9]+/name$")) |
(.path | capture("^/(?<kind>input|output)/(?<n>[0-9]+)/name$")) as $c |
"send \(.path) s \(.args[0] | @json)",
"send /\($c.kind)/\($c.n)/num i \($c.n)"
' | \
osctool -l none -t <your-receiver-ip>:<port> --no-rc --no-discover -f -
Copy/paste the above into terminal and adjust -l 9001 to whatever port TotalMix's OSC output is set to and -t to wherever your actual OSC-consumig app listens. Requires jq 1.7+ (for --unbuffered. without it, output gets stuck in a buffer and never arrives).
Just made a quick live test against TotalMix. Renaming a channel produces exactly this on stdout:
/output/3/name s "an 4"
/output/3/num i 3
Alternatively, if your OSC library gives you the matched address in the wildcard callback (most do), parsing the channel number out of the path directly in your handler avoids needing this pipeline at all. This would be a more elegant solution for this...
“Do It For Her”
My Gear: Bontempi Magic light Keyboard