ableton.v2.control_surface.wavetable_decoration (runtime)¶
Live 12 — Live Object Model & framework reference (descriptions and signatures).
Functions¶
get_parameter_by_name(decorator, name)¶
listens(event_path, *a, **k)¶
liveobj_valid(obj)¶
Classes¶
class EnumWrappingParameter(InternalParameterBase, PropertyHostMixin)¶
Properties¶
_live_ptrautomation_statecanonical_parentdefault_valuedisplay_valuemaxminnameoriginal_nameshort_value_itemsstatevaluevalue_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) -> boolis_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_indexautomation_statecanonical_parentdefault_valuedisplay_valueis_quantized- bool(x) -> boollinear_valuemaxminnameoriginal_nameshort_value_itemsstatevaluevalue_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 LiveObjectDecorator(CompoundDisconnectable, Proxy)¶
Properties¶
optionsparametersproxied_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=Noneproxied_object=None
class NotifyingList(EventObject)¶
Properties¶
available_valuesindex
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 ParameterState(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 termsdisabled=DeviceParameter.ParameterState.disabledenabled=DeviceParameter.ParameterState.enabledimag=<attribute 'imag' of 'int' objects>- the imaginary part of a complex numberirrelevant=DeviceParameter.ParameterState.irrelevantname=<member 'name' of 'Boost.Python.enum' objects>names={'enabled': DeviceParameter.ParameterState.enabled, 'irrelevant': DeviceParameter.ParameterState.irrelevant, 'disabled': DeviceParameter.ParameterState.disabled...- dict() -> new empty dictionarynumerator=<attribute 'numerator' of 'int' objects>- the numerator of a rational number in lowest termsreal=<attribute 'real' of 'int' objects>- the real part of a complex numbervalues={0: DeviceParameter.ParameterState.enabled, 1: DeviceParameter.ParameterState.irrelevant, 2: DeviceParameter.ParameterState.disabled}- dict() -> new empty dictionary
class PitchParameter(InternalParameter)¶
Properties¶
_combined_value_live_ptrautomation_statecanonical_parentdecimal_value_hostdefault_valuedisplay_valueinteger_value_hostlinear_valuemaxminnameoriginal_namestatevalue
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=Noneis_enabled=True- bool(x) -> boolis_quantized=False- bool(x) -> bool
class WavetableDeviceDecorator(LiveObjectDecorator, EventObject)¶
Properties¶
optionsparametersproxied_interface
Methods¶
__init__(self, *a, **k)¶
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)¶
_create_parameters(self)¶
_get_parameter_enabled_state(self, parameter)¶
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)¶
register_slot(self, *a, **k)¶
unregister_disconnectable(self, slot)¶
Attributes¶
MAX_UNISON_VOICE_COUNT=8- int([x]) -> integerMIN_UNISON_VOICE_COUNT=2- int([x]) -> integer_WavetableDeviceDecorator__on_osc_1_on_value_changed=None_WavetableDeviceDecorator__on_osc_2_on_value_changed=None_proxied_interface=None_skip_wrapper_lookup=Noneavailable_effect_modes=('None', 'Fm', 'Classic', 'Modern')- Built-in immutable sequence.available_filter_routings=('Serial', 'Parallel', 'Split')- Built-in immutable sequence.available_unison_modes=('None', 'Classic', 'Shimmer', 'Noise', 'Phase Sync', 'Position Spread', 'Random Note')- Built-in immutable sequence.mono_off_on_values=('Off', 'On')- Built-in immutable sequence.poly_voices_values=('2', '3', '4', '5', '6', '7', '8', '16')- Built-in immutable sequence.proxied_object=None
class WavetableEnvelopeType(int)¶
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¶
amp=0denominator=<attribute 'denominator' of 'int' objects>- the denominator of a rational number in lowest termsenv2=1env3=2imag=<attribute 'imag' of 'int' objects>- the imaginary part of a complex numbernumerator=<attribute 'numerator' of 'int' objects>- the numerator of a rational number in lowest termsreal=<attribute 'real' of 'int' objects>- the real part of a complex number
class WavetableEnvelopeViewType(int)¶
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 termsimag=<attribute 'imag' of 'int' objects>- the imaginary part of a complex numbernumerator=<attribute 'numerator' of 'int' objects>- the numerator of a rational number in lowest termsreal=<attribute 'real' of 'int' objects>- the real part of a complex numberslope=1time=0value=2
class WavetableFilterType(int)¶
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 termsimag=<attribute 'imag' of 'int' objects>- the imaginary part of a complex numbernumerator=<attribute 'numerator' of 'int' objects>- the numerator of a rational number in lowest termsone=0real=<attribute 'real' of 'int' objects>- the real part of a complex numbertwo=1
class WavetableLfoType(int)¶
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 termsimag=<attribute 'imag' of 'int' objects>- the imaginary part of a complex numbernumerator=<attribute 'numerator' of 'int' objects>- the numerator of a rational number in lowest termsone=0real=<attribute 'real' of 'int' objects>- the real part of a complex numbertwo=1
class WavetableOscillatorType(int)¶
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 termsimag=<attribute 'imag' of 'int' objects>- the imaginary part of a complex numbermix=3numerator=<attribute 'numerator' of 'int' objects>- the numerator of a rational number in lowest termsone=0real=<attribute 'real' of 'int' objects>- the real part of a complex numbers=2two=1