Bus

digraph InheritanceGraph { graph [bgcolor=transparent, color=lightsteelblue2, fontname=Arial, fontsize=10, outputorder=edgesfirst, overlap=prism, penwidth=2, rankdir=LR, splines=spline, style="dashed, rounded", truecolor=true]; node [colorscheme=pastel19, fontname=Arial, fontsize=10, height=0, penwidth=2, shape=box, style="filled, rounded", width=0]; edge [color=lightslategrey, penwidth=1]; subgraph cluster_builtins { graph [label=builtins]; node [color=1]; "builtins.object" [URL="https://docs.python.org/3.6/library/functions.html#object", label=object, target=_top]; } subgraph "cluster_supriya.realtime" { graph [label="supriya.realtime"]; node [color=2]; "supriya.realtime.Bus.Bus" [URL="../api/supriya/realtime/Bus.html#supriya.realtime.Bus.Bus", color=black, fontcolor=white, label=Bus, target=_top]; "supriya.realtime.ServerObjectProxy.ServerObjectProxy" [URL="../api/supriya/realtime/ServerObjectProxy.html#supriya.realtime.ServerObjectProxy.ServerObjectProxy", label="Server\nObject\nProxy", shape=oval, style=bold, target=_top]; "supriya.realtime.ServerObjectProxy.ServerObjectProxy" -> "supriya.realtime.Bus.Bus"; } subgraph "cluster_supriya.system" { graph [label="supriya.system"]; node [color=3]; "supriya.system.SupriyaObject.SupriyaObject" [URL="../api/supriya/realtime/../system/SupriyaObject.html#supriya.system.SupriyaObject.SupriyaObject", label="Supriya\nObject", target=_top]; } "builtins.object" -> "supriya.system.SupriyaObject.SupriyaObject"; "supriya.system.SupriyaObject.SupriyaObject" -> "supriya.realtime.ServerObjectProxy.ServerObjectProxy"; }

class supriya.realtime.Bus.Bus(bus_group_or_index=None, calculation_rate=CalculationRate.CONTROL)[source]

A bus.

>>> import supriya
>>> server = supriya.Server().boot()
>>> bus = supriya.Bus()
>>> bus
<- Bus: ??? (control)>
>>> bus.allocate()
<+ Bus: 0 (control)>
>>> bus.get()
0.0
>>> bus.set(0.5)
>>> bus.get()
0.5
>>> print(bus)
c0
>>> bus.free()
<- Bus: ??? (control)>

Attributes Summary

__float__
__int__
__repr__ Return repr(self).
__str__ Gets map symbol representation of bus.
allocate
ar Creates an audio-rate input ugen subgraph.
audio
bus_group
bus_id
calculation_rate
control
free
get
is_allocated
kr Creates a control-rate input ugen subgraph.
map_symbol
server
set
value

Special methods

__float__()[source]
__int__()[source]
__repr__()[source]

Return repr(self).

__str__()[source]

Gets map symbol representation of bus.

>>> import supriya
>>> server = supriya.Server().boot()
>>> control_bus = supriya.Bus.control().allocate()
>>> audio_bus = supriya.Bus.audio().allocate()
>>> print(str(control_bus))
c0
>>> print(str(audio_bus))
a16
>>> print(str(control_bus.free()))
Traceback (most recent call last):
...
supriya.exceptions.BusNotAllocated

Methods

allocate(server=None, sync=False)[source]
ar()[source]

Creates an audio-rate input ugen subgraph.

>>> import supriya.realtime
>>> audio_bus = supriya.realtime.Bus(8, 'audio')
>>> ugen = audio_bus.ar()
>>> graph(ugen)  
>>> print(ugen)
synthdef:
    name: fb63450852ac2df2fad1242e27a913d6
    ugens:
    -   In.ar:
            bus: 8.0
>>> control_bus = supriya.realtime.Bus(8, 'control')
>>> ugen = control_bus.ar()
>>> graph(ugen)  
>>> print(ugen)
synthdef:
    name: d48f76506e364201100db95a248cc8e2
    ugens:
    -   In.kr:
            bus: 8.0
    -   K2A.ar:
            source: In.kr[0]

Returns ugen.

free()[source]
get(completion_callback=None)[source]
kr()[source]

Creates a control-rate input ugen subgraph.

>>> import supriya.realtime
>>> audio_bus = supriya.realtime.Bus(8, 'audio')
>>> ugen = audio_bus.kr()
>>> graph(ugen)  
>>> print(ugen)
synthdef:
    name: 65ceebd3294ae43fa3dd12035e1895fd
    ugens:
    -   In.ar:
            bus: 8.0
    -   A2K.kr:
            source: In.ar[0]
>>> control_bus = supriya.realtime.Bus(8, 'control')
>>> ugen = control_bus.kr()
>>> graph(ugen)  
>>> print(ugen)
synthdef:
    name: ef2c11e55da5af28e2ae77c5c8934f3d
    ugens:
    -   In.kr:
            bus: 8.0

Returns ugen.

set(value)[source]

Class & static methods

classmethod audio()[source]
classmethod control()[source]

Read-only properties

bus_group
bus_id
calculation_rate
is_allocated
map_symbol
server
value