Skip to content

ableton.v2.control_surface.decoration (runtime)

Live 12 — Live Object Model & framework reference (descriptions and signatures).

Functions

clamp(val, minv, maxv)

find_if(predicate, seq)

get_parameter_automation_state(parameter)

get_parameter_by_name(decorator, name)

listens(event_path, *a, **k)

liveobj_valid(obj)

old_hasattr(obj, attr)

Classes

class AutomationState(enum)

int([x]) -> integer int(x, base=10) -> integer

Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.

If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.

int('0b100', base=0) 4

Methods

__init__(self, /, *args, **kwargs)

Initialize self. See help(type(self)) for accurate signature.

as_integer_ratio(self, /)

Return integer ratio.

Return a pair of integers, whose ratio is exactly equal to the original int and with a positive denominator.

(10).as_integer_ratio() (10, 1) (-10).as_integer_ratio() (-10, 1) (0).as_integer_ratio() (0, 1)

bit_count(self, /)

Number of ones in the binary representation of the absolute value of self.

Also known as the population count.

bin(13) '0b1101' (13).bit_count() 3

bit_length(self, /)

Number of bits necessary to represent self in binary.

bin(37) '0b100101' (37).bit_length() 6

conjugate(...)

Returns self, the complex conjugate of any int.

from_bytes(bytes, byteorder='big', *, signed=False)

Return the integer represented by the given array of bytes.

bytes Holds the array of bytes to convert. The argument must either support the buffer protocol or be an iterable object producing bytes. Bytes and bytearray are examples of built-in objects that support the buffer protocol. byteorder The byte order used to represent the integer. If byteorder is 'big', the most significant byte is at the beginning of the byte array. If byteorder is 'little', the most significant byte is at the end of the byte array. To request the native byte order of the host system, use `sys.byteorder' as the byte order value. Default is to use 'big'. signed Indicates whether two's complement is used to represent the integer.

to_bytes(self, /, length=1, byteorder='big', *, signed=False)

Return an array of bytes representing an integer.

length Length of bytes object to use. An OverflowError is raised if the integer is not representable with the given number of bytes. Default is length 1. byteorder The byte order used to represent the integer. If byteorder is 'big', the most significant byte is at the beginning of the byte array. If byteorder is 'little', the most significant byte is at the end of the byte array. To request the native byte order of the host system, use `sys.byteorder' as the byte order value. Default is to use 'big'. signed Determines whether two's complement is used to represent the integer. If signed is False and a negative integer is given, an OverflowError is raised.

Attributes

  • denominator = <attribute 'denominator' of 'int' objects> - the denominator of a rational number in lowest terms
  • imag = <attribute 'imag' of 'int' objects> - the imaginary part of a complex number
  • name = <member 'name' of 'Boost.Python.enum' objects>
  • names = {'none': DeviceParameter.AutomationState.none, 'playing': DeviceParameter.AutomationState.playing, 'overridden': DeviceParameter.AutomationState.overridden} - dict() -> new empty dictionary
  • none = DeviceParameter.AutomationState.none
  • numerator = <attribute 'numerator' of 'int' objects> - the numerator of a rational number in lowest terms
  • overridden = DeviceParameter.AutomationState.overridden
  • playing = DeviceParameter.AutomationState.playing
  • real = <attribute 'real' of 'int' objects> - the real part of a complex number
  • values = {0: DeviceParameter.AutomationState.none, 1: DeviceParameter.AutomationState.playing, 2: DeviceParameter.AutomationState.overridden} - dict() -> new empty dictionary

class CompoundDisconnectable(Disconnectable)

Methods

__init__(self, *a, **k)

Initialize self. See help(type(self)) for accurate signature.

disconnect(self)
disconnect_disconnectable(self, slot)
find_disconnectable(self, predicate)
has_disconnectable(self, slot)
register_disconnectable(self, slot)
register_disconnectables(self, disconnectables)
unregister_disconnectable(self, slot)

class DecoratorFactory(CompoundDisconnectable)

Methods

__init__(self, *a, **k)

Initialize self. See help(type(self)) for accurate signature.

