home/ atoms/ osc-wildcard-dispatch-implementation

AbletonOSC implements OSC wildcard dispatch by converting * to a [^/]+ regex and matching all registered handlers

When an incoming OSC address contains *, AbletonOSC converts the wildcard to [^/]+ using Python’s str.replace, then iterates all registered callback addresses and uses re.match to find matches. For each matching handler, it calls the callback and sends the reply individually. This means wildcard responses arrive as multiple separate OSC messages, one per matched property. ValueError and AttributeError exceptions are silently swallowed during wildcard dispatch (to handle properties that require additional arguments or cannot be listened to), so some properties in a wildcard sweep may simply not return a value rather than causing an error.

Examples

Sending /live/track/get/* 0 fires against all registered /live/track/get/ handlers. Some handlers (like send, which requires a send_id) throw ValueError and are silently skipped.

Assessment

When you send /live/track/get/* 0, why might some track properties not appear in the replies? If /live/track/get/send requires two params (track_id, send_id) but receives only one, what exception is thrown and how does AbletonOSC handle it?

“elif "*" in message.address: regex = message.address.replace("*", "[^/]+") for callback_address, callback in self._callbacks.items(): if re.match(regex, callback_address):”
corpus · abletonosc-osc-control-interface-for-ableton-live-live-objec · chunk 30