BufferProxy

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.BufferProxy.BufferProxy" [URL="../api/supriya/realtime/BufferProxy.html#supriya.realtime.BufferProxy.BufferProxy", color=black, fontcolor=white, label="Buffer\nProxy", target=_top]; } 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]; "supriya.system.SupriyaValueObject.SupriyaValueObject" [URL="../api/supriya/realtime/../system/SupriyaValueObject.html#supriya.system.SupriyaValueObject.SupriyaValueObject", label="Supriya\nValue\nObject", target=_top]; "supriya.system.SupriyaObject.SupriyaObject" -> "supriya.system.SupriyaValueObject.SupriyaValueObject"; } "builtins.object" -> "supriya.system.SupriyaObject.SupriyaObject"; "supriya.system.SupriyaValueObject.SupriyaValueObject" -> "supriya.realtime.BufferProxy.BufferProxy"; }

class supriya.realtime.BufferProxy.BufferProxy(buffer_id=None, channel_count=0, frame_count=0, sample_rate=0, server=None)[source]

A buffer proxy.

Acts as a singleton reference to a buffer on the server, tracking the state of a single buffer id and responding to /b_info messages. Multiple Buffer instances reference a single BufferProxy.

BufferProxy instances are created internally by the server, and should be treated as an implementation detail.

>>> server = supriya.realtime.Server()
>>> buffer_proxy = supriya.realtime.BufferProxy(
...     buffer_id=0,
...     server=server,
...     channel_count=2,
...     frame_count=441,
...     sample_rate=44100,
...     )
>>> buffer_proxy
BufferProxy(
    buffer_id=0,
    channel_count=2,
    frame_count=441,
    sample_rate=44100,
    server=<Server: offline>,
    )

Attributes Summary

__float__ Gets float representation of buffer proxy.
__int__ Gets integer representation of buffer proxy.
buffer_id Gets buffer id of buffer proxy.
channel_count Gets channel count of buffer proxy.
duration_in_seconds Gets duration in seconds of buffer proxy.
frame_count Gets frame count of buffer proxy.
sample_count Gets sample count of buffer proxy.
sample_rate Gets sample-rate of buffer proxy.
server Gets server of buffer proxy.

Special methods

(SupriyaValueObject).__copy__(*args)
(SupriyaValueObject).__eq__(expr)

Return self==value.

__float__()[source]

Gets float representation of buffer proxy.

>>> server = supriya.realtime.Server()
>>> buffer_proxy = supriya.realtime.BufferProxy(
...     buffer_id=0,
...     server=server,
...     channel_count=2,
...     frame_count=441,
...     sample_rate=44100,
...     )
>>> float(buffer_proxy)
0.0

Returns float.

(SupriyaValueObject).__hash__()

Return hash(self).

__int__()[source]

Gets integer representation of buffer proxy.

>>> server = supriya.realtime.Server()
>>> buffer_proxy = supriya.realtime.BufferProxy(
...     buffer_id=0,
...     server=server,
...     channel_count=2,
...     frame_count=441,
...     sample_rate=44100,
...     )
>>> int(buffer_proxy)
0

Returns integer.

(SupriyaObject).__repr__()

Return repr(self).


Read-only properties

buffer_id

Gets buffer id of buffer proxy.

>>> server = supriya.realtime.Server()
>>> buffer_proxy = supriya.realtime.BufferProxy(
...     buffer_id=0,
...     server=server,
...     channel_count=2,
...     frame_count=441,
...     sample_rate=44100,
...     )
>>> buffer_proxy.buffer_id
0

Returns integer.

channel_count

Gets channel count of buffer proxy.

>>> server = supriya.realtime.Server()
>>> buffer_proxy = supriya.realtime.BufferProxy(
...     buffer_id=0,
...     server=server,
...     channel_count=2,
...     frame_count=441,
...     sample_rate=44100,
...     )
>>> buffer_proxy.channel_count
2

Returns integer.

duration_in_seconds

Gets duration in seconds of buffer proxy.

>>> server = supriya.realtime.Server()
>>> buffer_proxy = supriya.realtime.BufferProxy(
...     buffer_id=0,
...     server=server,
...     channel_count=2,
...     frame_count=441,
...     sample_rate=44100,
...     )
>>> buffer_proxy.duration_in_seconds
0.01

Returns float.

frame_count

Gets frame count of buffer proxy.

>>> server = supriya.realtime.Server()
>>> buffer_proxy = supriya.realtime.BufferProxy(
...     buffer_id=0,
...     server=server,
...     channel_count=2,
...     frame_count=441,
...     sample_rate=44100,
...     )
>>> buffer_proxy.frame_count
441

Returns integer.

sample_count

Gets sample count of buffer proxy.

>>> server = supriya.realtime.Server()
>>> buffer_proxy = supriya.realtime.BufferProxy(
...     buffer_id=0,
...     server=server,
...     channel_count=2,
...     frame_count=441,
...     sample_rate=44100,
...     )
>>> buffer_proxy.sample_count
882

Returns integer.

sample_rate

Gets sample-rate of buffer proxy.

>>> server = supriya.realtime.Server()
>>> buffer_proxy = supriya.realtime.BufferProxy(
...     buffer_id=0,
...     server=server,
...     channel_count=2,
...     frame_count=441,
...     sample_rate=44100,
...     )
>>> buffer_proxy.sample_rate
44100

Returns integer.

server

Gets server of buffer proxy.

>>> server = supriya.realtime.Server()
>>> buffer_proxy = supriya.realtime.BufferProxy(
...     buffer_id=0,
...     server=server,
...     channel_count=2,
...     frame_count=441,
...     sample_rate=44100,
...     )
>>> buffer_proxy.server
<Server: offline>

Returns server.