_decorator(live_object=None, additional_properties={})
_get_decorated_object(self, live_object, additional_properties, **k)
_should_be_decorated(device)
decorate(self, live_object, additional_properties={}, **k)
disconnect(self)
disconnect_disconnectable(self, slot)
find_disconnectable(self, predicate)
has_disconnectable(self, slot)
register_disconnectable(self, slot)
register_disconnectables(self, disconnectables)
sync_decorated_objects(self, keys)
unregister_disconnectable(self, slot)

class DeviceOnOffOption(DeviceTriggerOption)

Properties

  • active
  • active_index
  • default_label
  • name

Methods

__init__(self, name=None, property_host=None, value_property_name='value', state_property_name='state', *a, **k)

Initialize self. See help(type(self)) for accurate signature.

_get_default_label(self)
_is_active(self)
_property_value(self)
_set_default_label(self, label)
active_has_listener(self, slot)
active_index_has_listener(self, slot)
active_index_listener_count(self)
active_listener_count(self)
add_active_index_listener(self, slot, identify_sender=False, *a, **k)
add_active_listener(self, slot, identify_sender=False, *a, **k)
add_default_label_listener(self, slot, identify_sender=False, *a, **k)
cycle_index(self)
default_label_has_listener(self, slot)
default_label_listener_count(self)
disconnect(self)
disconnect_disconnectable(self, slot)
find_disconnectable(self, predicate)
has_disconnectable(self, slot)
notify_active(self, *a, **k)
notify_active_index(self, *a, **k)
notify_default_label(self, *a, **k)
register_disconnectable(self, slot)
register_disconnectables(self, disconnectables)
register_slot(self, *a, **k)
remove_active_index_listener(self, slot)
remove_active_listener(self, slot)
remove_default_label_listener(self, slot)
set_property_host(self, property_host)
unregister_disconnectable(self, slot)

Attributes

  • OFF_LABEL = 'Off' - str(object='') -> str
  • ON_LABEL = 'On' - str(object='') -> str

class DeviceSwitchOption(DeviceTriggerOption)

Properties

  • active
  • active_index
  • default_label
  • labels
  • name

Methods

__init__(self, labels=None, parameter=None, *a, **k)

Initialize self. See help(type(self)) for accurate signature.

_get_default_label(self)
_is_active(self)
_set_default_label(self, label)
active_has_listener(self, slot)
active_index_has_listener(self, slot)
active_index_listener_count(self)
active_listener_count(self)
add_active_index_listener(self, slot, identify_sender=False, *a, **k)
add_active_listener(self, slot, identify_sender=False, *a, **k)
add_default_label_listener(self, slot, identify_sender=False, *a, **k)
cycle_index(self)
default_label_has_listener(self, slot)
default_label_listener_count(self)
disconnect(self)
disconnect_disconnectable(self, slot)
find_disconnectable(self, predicate)
has_disconnectable(self, slot)
notify_active(self, *a, **k)
notify_active_index(self, *a, **k)
notify_default_label(self, *a, **k)
register_disconnectable(self, slot)
register_disconnectables(self, disconnectables)
register_slot(self, *a, **k)
remove_active_index_listener(self, slot)
remove_active_listener(self, slot)
remove_default_label_listener(self, slot)
set_parameter(self, parameter)
unregister_disconnectable(self, slot)

Attributes

  • _DeviceSwitchOption__on_value_changed = None

class EnumWrappingParameter(InternalParameterBase, PropertyHostMixin)

Properties

  • _live_ptr
  • automation_state
  • canonical_parent
  • default_value
  • display_value
  • max
  • min
  • name
  • original_name
  • short_value_items
  • state
  • value
  • value_items

Methods

__init__(self, parent=None, index_property_host=None, values_host=None, values_property=None, index_property=None, value_type=<class 'int'>, to_index_conversion=None, from_index_conversion=None, *a, **k)

Initialize self. See help(type(self)) for accurate signature.

_get_index(self)
_get_values(self)
_has_valid_parent(self)
_set_index(self, index)
add_automation_state_listener(self, slot, identify_sender=False, *a, **k)
add_name_listener(self, slot, identify_sender=False, *a, **k)
add_state_listener(self, slot, identify_sender=False, *a, **k)
add_value_items_listener(self, slot, identify_sender=False, *a, **k)
add_value_listener(self, slot, identify_sender=False, *a, **k)
automation_state_has_listener(self, slot)
automation_state_listener_count(self)
disconnect(self)
disconnect_disconnectable(self, slot)
find_disconnectable(self, predicate)
has_disconnectable(self, slot)
name_has_listener(self, slot)
name_listener_count(self)
notify_automation_state(self, *a, **k)
notify_name(self, *a, **k)
notify_state(self, *a, **k)
notify_value(self, *a, **k)
notify_value_items(self, *a, **k)
register_disconnectable(self, slot)
register_disconnectables(self, disconnectables)
register_slot(self, *a, **k)
remove_automation_state_listener(self, slot)
remove_name_listener(self, slot)
remove_state_listener(self, slot)
remove_value_items_listener(self, slot)
remove_value_listener(self, slot)
set_property_host(self, new_host)
state_has_listener(self, slot)
state_listener_count(self)
unregister_disconnectable(self, slot)
value_has_listener(self, slot)
value_items_has_listener(self, slot)
value_items_listener_count(self)
value_listener_count(self)

Attributes

  • is_enabled = True - bool(x) -> bool
  • is_quantized = True - bool(x) -> bool

class EventObject(CompoundDisconnectable)

Methods

__init__(self, *a, **k)

Initialize self. See help(type(self)) for accurate signature.

disconnect(self)
disconnect_disconnectable(self, slot)
find_disconnectable(self, predicate)
has_disconnectable(self, slot)
register_disconnectable(self, slot)
register_disconnectables(self, disconnectables)
register_slot(self, *a, **k)
unregister_disconnectable(self, slot)

class IntegerParameter(InternalParameter)

Properties

  • _live_ptr
  • _max_index
  • _min_index
  • automation_state
  • canonical_parent
  • default_value
  • display_value
  • is_quantized - bool(x) -> bool
  • linear_value
  • max
  • min
  • name
  • original_name
  • short_value_items
  • state
  • value
  • value_items

Methods

__init__(self, integer_value_host=None, integer_value_property_name=None, min_value=None, max_value=None, show_as_quantized=False, *a, **k)

Initialize self. See help(type(self)) for accurate signature.

_get_integer_value(self)
_get_linear_value(self)
_get_value(self)
_has_valid_parent(self)
_index_from_value(self, value)
_index_to_value(self, index)
_set_integer_value(self, new_value)
_set_linear_value(self, new_value)
_set_value(self, new_value)
add_automation_state_listener(self, slot, identify_sender=False, *a, **k)
add_name_listener(self, slot, identify_sender=False, *a, **k)
add_state_listener(self, slot, identify_sender=False, *a, **k)
add_value_listener(self, slot, identify_sender=False, *a, **k)
automation_state_has_listener(self, slot)
automation_state_listener_count(self)
disconnect(self)
disconnect_disconnectable(self, slot)
find_disconnectable(self, predicate)
has_disconnectable(self, slot)
name_has_listener(self, slot)
name_listener_count(self)
notify_automation_state(self, *a, **k)
notify_name(self, *a, **k)
notify_state(self, *a, **k)
notify_value(self, *a, **k)
register_disconnectable(self, slot)
register_disconnectables(self, disconnectables)
register_slot(self, *a, **k)
remove_automation_state_listener(self, slot)
remove_name_listener(self, slot)
remove_state_listener(self, slot)
remove_value_listener(self, slot)
set_display_value_conversion(self, display_value_conversion)
set_scaling_functions(self, to_internal, from_internal)
state_has_listener(self, slot)
state_listener_count(self)
unregister_disconnectable(self, slot)
value_has_listener(self, slot)
value_listener_count(self)

Attributes

  • is_enabled = True - bool(x) -> bool

class InternalParameter(InternalParameterBase)

Properties

  • _live_ptr
  • automation_state
  • canonical_parent
  • default_value
  • display_value
  • linear_value
  • max
  • min
  • name
  • original_name
  • state
  • value

Methods

__init__(self, parent=None, display_value_conversion=None, *a, **k)

Initialize self. See help(type(self)) for accurate signature.

