OscBundle

class supriya.tools.osctools.OscBundle(timestamp=None, contents=None)[source]

An OSC bundle.

>>> from supriya.tools import osctools
>>> message_one = osctools.OscMessage('/one', 1)
>>> message_two = osctools.OscMessage('/two', 2)
>>> message_three = osctools.OscMessage('/three', 3)
>>> inner_bundle = osctools.OscBundle(
...     timestamp=1401557034.5,
...     contents=(message_one, message_two),
...     )
>>> inner_bundle
OscBundle(
    timestamp=1401557034.5,
    contents=(
        OscMessage('/one', 1),
        OscMessage('/two', 2),
        )
    )
>>> outer_bundle = osctools.OscBundle(
...     contents=(inner_bundle, message_three),
...     )
>>> outer_bundle
OscBundle(
    contents=(
        OscBundle(
            timestamp=1401557034.5,
            contents=(
                OscMessage('/one', 1),
                OscMessage('/two', 2),
                )
            ),
        OscMessage('/three', 3),
        )
    )
>>> datagram = outer_bundle.to_datagram()
>>> decoded_bundle = osctools.OscBundle.from_datagram(datagram)
>>> decoded_bundle
OscBundle(
    contents=(
        OscBundle(
            timestamp=1401557034.5,
            contents=(
                OscMessage('/one', 1),
                OscMessage('/two', 2),
                )
            ),
        OscMessage('/three', 3),
        )
    )
>>> decoded_bundle == outer_bundle
True

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_osctools { graph [label=osctools]; "supriya.tools.osctools.OscBundle.OscBundle" [color=black, fontcolor=white, group=1, label=<<B>OscBundle</B>>, shape=box, style="filled, rounded"]; "supriya.tools.osctools.OscMixin.OscMixin" [color=2, group=1, label=OscMixin, shape=oval, style=bold]; "supriya.tools.osctools.OscMixin.OscMixin" -> "supriya.tools.osctools.OscBundle.OscBundle"; } 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.SupriyaValueObject.SupriyaValueObject" [color=3, group=2, label=SupriyaValueObject, shape=box]; "supriya.tools.systemtools.SupriyaObject.AbstractBase" -> "supriya.tools.systemtools.SupriyaObject.SupriyaObject"; "supriya.tools.systemtools.SupriyaObject.SupriyaObject" -> "supriya.tools.systemtools.SupriyaValueObject.SupriyaValueObject"; } "builtins.object" -> "supriya.tools.systemtools.SupriyaObject.AbstractBase"; "supriya.tools.systemtools.SupriyaValueObject.SupriyaValueObject" -> "supriya.tools.osctools.OscMixin.OscMixin"; }

Bases

Attribute summary

bundles_to_nonrealtime_datagram(osc_bundles)
contents
datagram_is_bundle(datagram[, offset])
format_datagram(datagram)
from_datagram(datagram)
timestamp
to_datagram([realtime])
to_list()
__copy__(*args)
__eq__(expr)
__format__([format_specification]) Formats Supriya object.
__hash__()
__repr__() Gets interpreter representation of Supriya object.
__str__() Gets string representation of OSC object.

Read-only properties

OscBundle.contents
OscBundle.timestamp

Methods

OscBundle.to_datagram(realtime=True)[source]
OscBundle.to_list()[source]

Class & static methods

static OscBundle.bundles_to_nonrealtime_datagram(osc_bundles)[source]
static OscBundle.datagram_is_bundle(datagram, offset=0)[source]
(OscMixin).format_datagram(datagram)
static OscBundle.from_datagram(datagram)[source]

Special methods

(SupriyaValueObject).__copy__(*args)
(SupriyaValueObject).__eq__(expr)
(SupriyaObject).__format__(format_specification='')

Formats Supriya object.

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

Returns string.

(SupriyaValueObject).__hash__()
(SupriyaObject).__repr__()

Gets interpreter representation of Supriya object.

Returns string.

(OscMixin).__str__()

Gets string representation of OSC object.

size 164
   0   2f 64 5f 72  65 63 76 00  2c 62 62 00  00 00 00 6b   |/d_recv.,bb....k|
  16   53 43 67 66  00 00 00 02  00 01 04 74  65 73 74 00   |SCgf.......test.|
  32   00 00 02 43  dc 00 00 00  00 00 00 00  00 00 00 00   |...C............|
  48   00 00 00 00  00 00 02 06  53 69 6e 4f  73 63 02 00   |........SinOsc..|
  64   00 00 02 00  00 00 01 00  00 ff ff ff  ff 00 00 00   |................|
  80   00 ff ff ff  ff 00 00 00  01 02 03 4f  75 74 02 00   |...........Out..|
  96   00 00 02 00  00 00 00 00  00 ff ff ff  ff 00 00 00   |................|
 112   01 00 00 00  00 00 00 00  00 00 00 00  00 00 00 24   |...............$|
 128   2f 73 5f 6e  65 77 00 00  2c 73 69 69  69 00 00 00   |/s_new..,siii...|
 144   74 65 73 74  00 00 00 00  00 00 03 e9  00 00 00 00   |test............|
 160   00 00 00 01                                          |....|