ideoforms / AbletonOSC

Control Ableton Live 11 via Open Sound Control (OSC)
MIT License
426 stars 70 forks source link

/api/reload messes up listeners #104

Closed Coupe70 closed 10 months ago

Coupe70 commented 10 months ago

Maybe I'm using this wrong, so maybe it's not critical. Maybe what happens is even logical.

I assumed that using /api/reload would be the same as de- and reselecting AbletonOSC as Ableton control surface to reset "everything". But it seems this does not work.

a) /live/clip_slot/start_listen/has_clip, 0, 0 b) returns the expected messages when creating / deleting a clip in slot 0,0 c) /live/clip_slot/stop_listen/has_clip, 0, 0 d) stops to return the messages as expected OK.

a) /live/clip_slot/start_listen/has_clip, 0, 0 b) returns the expected messages when creating / deleting a clip in slot 0,0 c) /live/api/reload d) listener keeps being active, returning the usual messages e) /live/clip_slot/stop_listen/has_clip, 0, 0 f) does not work, messages keep coming - seems like AbletonOSC has forgotten about listener, but it's still there in Live g) /live/clip_slot/start_listen/has_clip, 0, 0 h) messages are returned TWICE i) every /api/reload + /start_listen/has_clip, 0, 0 adds another listener instance resulting in 3, 4, 5, 6 returned messages j) can only be resetted by de- and reselecting AbletonOSC as Ableton control surface

As I said, probably kind of logical when you only reset AbletonOSC itself, but not reset the "script-connection" in Live. But maybe something can be done to make Live reset the script or make AbletonOSC kill all listeners on /reload...?

ideoforms commented 10 months ago

Oh yes, just taken a look and I can see this happening in the logs. The handlers and listeners are supposed to be killed on /live/api/reload, but I found and hopefully fixed a bug that caused this not to happen properly. Can you test now?

Coupe70 commented 10 months ago

No, that does not work, still behaves as described. I can only use /stop_listen/has_clip to remove ONE of the has_clip-listeners (e.g. from 4 to 3), propbably the last one added, the others are stuck.

ideoforms commented 10 months ago

Try now?

Coupe70 commented 10 months ago

First /reload gives STRING(Error handling OSC message: Python argument types in Clip.remove_name_listener(Clip, function) did not match C++ signature: remove_name_listener(class TPyHandle, class boost::python::api::object)) After that /start_listen/name and /reload return Unknown OSC address

ideoforms commented 10 months ago

Ah yes, this still wasn't working as expected in the following case:

I've now fixed that case too... let me know..!

Coupe70 commented 10 months ago

grafik