arduino-audio-tools
All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends Modules Pages
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
VariableSpeedRingBuffer180< T > Class Template Reference

Varialbe speed ring buffer where we read with 0 and 180 degree and blend the result to prevent overrun artifacts. See https://github.com/YetAnotherElectronicsChannel/STM32_DSP_PitchShift. More...

#include <PitchShift.h>

Inheritance diagram for VariableSpeedRingBuffer180< T >:
BaseBuffer< T >

Public Member Functions

 VariableSpeedRingBuffer180 (int size=0, float increment=1.0)
 
virtual T * address ()
 returns the address of the start of the physical read buffer
 
virtual int available ()
 provides the number of entries that are available to read
 
virtual int availableForWrite ()
 provides the number of entries that are available to write
 
void clear ()
 same as reset
 
virtual int clearArray (int len)
 Removes the next len entries.
 
bool isEmpty ()
 
virtual bool isFull ()
 checks if the buffer is full
 
virtual float levelPercent ()
 Returns the level of the buffer in %.
 
bool peek (T &result)
 peeks the actual entry from the buffer
 
bool read (T &result)
 reads a single value
 
virtual int readArray (T data[], int len)
 reads multiple values
 
void reset ()
 Reset pointer positions and clear buffer.
 
void resize (int size)
 
void setIncrement (float increment)
 
size_t size ()
 
bool write (T sample)
 write add an entry to the buffer
 
virtual int writeArray (const T data[], int len)
 Fills the buffer data.
 
virtual int writeArrayOverwrite (const T data[], int len)
 Fills the buffer data and overwrites the oldest data if the buffer is full.
 

Protected Member Functions

virtual T pitchRead ()
 pitch shift for a single sample
 
void setWritePos (int pos)
 

Protected Attributes

Vector< T > buffer {0}
 
int buffer_size = 0
 
float cross_fade = 1.0
 
friend NBuffer< T >
 
int overlap = 0
 
float pitch_shift = 0
 
float read_pos_float = 0.0
 
int write_pointer = 0
 
int write_pos = 0
 

Detailed Description

template<typename T>
class audio_tools::VariableSpeedRingBuffer180< T >

Varialbe speed ring buffer where we read with 0 and 180 degree and blend the result to prevent overrun artifacts. See https://github.com/YetAnotherElectronicsChannel/STM32_DSP_PitchShift.

Template Parameters
T

Member Function Documentation

◆ address()

template<typename T >
virtual T * address ( )
inlinevirtual

returns the address of the start of the physical read buffer

Implements BaseBuffer< T >.

◆ available()

template<typename T >
virtual int available ( )
inlinevirtual

provides the number of entries that are available to read

Implements BaseBuffer< T >.

◆ availableForWrite()

template<typename T >
virtual int availableForWrite ( )
inlinevirtual

provides the number of entries that are available to write

Implements BaseBuffer< T >.

◆ clearArray()

template<typename T >
virtual int clearArray ( int  len)
inlinevirtualinherited

Removes the next len entries.

Reimplemented in SingleBuffer< T >, SingleBuffer< int16_t >, and SingleBuffer< uint8_t >.

◆ isFull()

template<typename T >
virtual bool isFull ( )
inlinevirtual

checks if the buffer is full

Reimplemented from BaseBuffer< T >.

◆ peek()

template<typename T >
bool peek ( T &  result)
inlinevirtual

peeks the actual entry from the buffer

Implements BaseBuffer< T >.

◆ read()

template<typename T >
bool read ( T &  result)
inlinevirtual

reads a single value

Implements BaseBuffer< T >.

◆ readArray()

template<typename T >
virtual int readArray ( data[],
int  len 
)
inlinevirtualinherited

◆ reset()

template<typename T >
void reset ( )
inlinevirtual

Reset pointer positions and clear buffer.

Implements BaseBuffer< T >.

◆ size()

template<typename T >
size_t size ( )
inlinevirtual

Implements BaseBuffer< T >.

◆ write()

template<typename T >
bool write ( data)
inlinevirtual

write add an entry to the buffer

Implements BaseBuffer< T >.

◆ writeArray()

template<typename T >
virtual int writeArray ( const T  data[],
int  len 
)
inlinevirtualinherited

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