Bus

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

A non-realtime bus.

>>> session = nonrealtimetools.Session()
>>> bus = session.add_bus('control')
>>> print(repr(bus))
<Bus(
    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

Lineage

digraph InheritanceGraph { graph [background=transparent, bgcolor=transparent, color=lightslategrey, fontname=Arial, outputorder=edgesfirst, overlap=prism, penwidth=2, rankdir=LR, root="__builtin__.object", splines=spline, style="dotted, rounded", truecolor=true]; node [colorscheme=pastel19, fontname=Arial, fontsize=12, penwidth=2, style="filled, rounded"]; edge [color=lightsteelblue2, penwidth=2]; subgraph cluster_builtins { graph [label=builtins]; "builtins.object" [color=1, group=0, label=object, shape=box]; } subgraph cluster_nonrealtimetools { graph [label=nonrealtimetools]; "supriya.tools.nonrealtimetools.Bus.Bus" [color=black, fontcolor=white, group=1, label=<<B>Bus</B>>, shape=box, style="filled, rounded"]; "supriya.tools.nonrealtimetools.SessionObject.SessionObject" [color=2, group=1, label=SessionObject, shape=oval, style=bold]; "supriya.tools.nonrealtimetools.SessionObject.SessionObject" -> "supriya.tools.nonrealtimetools.Bus.Bus"; } subgraph cluster_systemtools { graph [label=systemtools]; "supriya.tools.systemtools.SupriyaObject.AbstractBase" [color=3, group=2, label=AbstractBase, shape=box]; "supriya.tools.systemtools.SupriyaObject.SupriyaObject" [color=3, group=2, label=SupriyaObject, shape=box]; "supriya.tools.systemtools.SupriyaObject.AbstractBase" -> "supriya.tools.systemtools.SupriyaObject.SupriyaObject"; } "builtins.object" -> "supriya.tools.systemtools.SupriyaObject.AbstractBase"; "supriya.tools.systemtools.SupriyaObject.SupriyaObject" -> "supriya.tools.nonrealtimetools.SessionObject.SessionObject"; }

Bases

Attribute summary

bus_group
calculation_rate
get([offset])
get_map_symbol(bus_id)
require_offset(function)
session
set_(value[, offset])
start_offset
stop_offset
__eq__(expr) Is true when ID of expr equals ID of Supriya object.
__format__([format_specification]) Formats Supriya object.
__hash__() Hashes Supriya object.
__repr__() Gets interpreter representation of Supriya object.
__str__()

Read-only properties

Bus.bus_group
Bus.calculation_rate
(SessionObject).session
Bus.start_offset
Bus.stop_offset

Methods

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

Class & static methods

(SessionObject).require_offset(function)

Special methods

(SupriyaObject).__eq__(expr)

Is true when ID of expr equals ID of Supriya object. Otherwise false.

Returns boolean.

(SupriyaObject).__format__(format_specification='')

Formats Supriya object.

Set format_specification to ‘’ or ‘storage’. Interprets ‘’ equal to ‘storage’.

Returns string.

(SupriyaObject).__hash__()

Hashes Supriya object.

Required to be explicitely re-defined on Python 3 if __eq__ changes.

Returns integer.

(SupriyaObject).__repr__()

Gets interpreter representation of Supriya object.

Returns string.

Bus.__str__()[source]