Unimplemented api features #77
-
Hi Leo! I'm wondering if there is a way to call the Ableton api on methods and properties that are not yet implemented in the script namespace? For example, I managed to receive a Browser object, but its a string that looks like a python memory address, not the actual Browser object. Also, I'd like to observe and set tracks mixer_device props, like volume. Is there a way of doing this? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
Thank you for your feedback, I'm happy to hear that you find this library useful! Generally, all properties that contain strings, booleans, and numbers, and all functions in the supported namespaces can be accessed without making any change to this library. However, if the property is an object like the browser you're trying to access, the library needs to know how to serialize the object. If there's no defined serialization, ableton-js will try to convert the property into a string which is what you got when you tried to access the browser property. I should be able to make a PR for this soon, but going through the API specification of Live, it seems like the I hope this helped. Let me know if you have any further questions! |
Beta Was this translation helpful? Give feedback.
-
Hi, Thanks for the mixer_device! I was curious about the volume not being observable, control surfaces like the push and the Novation slMk3 actually listens and properly shows volume changes. You're right, it is not in the documentation... But looking in the remote scripts, some things that looks like they are related to observing the volume. Is this something that could be implemented you think? I'm just starting python, so I don't think I have the qualification to submit PRs just yet (but can't wait to try to help if it is permitted!). Maybe I ask to much, but I'm really curious about the possibility of such use of undocumented features! from ableton.v2.base import clamp, listens, liveobj_valid, old_round
import ableton.v2.control_surface.components as ChannelStripComponentBase
@listens('value')
def __on_volume_changed(self):
self._update_volume_led()
self._ChannelStripComponent__on_volume_changed.subject = track.mixer_device.volume if liveobj_valid(track) else None
self._ChannelStripComponent__on_volume_changed() On another note, If you find features or issues that could be coded by beginner/intermediate programmer, I would gladly help! I just started in CS at university and this project would a the perfect learning experience for me! Thanks you! |
Beta Was this translation helpful? Give feedback.
Thank you for your feedback, I'm happy to hear that you find this library useful!
Generally, all properties that contain strings, booleans, and numbers, and all functions in the supported namespaces can be accessed without making any change to this library. However, if the property is an object like the browser you're trying to access, the library needs to know how to serialize the object.
If there's no defined serialization, ableton-js will try to convert the property into a string which is what you got when you tried to access the browser property.
I should be able to make a PR for this soon, but going through the API specification of Live, it seems like the
volume
property can't be obs…