entities¶
-
class Buffer(context: Context, id_: int, completion: Completion | None =
None)¶ Bases:
ContextObjectA buffer.
- Parameters:
- __enter__() Completion¶
Enter the buffer’s allocation completion.
-
__render_memo__(output_file_path: PathLike | None =
None, render_directory_path: PathLike | None =None, **kwargs) SupportsRender¶
-
close(on_completion: Callable[[Context], Any] | None =
None) Completion¶ Close the buffer.
Emit
/b_closerequests.
- copy(*, target_buffer: Buffer, starting_frame: int, target_starting_frame: int, frame_count: int) None¶
Copy the buffer.
Emit
/b_gen <buffer.id_> copy ...requests.
- fill(starting_frame: int, frame_count: int, value: float) None¶
Fill the buffer with a single value.
Emit
/b_fillrequests.
-
free(on_completion: Callable[[Context], Any] | None =
None) Completion¶ Free the buffer.
Emit
/b_freerequests.
-
generate(command_name: 'sine1' | 'sine2' | 'sine3' | 'cheby', amplitudes: Sequence[float], frequencies: Sequence[float] | None =
None, phases: Sequence[float] | None =None, as_wavetable: bool =False, should_clear_first: bool =False, should_normalize: bool =False) None¶ Generate the buffer.
Emit
/b_genrequests.- Parameters:
- command_name: 'sine1' | 'sine2' | 'sine3' | 'cheby'¶
The generation command name.
- amplitudes: Sequence[float]¶
A sequence of partial amplitudes.
- frequencies: Sequence[float] | None =
None¶ A sequence of partial frequencies.
- phases: Sequence[float] | None =
None¶ A sequence of partial phases.
- as_wavetable: bool =
False¶ Flag for generating the output in wavetable format.
- should_clear_first: bool =
False¶ Flag for clearing the buffer before generating.
- should_normalize: bool =
False¶ Flag for normalizing the generated output.
-
get(*indices: int, sync: bool =
True) Awaitable[dict[int, float] | None] | dict[int, float] | None¶ Get a sample.
Emit
/b_getrequests.
-
get_range(index: int, count: int, sync: bool =
True) Awaitable[Sequence[float] | None] | Sequence[float] | None¶ Get a sample range.
Emit
/b_getnrequests.
-
normalize(new_maximum: float =
1.0, as_wavetable: bool =False) None¶ Normalize the buffer.
Emit
/b_gen <buffer.id_> (w)?normalizerequests depending on parameters.
-
query(sync: bool =
True) Awaitable[BufferInfo | None] | BufferInfo | None¶ Query the buffer.
Emit
/b_queryrequests.
-
read(file_path: PathLike, *, buffer_starting_frame: int | None =
None, channel_indices: list[int] | None =None, frame_count: int | None =None, leave_open: bool =False, on_completion: Callable[[Context], Any] | None =None, starting_frame: int | None =None) Completion¶ Read a file into the buffer.
Emit
/b_reador/b_readChannelrequests, depending on parameters.- Parameters:
- file_path: PathLike¶
The file path to read from.
- channel_indices: list[int] | None =
None¶ A list of channel indices to read from when reading from a file.
- frame_count: int | None =
None¶ The number of frames to read.
- leave_open: bool =
False¶ Flag for leaving the file open (e.g. to continue reading via
DiskIn) or close it.- starting_frame: int | None =
None¶ The starting frame in the buffer to begin reading into at.
- on_completion: Callable[[Context], Any] | None =
None¶ A callable with the buffer’s context as the only argument. Permits building an “on completion” argument to this method’s request without an active moment.
-
write(file_path: PathLike, *, frame_count: int | None =
None, header_format: HeaderFormat | SupportsInt | str | None ='aiff', leave_open: bool =False, on_completion: Callable[[Context], Any] | None =None, sample_format: SampleFormat | SupportsInt | str | None ='int24', starting_frame: int | None =None) Completion¶ Write the buffer to disk.
Emit
/b_writerequests.- Parameters:
- file_path: PathLike¶
The file path to write into.
- frame_count: int | None =
None¶ The number of frames to write.
- header_format: HeaderFormat | SupportsInt | str | None =
'aiff'¶ The header format to use, e.g.
AIFForWAVE.- leave_open: bool =
False¶ Flag for leaving the file open (e.g. to continue writing via
DiskOut) or close it.- sample_format: SampleFormat | SupportsInt | str | None =
'int24'¶ The sample format to use, e.g.
INT24orFLOAT.- starting_frame: int | None =
None¶ The starting frame in the buffer to start writing from.
- on_completion: Callable[[Context], Any] | None =
None¶ A callable with the buffer’s context as the only argument. Permits building an “on completion” argument to this method’s request without an active moment.
-
zero(on_completion: Callable[[Context], Any] | None =
None) Completion¶ Zero the buffer.
Emit
/b_zerorequests.
-
class BufferGroup(context: Context, id_: int, count: int =
1)¶ Bases:
ContextObjectA buffer group.
- Parameters:
- class Bus(context: Context, id_: int, calculation_rate: CalculationRate)¶
Bases:
ContextObjectA bus.
- Parameters:
-
fill(count: int, value: float, use_shared_memory: bool =
False) None¶ Fill contiguous buses with a single value, starting with this bus.
Emit
/c_fillrequests.
-
get(sync: bool =
True, use_shared_memory: bool =False) Awaitable[float | None] | float | None¶ Get the control bus’ value.
Emit
/c_getrequests.
-
get_range(count: int, sync: bool =
True, use_shared_memory: bool =False) Awaitable[Sequence[float] | None] | Sequence[float] | None¶ Get a range of control bus values.
Emit
/c_getnrequests.
-
class BusGroup(context: Context, id_: int, calculation_rate: CalculationRate, count: int =
1)¶ Bases:
ContextObjectA bus group.
- Parameters:
-
get(sync: bool =
True, use_shared_memory: bool =False) Awaitable[Sequence[float] | None] | Sequence[float] | None¶ Get the control bus group’s values.
Emit
/c_getnrequests.
- class ContextObject(context: Context, id_: int)¶
Bases:
objectBase class for objects with context references.
- Parameters:
-
class Group(context: Context, id_: int, parallel: bool =
False)¶ Bases:
NodeA group node.
- Parameters:
-
dump_tree(include_controls: bool =
True, sync: bool =True) Awaitable[QueryTreeGroup | None] | QueryTreeGroup | None¶ Dump the group’s node tree.
Emit
/g_dumpTreerequests.
-
free_children(synths_only: bool =
False) None¶ Free the group’s children.
Emit
/g_deepFreeor/g_freeAllrequests depending on parameters.
-
query_tree(include_controls: bool =
True, sync: bool =True) Awaitable[QueryTreeGroup | None] | QueryTreeGroup | None¶ Query the group’s node tree.
Emit
/g_queryTreerequests.
- class Node(context: Context, id_: int)¶
Bases:
ContextObjectA node.
-
add_group(add_action: AddAction | SupportsInt | str | None =
AddAction.ADD_TO_HEAD, parallel: bool =False, permanent: bool =False) Group¶ Add a new group relative to this node.
Emit
/g_newor/p_newrequests depending on parameters.- Parameters:
- add_action: AddAction | SupportsInt | str | None =
AddAction.ADD_TO_HEAD¶ The add action to use when placing the new group.
- parallel: bool =
False¶ Flag for parallel vs non-parallel groups.
- permanent: bool =
False¶ Flag for using a permanent node ID.
- add_action: AddAction | SupportsInt | str | None =
-
add_synth(synthdef: SynthDef, *, add_action: AddAction | SupportsInt | str | None =
AddAction.ADD_TO_HEAD, permanent: bool =False, **settings: SupportsFloat | str | Sequence[SupportsFloat | str]) Synth¶ Add a new synth relative to this node.
Emit
/s_newrequests.- Parameters:
- synthdef: SynthDef¶
The SynthDef to use for the new synth.
- add_action: AddAction | SupportsInt | str | None =
AddAction.ADD_TO_HEAD¶ The add action to use when placing the new synth.
- permanent: bool =
False¶ Flag for using a permanent node ID.
- **settings: SupportsFloat | str | Sequence[SupportsFloat | str]¶
The new synth’s control settings.
-
free(force: bool =
False) None¶ Free the node.
Emit
/n_freefor groups, for synths without agatecontrol, or whenforceisTrue.Emit
/n_set <node.id_> gate 0for synths withgatecontrols.
- map(**settings: Bus | str | None) None¶
Map the node’s controls to buses.
Emit
/n_mapand/n_maparequests.
-
move(target_node: Node, add_action: AddAction | SupportsInt | str | None =
None) None¶ Move the node.
Emit
/n_after,/n_before,/g_headand/g_tailrequests depending on parameters.- Parameters:
- add_action: AddAction | SupportsInt | str | None =
None¶ The add action to use when moving the node.
- target_node: Node¶
The target node to place the node relative to.
- add_action: AddAction | SupportsInt | str | None =
-
order(*nodes: Node, add_action: AddAction | SupportsInt | str | None =
None) None¶ Re-order nodes relative to the node.
Emit
/n_orderrequests.- Parameters:
- *nodes: Node¶
The nodes to re-order.
- add_action: AddAction | SupportsInt | str | None =
None¶ The add action to use when re-ordering the nodes.
-
query(sync: bool =
True) Awaitable[NodeInfo | None] | NodeInfo | None¶ Query the node.
Emit
/n_queryrequests.
- set(*indexed_settings: tuple[int, SupportsFloat | Sequence[SupportsFloat]], **settings: SupportsFloat | Sequence[SupportsFloat]) None¶
Set the node’s controls.
- Parameters:
- *indexed_settings: tuple[int, SupportsFloat | Sequence[SupportsFloat]]¶
A sequence of control indices to values.
- **settings: SupportsFloat | Sequence[SupportsFloat]¶
A mapping of control names to values.
- set_range(*indexed_settings: tuple[int, Sequence[SupportsFloat]], **settings: Sequence[SupportsFloat]) None¶
Set a range of the node’s controls.
- Parameters:
- *indexed_settings: tuple[int, Sequence[SupportsFloat]]¶
A sequence of control indices to values.
- **settings: Sequence[SupportsFloat]¶
A mapping of control names to values.
-
add_group(add_action: AddAction | SupportsInt | str | None =
- class ScopeBuffer(context: Context, id_: int)¶
Bases:
ContextObjectA scope buffer.
For use with the
ScopeOut2UGen for powering shared-memory scopes and spectrograms.- Parameters:
- class Synth(context: Context, id_: int, synthdef: SynthDef)¶
Bases:
NodeA synth node.
- Parameters:
-
get(*controls: int | str, sync: bool =
True) Awaitable[dict[int | str, float] | None] | dict[int | str, float] | None¶ Get a control.
Emit
/s_getrequests.