Gamma  0.9.5
Generic Synthesis Library
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator
Delay< Tv, Si, Ts > Class Template Reference

Variable length delay-line. More...

#include <Delay.h>

Inheritance diagram for Delay< Tv, Si, Ts >:
ArrayPow2< Tv > ArrayBase< Tv, SizeArrayPow2, gam::Allocator< Tv > > Comb< Tv, Si, Tp, Ts > Delays< Tv, Si, Ts >

List of all members.

Public Member Functions

 Delay ()
 Default constructor. Does not allocate memory.
 Delay (float delay)
 Delay (float maxDelay, float delay)
void delay (float v)
 Set delay length.
void delayUnit (float u)
 Set delay as (0, 1) of buffer size.
void freq (float v)
 Set natural frequency (1/delay())
void ipolType (ipl::Type v)
 Set interpolation type.
void maxDelay (float v)
 Set maximum delay length.
void zero ()
 Sets all elements to zero.
Tv operator() (const Tv &v)
 Returns next filtered value.
Tv operator() () const
 Reads delayed element from buffer.
Tv read (float ago)
 Returns element 'ago' units ago.
void write (const Tv &v)
 Writes element into buffer. Tap is post-incremented.
void writePre (const Tv &v)
 Writes element into buffer. Tap is pre-incremented.
float delay () const
 Get current delay length.
uint32_t delayIndex (uint32_t delay) const
 Get index of delayed element.
float delayUnit () const
 Get unit delay (to max delay)
float freq () const
 Get frequency of delay line.
uint32_t indexBack () const
 Get index of backmost element.
float maxDelay () const
 Get maximum delay length units.
uint32_t fracBits () const
 Returns number of bits in fraction (32 - bits())
float fraction (uint32_t phase) const
 Get floating-point fractional part of fixed-point phase.
uint32_t index (uint32_t phase) const
 Get integer part of fixed-point phase.
uint32_t log2Size () const
 Returns log base-2 of the number of array elements.
uint32_t oneIndex () const
 Returns 32-bit phase increment for one element index.
const Tv & atPhase (uint32_t phase) const
 Get element at truncated fixed-point phase.
void putPhase (uint32_t phase, Tvv)
 Set element at truncated fixed point phase.
Tv & operator[] (uint32_t i)
 Get write reference to element.
const Tv & operator[] (uint32_t i) const
 Get read-only reference to element.
ArrayBaseassign (const Tv &v)
 Sets all elements to value.
ArrayBaseassign (const Tv &v, uint32_t end, uint32_t stride=1, uint32_t start=0)
 Sets linear slice of elements to value.
Tv * elems ()
 Get writable pointer to elements.
const Tv * elems () const
 Get read-only pointer to elements.
uint32_t size () const
 Returns number of elements in array.
void clear ()
 Destroys all elements and frees memory.
void own ()
 Ensures ownership of elements.
bool isSoleOwner () const
 Returns true if we are the sole owner of data internally allocated.
void resize (uint32_t newSize, const Tv &c=Tv())
 Resizes number of elements in array.
void source (ArrayBase< Tv, SizeArrayPow2, gam::Allocator< Tv > > &src)
 Sets source of array elements to another array.
void source (Tv *src, uint32_t size)
 Sets source of array elements to another array.

Static Public Member Functions

static int references (Tv *m)
 Returns number of pointers to memory address being managed.

Detailed Description

template<class Tv = gam::real, template< class > class Si = ipl::Linear, class Ts = Synced>
class gam::Delay< Tv, Si, Ts >

Variable length delay-line.

Template Parameters:
Tvvalue (sample) type
Tpparameter type
Siinterpolation strategy
Tssync type

Constructor & Destructor Documentation

Delay ( float  delay)
Parameters:
[in]delayDelay length The size of the delay buffer will be the smallest possible power of two.
Delay ( float  maxDelay,
float  delay 
)
Parameters:
[in]maxDelayMaximum delay length
[in]delayDelay length The size of the delay buffer will be the smallest possible power of two.

Member Function Documentation

ArrayBase& assign ( const Tv &  v,
uint32_t  end,
uint32_t  stride = 1,
uint32_t  start = 0 
) [inherited]

Sets linear slice of elements to value.

Parameters:
[in]vvalue to be copied as new content
[in]endend index (exclusive)
[in]strideindex stride amount
[in]startstart index (inclusive)
void own ( ) [inherited]

Ensures ownership of elements.

If the array is not already the sole owner, new memory is allocated and the previously referenced array elements are copied.

void resize ( uint32_t  newSize,
const Tv &  c = T() 
) [inherited]

Resizes number of elements in array.

If the new size is less than the old size, then elements are truncated. If the new size is greater than the old size, then the argument value is copied into the additional elements.


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