ideoforms / AbletonOSC

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

Tolerate floats? #33

Closed ideoforms closed 8 months ago

ideoforms commented 1 year ago

Request from lengwenings: Could AbletonOSC tolerate floats as IDs?

TouchOSC scripting has two ways of sending OSC messages - simple and complex.
Simple would be enough for AbletonOSC, but when using the simple way TouchOSC 
auto-converts all numbers to floats which AbletonOSC does not tolerate.

This means you have to script every OSC message complex:

sendOSC( {'/live/set/clip/name', { {tag = 'i', value = 0 },  {tag = 'i', value = 2 } ,  {tag = 's', value = "test" } } } )

instead of simple:

sendOSC( '/live/set/clip/name', 0, 2, "test" )
ideoforms commented 1 year ago

Done

Coupe70 commented 1 year ago

Change confirmed - floats and simple scripting work now, calling with ints is still functional. Thank you!

Just to avoid confusion if others try to copy the above scripting line: It's NOT /live/set/clip/name like I wrote twice in my request, it's /live/clip/set/name Maybe you can edit this above.

Coupe70 commented 1 year ago

@ideoforms

/live/device/get/parameter/value does not tolerate floats and returns Error handling OSC message: Invalid index type Or does this error indicate something else? When I use the complex OSC command to send integers it works as expected.

Doublechecked with /live/device/get/name and this tolerates floats.

Only obvious difference I can see is that get/name needs 2 arguments and get/parameter/value needs 3.

zbynekdrlik commented 1 year ago

Same issue here with "invalid index type" for /live/device/get/parameter/value

Coupe70 commented 1 year ago

@ideoforms

Seems that /live/song/get/track_data does not tolerate floats, /live/song/get/track_data 0 12 track.name returns 'float' object cannot be interpreted as an integer

Coupe70 commented 8 months ago

@ideoforms

have you looked at using /live/song/get/track_data for batch property queries?

Yes, I did (see above) ;-)

Coupe70 commented 8 months ago

I tried to query track.name and clip.name with the more complex way to send OSC in TouchOSC and it works. All I have to do to parse it is to also query /live/song/get/num_scenes, otherwise I can't tell when the clip names of one track end and a new track begins. I miss the opportunity to get clip_slot.has_stop_button. No problem to query it individually, but it's kind of missing to get all important information with /get/track_data.

ideoforms commented 8 months ago

I've added support for has_stop_button to complete the picture :) track_data and device parameters should also now tolerate float input.

Coupe70 commented 8 months ago

@ideoforms Floats work, has_stop_button works, but it is clip.has_stop_button where it should be clip_slot.has_stop_button.

ideoforms commented 8 months ago

Ah yes, have rewritten to clip_slot.has_stop_button

Coupe70 commented 8 months ago

Perfect.