_get_linear_value(self)
_get_value(self)
_has_valid_parent(self)
_set_linear_value(self, new_value)
_set_value(self, new_value)
add_automation_state_listener(self, slot, identify_sender=False, *a, **k)
add_name_listener(self, slot, identify_sender=False, *a, **k)
add_state_listener(self, slot, identify_sender=False, *a, **k)
add_value_listener(self, slot, identify_sender=False, *a, **k)
automation_state_has_listener(self, slot)
automation_state_listener_count(self)
disconnect(self)
disconnect_disconnectable(self, slot)
find_disconnectable(self, predicate)
has_disconnectable(self, slot)
name_has_listener(self, slot)
name_listener_count(self)
notify_automation_state(self, *a, **k)
notify_name(self, *a, **k)
notify_state(self, *a, **k)
notify_value(self, *a, **k)
register_disconnectable(self, slot)
register_disconnectables(self, disconnectables)
register_slot(self, *a, **k)
remove_automation_state_listener(self, slot)
remove_name_listener(self, slot)
remove_state_listener(self, slot)
remove_value_listener(self, slot)
set_display_value_conversion(self, display_value_conversion)
set_scaling_functions(self, to_internal, from_internal)
state_has_listener(self, slot)
state_listener_count(self)
unregister_disconnectable(self, slot)
value_has_listener(self, slot)
value_listener_count(self)

Attributes

  • is_enabled = True - bool(x) -> bool
  • is_quantized = False - bool(x) -> bool

class LiveObjectDecorator(CompoundDisconnectable, Proxy)

Properties

  • options
  • parameters
  • proxied_interface

Methods

__init__(self, live_object=None, additional_properties={})

Initialize self. See help(type(self)) for accurate signature.

_add_enum_parameter(self, name, values, default_value)
_add_non_automatable_enum_parameter(self, name, list, index)
_add_non_automatable_int_parameter(self, name, property_name, min, max, units)
_add_on_off_option(self, name, pname)
_add_switch_option(self, name, pname, labels)
disconnect(self)
disconnect_disconnectable(self, slot)
find_disconnectable(self, predicate)
has_disconnectable(self, slot)
proxy_old_hasattr(self, attr)
register_disconnectable(self, slot)
register_disconnectables(self, disconnectables)
unregister_disconnectable(self, slot)

Attributes

  • _proxied_interface = None
  • _skip_wrapper_lookup = None
  • proxied_object = None

class LiveObjectDict(dict)

dict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object's (key, value) pairs dict(iterable) -> new dictionary initialized as if via: d = {} for k, v in iterable: d[k] = v dict(**kwargs) -> new dictionary initialized with the name=value pairs in the keyword argument list. For example: dict(one=1, two=2)

Methods

__init__(self, *a, **k)

Initialize self. See help(type(self)) for accurate signature.

_transform_key(self, key)
clear(...)

D.clear() -> None. Remove all items from D.

copy(...)

D.copy() -> a shallow copy of D

fromkeys(iterable, value=None, /)

Create a new dictionary with keys from iterable and values set to value.

get(self, key, *default)

Return the value for key if key is in the dictionary, else default.

items(...)

D.items() -> a set-like object providing a view on D's items

keys(...)

D.keys() -> a set-like object providing a view on D's keys

pop(...)

D.pop(k[,d]) -> v, remove specified key and return the corresponding value.

If the key is not found, return the default if given; otherwise, raise a KeyError.

popitem(self, /)

Remove and return a (key, value) pair as a 2-tuple.

Pairs are returned in LIFO (last-in, first-out) order. Raises KeyError if the dict is empty.

prune(self, keys)
setdefault(self, key, default=None, /)

Insert key with a value of default if key is not in the dictionary.

Return the value for key if key is in the dictionary, else default.

update(self, *a, **k)

D.update([E, ]**F) -> None. Update D from dict/iterable E and F. If E is present and has a .keys() method, then does: for k in E: D[k] = E[k] If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k]

values(...)

D.values() -> an object providing a view on D's values

class NotifyingList(EventObject)

Properties

  • available_values
  • index

Methods

__init__(self, available_values, default_value=None, *a, **k)

Initialize self. See help(type(self)) for accurate signature.

