AbletonOSC icon indicating copy to clipboard operation
AbletonOSC copied to clipboard

/live/song/get/track_names doesn't return anything

Open CoponatRecords opened this issue 1 year ago • 1 comments

/live/song/get/num_tracks works flawlessly, but I can't seem to get the similar /live/song/get/track_names working

CoponatRecords avatar May 25 '24 11:05 CoponatRecords

``def osc_handler(*args):

n = args[-2]

if args[0] == '/live/song/get/num_tracks':

    print('Number of tracks - '+str(args[1]))
    global number_of_tracks
    number_of_tracks =  int(args[1])

elif args[0] == '/live/song/get/track_names':

    print('track_names - '+str(args))


elif args[0] == '/live/track/get/output_meter_level':
    with open("Track_"+str(n)+"_status.txt", "w") as file:
        file.write(str(args[-1]))
        file.close()

else:
    print(args[0])

used with

server_thread = threading.Thread(target=server.serve_forever).start()
disp.map("/live/track/get/output_meter_level", osc_handler)

client.send_message("/live/song/get/num_tracks", 99)
disp.map("/live/song/get/num_tracks", osc_handler)

disp.map("/live/song/get/track_data", osc_handler)
```

CoponatRecords avatar May 25 '24 11:05 CoponatRecords

It looks like you're querying /live/song/get/track_data, but looking for /live/song/get/track_names in the response. These are two different calls, so you will not see any response with this code.

In general, if you are interested in interacting with AbletonOSC from a Python client, I recommend using the pylive library, which is designed exactly for this. Thanks!

ideoforms avatar Nov 17 '25 17:11 ideoforms