BufferGroup

class supriya.tools.servertools.BufferGroup(buffer_count=1)[source]

A buffer group.

>>> server = servertools.Server().boot()
>>> buffer_group = servertools.BufferGroup(buffer_count=4)
>>> buffer_group
<BufferGroup: {4} @ None>
>>> buffer_group.allocate(
...     frame_count=8192,
...     server=server,
...     sync=True,
...     )
<BufferGroup: {4} @ 0>
>>> buffer_group
<BufferGroup: {4} @ 0>
>>> buffer_group.free()

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_servertools { graph [label=servertools]; "supriya.tools.servertools.BufferGroup.BufferGroup" [color=black, fontcolor=white, group=1, label=<<B>BufferGroup</B>>, shape=box, style="filled, rounded"]; "supriya.tools.servertools.ServerObjectProxy.ServerObjectProxy" [color=2, group=1, label=ServerObjectProxy, shape=oval, style=bold]; "supriya.tools.servertools.ServerObjectProxy.ServerObjectProxy" -> "supriya.tools.servertools.BufferGroup.BufferGroup"; } 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.servertools.ServerObjectProxy.ServerObjectProxy"; }

Bases

Attribute summary

allocate([channel_count, frame_count, ...]) Allocates buffer group.
buffer_id Gets initial buffer id.
buffers Gets associated buffers.
free() Frees all buffers in buffer group.
from_file_paths(file_paths[, server]) Create a buffer group from file_paths.
index(item)
is_allocated Is true when buffer group is allocated.
server
zero() Analogous to SuperCollider’s Buffer.zero.
__contains__(item)
__eq__(expr) Is true when ID of expr equals ID of Supriya object.
__float__()
__format__([format_specification]) Formats Supriya object.
__getitem__(index) Gets buffer at index.
__hash__() Hashes Supriya object.
__int__()
__iter__()
__len__() Gets length of buffer group.
__repr__() Gets interpreter representation of buffer group.

Read-only properties

BufferGroup.buffer_id

Gets initial buffer id.

Returns integer or none.

BufferGroup.buffers

Gets associated buffers.

Returns tuple or buffers.

BufferGroup.is_allocated

Is true when buffer group is allocated. Otherwise false.

Returns boolean.

(ServerObjectProxy).server

Methods

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

Allocates buffer group.

Returns buffer group.

BufferGroup.free()[source]

Frees all buffers in buffer group.

Returns none.

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

Analogous to SuperCollider’s Buffer.zero.

Class & static methods

static BufferGroup.from_file_paths(file_paths, server=None)[source]

Create a buffer group from file_paths.

>>> file_paths = Assets['*mono_1s*']
>>> len(file_paths)
4
>>> 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.

Special methods

BufferGroup.__contains__(item)[source]
(SupriyaObject).__eq__(expr)

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

Returns boolean.

BufferGroup.__float__()[source]
(SupriyaObject).__format__(format_specification='')

Formats Supriya object.

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

Returns string.

BufferGroup.__getitem__(index)[source]

Gets buffer at index.

Returns buffer.

(SupriyaObject).__hash__()

Hashes Supriya object.

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

Returns integer.

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

Gets length of buffer group.

Returns integer.

BufferGroup.__repr__()[source]

Gets interpreter representation of buffer group.

Returns string.