BufferGroup

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.BufferGroup.BufferGroup" [URL="../api/supriya/realtime/BufferGroup.html#supriya.realtime.BufferGroup.BufferGroup", color=black, fontcolor=white, label="Buffer\nGroup", 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.BufferGroup.BufferGroup"; } 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.BufferGroup.BufferGroup(buffer_count=1)[source]

A buffer group.

>>> server = supriya.realtime.Server().boot()
>>> buffer_group = supriya.realtime.BufferGroup(buffer_count=4)
>>> buffer_group
<- BufferGroup{4}: ???>
>>> buffer_group.allocate(
...     frame_count=8192,
...     server=server,
...     sync=True,
...     )
<+ BufferGroup{4}: 0>
>>> buffer_group.free()
<- BufferGroup{4}: ???>

Attributes Summary

__contains__
__float__
__getitem__ Gets buffer at index.
__int__
__iter__
__len__ Gets length of buffer group.
__repr__ Gets interpreter representation of buffer group.
allocate Allocates buffer group.
buffer_id Gets initial buffer id.
buffers Gets associated buffers.
free Frees all buffers in buffer group.
from_file_paths Create a buffer group from file_paths.
index
is_allocated Is true when buffer group is allocated.
zero Analogous to SuperCollider’s Buffer.zero.

Special methods

__contains__(item)[source]
__float__()[source]
__getitem__(index)[source]

Gets buffer at index.

Returns buffer.

__int__()[source]
__iter__()[source]
__len__()[source]

Gets length of buffer group.

Returns integer.

__repr__()[source]

Gets interpreter representation of buffer group.

Returns string.


Methods

allocate(channel_count=1, frame_count=None, server=None, sync=True)[source]

Allocates buffer group.

Returns buffer group.

free() → supriya.realtime.BufferGroup.BufferGroup[source]

Frees all buffers in buffer group.

index(item)[source]
zero()[source]

Analogous to SuperCollider’s Buffer.zero.


Class & static methods

static from_file_paths(file_paths, server=None, sync=True)[source]

Create a buffer group from file_paths.

>>> file_paths = Assets['audio/*mono_1s*']
>>> len(file_paths)
4
>>> server = supriya.realtime.Server().boot()
>>> buffer_group = BufferGroup.from_file_paths(file_paths)
>>> for buffer_ in buffer_group:
...     buffer_, buffer_.frame_count
...
(<+ Buffer: 0>, 44100)
(<+ Buffer: 1>, 44100)
(<+ Buffer: 2>, 44100)
(<+ Buffer: 3>, 44100)

Returns buffer group.


Read-only properties

buffer_id

Gets initial buffer id.

Returns integer or none.

buffers

Gets associated buffers.

Returns tuple or buffers.

is_allocated

Is true when buffer group is allocated. Otherwise false.

Returns boolean.