llloret / osmid

osmid is a tool to bridge MIDI and OSC. It is currently in use in Sonic Pi
Other
72 stars 12 forks source link

OSC bundles are not decoded (in Sonic Pi at least) #54

Closed korfuri closed 5 years ago

korfuri commented 5 years ago

Hi, I've opened https://github.com/samaaron/sonic-pi/issues/2085 today and was directed to report the issue here. I don't understand where the boundary of Sonic-Pi and osmid is exactly so apologies if this includes irrelevant info.

Hi, I'm trying to use OSC to receive messages in Sonic Pi. Specifically I'm sending these messages from VCV Rack using the Trowasoft modules in a way described here. I'm facing a small issue that make the experience slightly annoying. I'm not sure whether the issue lies with Sonic Pi, Trowasoft's implementation of OSC, or a mix of both.

I'm running a 3.2.0-dev build from commit ab31ae0 built with the ubuntu-18.04 script on Linux Mint (based on Ubuntu bionic). Receiving remote OSC messages is enabled.

Trowasoft's implementation sends all OSC messages as bundles. I don't know if that's bad, from my reading of the OSC docs it sounds like recipients should understand it just fine. But Sonic Pi shows the received messages as /osc:127.0.0.1:35042/#bundle [] in the cues list, and indeed trying to unpack the values using sync gives me an empty array ([]). From this it seems that Sonic Pi is just treating the bundle as an opaque blob and doesn't unpack the values inside. This means that all I can get is a cue that a bundle was received, without added info, and without a way to distinguish what path(s) the bundle contains.

Example code I'm using:

live_loop :receive do
  use_real_time
  use_osc_logging true
  voltage = sync "/osc:*/#bundle"
  print voltage   ## always prints `[]`
end

I've tried syncing on /osc:*/*, /osc:*/ch/1 (the path I'm sending to from VCV Rack), and variants of that to no avail.

I think ideally the bundle should be expanded (recursively if needed, as the spec says a bundle can contain other bundles) and each OSC message in the bundle should be processed as an incoming message from the same source as the parent bundle.

I'm not sure what version of osmid I'm using exactly, but the binaries under sonic-pi/app/server/native/osmid report version 0.2.0. Happy to provide any other info that could be useful.

korfuri commented 5 years ago

Here's a packet capture of one such bundle. Wireshark's OSC decoder can parse it without any issues so I believe the bundle is well-formatted. Sorry for the download link but I can't figure out a way to attach pcaps on github issues. https://packettotal.com/app/analysis?id=82ea8bf5e82110cde3d832f05976f76e

llloret commented 5 years ago

@korfuri, apologies for the confusion, but this is not going through osmid. I will close the issue.