Functions
tAttackDetection

Detect attacks in an input signal. More...

Functions

void tAttackDetection_init (tAttackDetection *const, int blocksize, int atk, int rel, LEAF *const leaf)
 Initialize a tAttackDetection to the default mempool of a LEAF instance. More...
 
void tAttackDetection_initToPool (tAttackDetection *const, int blocksize, int atk, int rel, tMempool *const)
 Initialize a tAttackDetection to a specified mempool. More...
 
void tAttackDetection_free (tAttackDetection *const)
 Free a tAttackDetection from its mempool. More...
 
void tAttackDetection_setBlocksize (tAttackDetection *const, int size)
 Set expected input blocksize. More...
 
void tAttackDetection_setSamplerate (tAttackDetection *const, int inRate)
 Set attack detection sample rate. More...
 
void tAttackDetection_setAttack (tAttackDetection *const, int inAtk)
 Set attack time and coeff. More...
 
void tAttackDetection_setRelease (tAttackDetection *const, int inRel)
 Set release time and coeff. More...
 
void tAttackDetection_setThreshold (tAttackDetection *const, float thres)
 Set level above which values are identified as attacks. More...
 
int tAttackDetection_detect (tAttackDetection *const, float *in)
 Find the largest transient in input block, return index of attack. More...
 

Detailed Description

Detect attacks in an input signal.

Function Documentation

◆ tAttackDetection_init()

void tAttackDetection_init ( tAttackDetection * const  ,
int  blocksize,
int  atk,
int  rel,
LEAF *const  leaf 
)

Initialize a tAttackDetection to the default mempool of a LEAF instance.

Parameters
detectionA pointer to the tAttackDetection to initialize.
blockSize
attack
release
leafA pointer to the leaf instance.

◆ tAttackDetection_initToPool()

void tAttackDetection_initToPool ( tAttackDetection * const  ,
int  blocksize,
int  atk,
int  rel,
tMempool * const   
)

Initialize a tAttackDetection to a specified mempool.

Parameters
detectionA pointer to the tAttackDetection to initialize.
blockSize
attack
release
mempoolA pointer to the tMempool to use.

◆ tAttackDetection_free()

void tAttackDetection_free ( tAttackDetection * const  )

Free a tAttackDetection from its mempool.

Parameters
detectionA pointer to the tAttackDetection to free.

◆ tAttackDetection_setBlocksize()

void tAttackDetection_setBlocksize ( tAttackDetection * const  ,
int  size 
)

Set expected input blocksize.

Parameters
detectionA pointer to the relevant tAttackDetection.
blockSize

◆ tAttackDetection_setSamplerate()

void tAttackDetection_setSamplerate ( tAttackDetection * const  ,
int  inRate 
)

Set attack detection sample rate.

Parameters
detectionA pointer to the relevant tAttackDetection.
sampleRate

◆ tAttackDetection_setAttack()

void tAttackDetection_setAttack ( tAttackDetection * const  ,
int  inAtk 
)

Set attack time and coeff.

Parameters
detectionA pointer to the relevant tAttackDetection.
attack

◆ tAttackDetection_setRelease()

void tAttackDetection_setRelease ( tAttackDetection * const  ,
int  inRel 
)

Set release time and coeff.

Parameters
detectionA pointer to the relevant tAttackDetection.
release

◆ tAttackDetection_setThreshold()

void tAttackDetection_setThreshold ( tAttackDetection * const  ,
float  thres 
)

Set level above which values are identified as attacks.

Parameters
detectionA pointer to the relevant tAttackDetection.
threshold

◆ tAttackDetection_detect()

int tAttackDetection_detect ( tAttackDetection * const  ,
float *  in 
)

Find the largest transient in input block, return index of attack.

Parameters
detectionA pointer to the relevant tAttackDetection.
inputBlock
Returns
Index of the largest transient in the input.