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.nonrealtime" { graph [label="supriya.nonrealtime"]; node [color=2]; "supriya.nonrealtime.Bus.Bus" [URL="../api/supriya/nonrealtime/Bus.html#supriya.nonrealtime.Bus.Bus", color=black, fontcolor=white, label=Bus, target=_top]; "supriya.nonrealtime.SessionObject.SessionObject" [URL="../api/supriya/nonrealtime/SessionObject.html#supriya.nonrealtime.SessionObject.SessionObject", label="Session\nObject", shape=oval, style=bold, target=_top]; "supriya.nonrealtime.SessionObject.SessionObject" -> "supriya.nonrealtime.Bus.Bus"; } subgraph "cluster_supriya.system" { graph [label="supriya.system"]; node [color=3]; "supriya.system.SupriyaObject.SupriyaObject" [URL="../api/supriya/nonrealtime/../system/SupriyaObject.html#supriya.system.SupriyaObject.SupriyaObject", label="Supriya\nObject", target=_top]; } "builtins.object" -> "supriya.system.SupriyaObject.SupriyaObject"; "supriya.system.SupriyaObject.SupriyaObject" -> "supriya.nonrealtime.SessionObject.SessionObject"; }

class supriya.nonrealtime.Bus.Bus(session, bus_group=None, calculation_rate=None, session_id=None)[source]

A non-realtime bus.

>>> import supriya.nonrealtime
>>> session = supriya.nonrealtime.Session()
>>> bus = session.add_bus('control')
>>> print(repr(bus))
<Bus(
    <Session>,
    calculation_rate=CalculationRate.CONTROL,
    session_id=0,
    )>
>>> with session.at(1):
...     bus.set_(0.5)
...
>>> with session.at(3):
...     bus.set_(0.75)
...
>>> for offset in range(5):
...     with session.at(offset):
...         value = bus.get()
...         print(offset, value)
...
0 0.0
1 0.5
2 0.5
3 0.75
4 0.75

Attributes Summary

__repr__ Return repr(self).
__str__ Return str(self).
bus_group
calculation_rate
get
get_map_symbol
session_id
set_
start_offset
stop_offset

Special methods

__repr__()[source]

Return repr(self).

__str__()[source]

Return str(self).


Methods

get(offset=None)[source]
get_map_symbol(bus_id)[source]
set_(value, offset=None)[source]

Class & static methods

static (SessionObject).require_offset(function)

Read-only properties

bus_group
calculation_rate
(SessionObject).session
session_id
start_offset
stop_offset