:mod:`sc3nb.sc_objects.bus` =========================== .. py:module:: sc3nb.sc_objects.bus .. autoapi-nested-parse:: Python representation of the scsynth Bus. .. !! processed by numpydoc !! Module Contents --------------- Class List ~~~~~~~~~~ .. autoapisummary:: :nosignatures: sc3nb.sc_objects.bus.ControlBusCommand sc3nb.sc_objects.bus.BusRate sc3nb.sc_objects.bus.Bus Content ~~~~~~~ .. class:: ControlBusCommand **Bases:** :class:`str`, :class:`enum.Enum` OSC Commands for Control Buses Initialize self. See help(type(self)) for accurate signature. .. !! processed by numpydoc !! .. py:attribute:: FILL :value: '/c_fill' .. py:attribute:: SET :value: '/c_set' .. py:attribute:: SETN :value: '/c_setn' .. py:attribute:: GET :value: '/c_get' .. py:attribute:: GETN :value: '/c_getn' .. class:: BusRate **Bases:** :class:`str`, :class:`enum.Enum` Calculation rate of Buses Initialize self. See help(type(self)) for accurate signature. .. !! processed by numpydoc !! .. py:attribute:: AUDIO :value: 'audio' .. py:attribute:: CONTROL :value: 'control' .. class:: Bus(rate: Union[BusRate, str], num_channels: int = 1, index: Optional[int] = None, server: Optional[sc3nb.sc_objects.server.SCServer] = None) Represenation of Control or Audio Bus(es) on the SuperCollider Server If num_channels > 1 this will be represent muliple Buses in a row. :Parameters: **rate** : Union[BusRate, str] Rate of the Bus, either control or audio **num_channels** : int, optional How many channels to allocate, by default 1 **index** : int, optional Starting Bus index this Bus, by default this will be handled by the servers Bus allocator. **server** : SCServer, optional Server instance for this Bus, by default the default SC server instance. .. !! processed by numpydoc !! .. py:attribute:: _server .. py:attribute:: _num_channels .. py:attribute:: _rate **Overview:** .. autoapisummary:: :nosignatures: sc3nb.sc_objects.bus.Bus.is_audio_bus sc3nb.sc_objects.bus.Bus.is_control_bus sc3nb.sc_objects.bus.Bus.set sc3nb.sc_objects.bus.Bus.fill sc3nb.sc_objects.bus.Bus.get sc3nb.sc_objects.bus.Bus.free sc3nb.sc_objects.bus.Bus.__del__ sc3nb.sc_objects.bus.Bus.__repr__ .. py:method:: is_audio_bus() -> bool Rate check :Returns: bool True if this is a audio bus .. !! processed by numpydoc !! .. py:method:: is_control_bus() -> bool Rate check :Returns: bool True if this is a control bus .. !! processed by numpydoc !! .. py:method:: set(*values: Sequence[Union[int, float]], return_msg=False) -> Union[Bus, sc3nb.osc.osc_communication.OSCMessage] Set ranges of bus values. :Parameters: **values** : sequence of int or float Values that should be set **return_msg** : bool, optional If True return msg else send it directly, by default False :Raises: RuntimeError If trying to setn an Audio Bus .. !! processed by numpydoc !! .. py:method:: fill(value: Union[int, float], return_msg=False) -> Union[Bus, sc3nb.osc.osc_communication.OSCMessage] Fill bus(es) to one value. :Parameters: **value** : Union[int, float] value for the buses **return_msg** : bool, optional If True return msg else send it directly, by default False :Raises: RuntimeError If fill is used on a Audio Bus .. !! processed by numpydoc !! .. py:method:: get() -> Union[Union[int, float], Sequence[Union[int, float]]] Get bus value(s). :Returns: bus value or sequence of bus values The current value of this bus Multiple values if this bus has num_channels > 1 :Raises: RuntimeError If get is used on an Audio Bus .. !! processed by numpydoc !! .. py:method:: free(clear: bool = True) -> None Mark this Buses ids as free again :Parameters: **clear** : bool, optional Reset bus value(s) to 0, by default True .. !! processed by numpydoc !! .. py:method:: __del__() -> None .. py:method:: __repr__() -> str