Vital
Loading...
Searching...
No Matches
vital::Output Struct Reference

Holds and manages a buffer of samples (poly_float) for a Processor's output. More...

#include <processor.h>

Inheritance diagram for vital::Output:
vital::cr::Output

Public Member Functions

 Output (int size=kMaxBufferSize, int max_oversample=1)
 Constructs an Output with a specified buffer size and oversampling factor.
 
virtual ~Output ()
 Virtual destructor.
 
force_inline void trigger (poly_mask mask, poly_float value, poly_int offset)
 Sets trigger values (mask, trigger value, and offset).
 
force_inline void clearTrigger ()
 Clears the trigger mask, value, and offset.
 
void clearBuffer ()
 Zeros out the entire output buffer.
 
force_inline bool isControlRate () const
 Checks whether this output runs at control rate (buffer_size == 1).
 
void ensureBufferSize (int new_max_buffer_size)
 Ensures the buffer is large enough to hold new_max_buffer_size samples. This will reallocate if necessary (unless already control rate).
 

Public Attributes

poly_floatbuffer
 Pointer to the output buffer.
 
std::unique_ptr< poly_float[]> owned_buffer
 Owned memory for the output buffer.
 
Processorowner
 Owning processor.
 
int buffer_size
 Current buffer size in samples.
 
poly_mask trigger_mask
 Mask for triggered voices.
 
poly_float trigger_value
 Trigger values for voices.
 
poly_int trigger_offset
 Sample offset (per voice) for triggers.
 

Detailed Description

Holds and manages a buffer of samples (poly_float) for a Processor's output.

This class also tracks trigger information such as trigger mask, value, and offset. It can run at audio or control rates, depending on buffer_size.

Constructor & Destructor Documentation

◆ Output()

vital::Output::Output ( int size = kMaxBufferSize,
int max_oversample = 1 )
inline

Constructs an Output with a specified buffer size and oversampling factor.

Parameters
sizeThe base number of samples in the buffer (e.g., kMaxBufferSize).
max_oversampleMaximum oversample factor to allocate for.

◆ ~Output()

virtual vital::Output::~Output ( )
inlinevirtual

Virtual destructor.

Member Function Documentation

◆ clearBuffer()

void vital::Output::clearBuffer ( )
inline

Zeros out the entire output buffer.

◆ clearTrigger()

force_inline void vital::Output::clearTrigger ( )
inline

Clears the trigger mask, value, and offset.

◆ ensureBufferSize()

void vital::Output::ensureBufferSize ( int new_max_buffer_size)
inline

Ensures the buffer is large enough to hold new_max_buffer_size samples. This will reallocate if necessary (unless already control rate).

Parameters
new_max_buffer_sizeThe requested new buffer size.

◆ isControlRate()

force_inline bool vital::Output::isControlRate ( ) const
inline

Checks whether this output runs at control rate (buffer_size == 1).

Returns
True if control rate, false if audio rate.

◆ trigger()

force_inline void vital::Output::trigger ( poly_mask mask,
poly_float value,
poly_int offset )
inline

Sets trigger values (mask, trigger value, and offset).

Parameters
maskThe trigger mask that indicates which voices are triggering.
valueThe trigger value for those triggered voices.
offsetThe sample offset at which the trigger occurs.

Member Data Documentation

◆ buffer

poly_float* vital::Output::buffer

Pointer to the output buffer.

◆ buffer_size

int vital::Output::buffer_size

Current buffer size in samples.

◆ owned_buffer

std::unique_ptr<poly_float[]> vital::Output::owned_buffer

Owned memory for the output buffer.

◆ owner

Processor* vital::Output::owner

Owning processor.

◆ trigger_mask

poly_mask vital::Output::trigger_mask

Mask for triggered voices.

◆ trigger_offset

poly_int vital::Output::trigger_offset

Sample offset (per voice) for triggers.

◆ trigger_value

poly_float vital::Output::trigger_value

Trigger values for voices.


The documentation for this struct was generated from the following file: