bufferop~
Apply an expression to a buffer.
Description
Act on buffers using expressions and Max-style apply syntax. Expressions fill (and overwrite) the contents of named buffer objects, while apply operations manipulate the existing contents of them. In expressions, x is a function that goes from 0 - 1 over the duration of the buffer.
Arguments
buffername [symbol]
Sets the buffer that the object will operate on when triggered.
Inlets
trigger [bang]
Sending a bang to the inlet evaluates the expression or apply method and applies it on the buffer specified using the buffername attribute.
Fixed Attributes
These attributes must be set in the object box and determine the behavior of the object at runtime.
apply [symbol]
The apply attribute provides support for Max-style buffer functions and must be declared directly in the object box. These functions operate on the existing contents of a buffer and are destructive operations, meaning they alter the internal contents of the buffer on which they operate. Apply operations are cumulative and any number of them can operate on a given buffer.
The available functions are gain, for scaling the gain of the entire buffer by a certain amount, normalize, for scaling the buffer relative to a peak value (defined using the right inlet), and the windowing functions
, , , , and . All windowing functions support the optional argument, which must be declared as argument after the name of the function. When used, applies the function only to the second half of the buffer.buffername [symbol]
Sets the buffer that the object will operate on when triggered.
expr [symbol]
The expression that will be used to fill the associated buffer. Supports the full rnbo expression language and library of operators. Some extra variables are provided to allow better access to the buffer:
- x = 0 <= x <= 1,
- value = the current value at the position,
- index = current sample index,
- bufsize = buffer size. You can also access the buffer directly via buffer[i].
Dynamic Attributes
These attributes can be modified in the code during execution using the set object
buffer [number] (default: 0)
If multiple buffer names are declared to be used, this sets the currently active buffer using an index [0 based].
channels [list]
If a channel or list of channels is specified, the operation will only work on the specified channels. If none are specified, the operation will affect all channels in the associated buffer.
trigger [bang]
Sending a bang to the inlet evaluates the expression or apply method and applies it on the buffer specified using the buffername attribute.
See Also
Name | Description |
---|---|
buffer~ | |
buffer~ | A data buffer for holding audio (or potentially some other) data. |
multibuffer~ | multibuffer~ |
lookup~ | Index a buffer object using a signal, for waveshaping. |
dim | Output dimensions of a buffer. |
channels | Output channel count of a buffer. |