_get_index(self)
_set_index(self, value)
add_index_listener(self, slot, identify_sender=False, *a, **k)
disconnect(self)
disconnect_disconnectable(self, slot)
find_disconnectable(self, predicate)
has_disconnectable(self, slot)
index_has_listener(self, slot)
index_listener_count(self)
notify_index(self, *a, **k)
register_disconnectable(self, slot)
register_disconnectables(self, disconnectables)
register_slot(self, *a, **k)
remove_index_listener(self, slot)
unregister_disconnectable(self, slot)

class PitchParameter(InternalParameter)

Properties

  • _combined_value
  • _live_ptr
  • automation_state
  • canonical_parent
  • decimal_value_host
  • default_value
  • display_value
  • integer_value_host
  • linear_value
  • max
  • min
  • name
  • original_name
  • state
  • value

Methods

__init__(self, integer_value_host=None, decimal_value_host=None, *a, **k)

Initialize self. See help(type(self)) for accurate signature.

_get_linear_value(self)
_get_value(self)
_has_valid_parent(self)
_set_coarse(self, new_value)
_set_finegrain(self, new_value)
_set_linear_value(self, new_value)
_set_value(self, new_value)
add_automation_state_listener(self, slot, identify_sender=False, *a, **k)
add_linear_value_listener(self, slot, identify_sender=False, *a, **k)
add_name_listener(self, slot, identify_sender=False, *a, **k)
add_state_listener(self, slot, identify_sender=False, *a, **k)
add_value_listener(self, slot, identify_sender=False, *a, **k)
automation_state_has_listener(self, slot)
automation_state_listener_count(self)
disconnect(self)
disconnect_disconnectable(self, slot)
find_disconnectable(self, predicate)
has_disconnectable(self, slot)
linear_value_has_listener(self, slot)
linear_value_listener_count(self)
name_has_listener(self, slot)
name_listener_count(self)
notify_automation_state(self, *a, **k)
notify_linear_value(self, *a, **k)
notify_name(self, *a, **k)
notify_state(self, *a, **k)
notify_value(self, *a, **k)
register_disconnectable(self, slot)
register_disconnectables(self, disconnectables)
register_slot(self, *a, **k)
remove_automation_state_listener(self, slot)
remove_linear_value_listener(self, slot)
remove_name_listener(self, slot)
remove_state_listener(self, slot)
remove_value_listener(self, slot)
set_display_value_conversion(self, display_value_conversion)
set_scaling_functions(self, to_internal, from_internal)
state_has_listener(self, slot)
state_listener_count(self)
unregister_disconnectable(self, slot)
value_has_listener(self, slot)
value_listener_count(self)

Attributes

  • _on_decimal_value_automation_state_changed = None
  • _on_decimal_value_changed = None
  • _on_integer_value_automation_state_changed = None
  • _on_integer_value_changed = None
  • is_enabled = True - bool(x) -> bool
  • is_quantized = False - bool(x) -> bool

class Proxy(ProxyBase)

Properties

  • proxied_interface

Methods

__init__(self, proxied_object=None, proxied_interface=None, *a, **k)

Initialize self. See help(type(self)) for accurate signature.

proxy_old_hasattr(self, attr)

Attributes

  • _proxied_interface = None
  • _skip_wrapper_lookup = None
  • proxied_object = None

class listenable_property(listenable_property_base, property)

Property attribute.

fget function to be used for getting an attribute value fset function to be used for setting an attribute value fdel function to be used for del'ing an attribute doc docstring

Typical use is to define a managed attribute x:

class C(object): def getx(self): return self._x def setx(self, value): self._x = value def delx(self): del self._x x = property(getx, setx, delx, "I'm the 'x' property.")

Decorators make defining new properties or modifying existing ones easy:

class C(object): @property def x(self): "I am the 'x' property." return self._x @x.setter def x(self, value): self._x = value @x.deleter def x(self): del self._x

Methods

__init__(self, /, *args, **kwargs)

Initialize self. See help(type(self)) for accurate signature.

deleter(...)

Descriptor to obtain a copy of the property with a different deleter.

getter(...)

Descriptor to obtain a copy of the property with a different getter.

managed(default_value)
set_property_name(self, name)
setter(...)

Descriptor to obtain a copy of the property with a different setter.

Attributes

  • fdel = <member 'fdel' of 'property' objects>
  • fget = <member 'fget' of 'property' objects>
  • fset = <member 'fset' of 'property' objects>