ideoforms / AbletonOSC

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

Clip position #2

Closed RickDDD closed 2 years ago

RickDDD commented 3 years ago

Hello! Thanks a lot for porting the former LiveOSC to Ableton Live 11! I know it's work in progress, so don't expect everything to be in place. I would like to ask for one listener though that I would consider essential. From what I understand it should be /live/clip/position (int track) (int clip) (float position) (float length) (float loop_start) (float loop_end) to see how far a playing clip has progressed in its total length or loop.

Oh, and of course related to this: Is there a listener or a query for the play state of clips?

Joern

Coupe70 commented 2 years ago

@ideoforms I see great progress in AbletonOSC at the moment, so I dare to ask for the above again. Actually I don't remember where I got the above path from. I just googled again and what I found for Live 11 API is:

Live.Clip.Clip.playing_position (Property) Constant access to the current playing position of the clip.The returned value is the position in beats for midi and warped audio clips, or in seconds for unwarped audio clips. Stopped clips will return 0.

add_playing_position_listener() (Method) add_playing_position_listener( (Clip)arg1, (object)arg2) → None Add a listener function or method, which will be called as soon as the property “playing_position” has changed.

Would be great to display the progress of a playing clip in TouchOSC. Without it you always have to refer to the Live screen to have orientation.

ideoforms commented 2 years ago

@Coupe70 Yes! I am just working through issues, and this is next on my list (should probably have started with oldest first, with hindsight...)

Please hold, hoping to have this done this weekend.

Coupe70 commented 2 years ago

@ideoforms Fantastic! Thanks for the quick reply.

ideoforms commented 2 years ago

@Coupe70 @RickDDD OK, I've now added initial support for listening for a playing clip's position:

/live/clip/start_listen/playing_position
/live/clip/stop_listen/playing_position

Replies will be sent to /live/clip/get/playing_position, with args: track_id, clip_id, playing_position

Let me know how you get on! If it works for you, I'll close this issue.

One thing that I am pondering is that it will be awkward to add handlers like this for every clip, as you will need to repeatedly add listeners for every new clip you create. So one option would be to have an endpoint that adds a handler for all clips, which I guess is going to be the primary use case. What do you think?

Coupe70 commented 2 years ago

Great, thank you so much!! I have some thoughts - and questions - on the "one handler for all clips" matter, but let me first test what you added, it might bring up some new ideas how to deal with this.

Coupe70 commented 2 years ago

@ideoforms I'm stuck. Earlier than expected... I can't even get AbletonOSC to show up in the dropdown list of Remote Scripts in Live 11.1.1 / Windows 10. I renamed the folder 'AbletonOSC-master' to 'AbletonOSC' as suggested. First I missed that remote scripts now go into a folder in User Library, but putting AbletonOSC there does not help. I've also downloaded the well-known Launchpad95 remote script to doublecheck - Launchpad95 shows up, AbletonOSC doesn't. What am I missing...?

Both script folders where they should be: grafik

Both script folders showing up in Live browser: grafik

AbletonOSC does not show up while Launchpad95 does (not visible in screenshot): grafik

ideoforms commented 2 years ago

Hmm, unfortunately Windows is a bit of a blind spot for me as I do all of my development on macOS and don't currently have access to a Windows machine with Live. Could you do me a favour, and try re-opening Live and then send me the most recent Live .log file so that I can take a look and diagnose why it's not opened?

From this thread, it looks like the Ableton logs on Windows are in a path something like C:\Users\***\AppData\Roaming\Ableton\Live Reports\Usage

Then you are looking for the most recent file named .log, for example, 20221114T225656_84361.log. You should see it has a last modified time in the past couple of minutes. My email address is here.

ideoforms commented 2 years ago

This is now implemented and resolved, thanks @Coupe70 for helping with the debugging!

Notes: