SAF
Loading...
Searching...
No Matches
decorrelator.c File Reference

A multi-channel decorrelator. More...

Go to the source code of this file.

Functions

void decorrelator_create (void **const phDecor)
 Creates an instance of decorrelator.
 
void decorrelator_destroy (void **const phDecor)
 Destroys an instance of decorrelator.
 
void decorrelator_init (void *const hDecor, int sampleRate)
 Initialises decorrelator with default settings, and samplerate.
 
void decorrelator_initCodec (void *const hDecor)
 Intialises the codec variables, based on current global/user parameters.
 
void decorrelator_process (void *const hDecor, const float *const *inputs, float *const *const outputs, int nInputs, int nOutputs, int nSamples)
 Decorrelates the input signals.
 
void decorrelator_refreshParams (void *const hDecor)
 Sets intialisation flags to 1, so as to re-initialise all settings/variables (as decorrelator is currently configured), at next available opportunity.
 
void decorrelator_setNumberOfChannels (void *const hDecor, int newValue)
 Sets the number of input/output channels.
 
void decorrelator_setDecorrelationAmount (void *const hDecor, float newValue)
 Sets the decorrelation amount [0..1].
 
void decorrelator_setLevelCompensationFlag (void *const hDecor, int newValue)
 Sets whether to apply level compensation (0 or 1)
 
void decorrelator_setTransientBypassFlag (void *const hDecor, int newValue)
 Sets whether to bypass decorrelating the transients (0 or 1)
 
int decorrelator_getFrameSize (void)
 Returns the processing framesize (i.e., number of samples processed with every _process() call )
 
CODEC_STATUS decorrelator_getCodecStatus (void *const hDecor)
 Returns current codec status, see CODEC_STATUS enum.
 
float decorrelator_getProgressBar0_1 (void *const hDecor)
 (Optional) Returns current intialisation/processing progress, between 0..1
 
void decorrelator_getProgressBarText (void *const hDecor, char *text)
 (Optional) Returns current intialisation/processing progress text
 
int decorrelator_getNumberOfChannels (void *const hDecor)
 Returns the number of input/output channels.
 
float decorrelator_getDecorrelationAmount (void *const hDecor)
 Returns the decorrelation amount [0..1].
 
int decorrelator_getLevelCompensationFlag (void *const hDecor)
 Returns whether to apply level compensation (0 or 1)
 
int decorrelator_getTransientBypassFlag (void *const hDecor)
 Returns whether to bypass decorrelating the transients (0 or 1)
 
int decorrelator_getDAWsamplerate (void *const hDecor)
 Returns the DAW/Host sample rate.
 
int decorrelator_getProcessingDelay ()
 Returns the processing delay in samples (may be used for delay compensation features)
 

Detailed Description

A multi-channel decorrelator.

Author
Leo McCormack
Date
07.07.2020
License
ISC

Definition in file decorrelator.c.

Function Documentation

◆ decorrelator_create()

void decorrelator_create ( void **const phDecor)

Creates an instance of decorrelator.

Parameters
[in]phDecor(&) address of decorrelator handle

Definition at line 28 of file decorrelator.c.

◆ decorrelator_destroy()

void decorrelator_destroy ( void **const phDecor)

Destroys an instance of decorrelator.

Parameters
[in]phDecor(&) address of decorrelator handle

Definition at line 64 of file decorrelator.c.

◆ decorrelator_getCodecStatus()

CODEC_STATUS decorrelator_getCodecStatus ( void *const hDecor)

Returns current codec status, see CODEC_STATUS enum.

Definition at line 285 of file decorrelator.c.

◆ decorrelator_getDAWsamplerate()

int decorrelator_getDAWsamplerate ( void *const hDecor)

Returns the DAW/Host sample rate.

Definition at line 327 of file decorrelator.c.

◆ decorrelator_getDecorrelationAmount()

float decorrelator_getDecorrelationAmount ( void *const hDecor)

Returns the decorrelation amount [0..1].

Definition at line 309 of file decorrelator.c.

◆ decorrelator_getFrameSize()

int decorrelator_getFrameSize ( void )

Returns the processing framesize (i.e., number of samples processed with every _process() call )

Definition at line 280 of file decorrelator.c.

◆ decorrelator_getLevelCompensationFlag()

int decorrelator_getLevelCompensationFlag ( void *const hDecor)

Returns whether to apply level compensation (0 or 1)

Definition at line 315 of file decorrelator.c.

◆ decorrelator_getNumberOfChannels()

int decorrelator_getNumberOfChannels ( void *const hDecor)

Returns the number of input/output channels.

Definition at line 303 of file decorrelator.c.

◆ decorrelator_getProcessingDelay()

int decorrelator_getProcessingDelay ( void )

Returns the processing delay in samples (may be used for delay compensation features)

Definition at line 333 of file decorrelator.c.

◆ decorrelator_getProgressBar0_1()

float decorrelator_getProgressBar0_1 ( void *const hDecor)

(Optional) Returns current intialisation/processing progress, between 0..1

Definition at line 291 of file decorrelator.c.

◆ decorrelator_getProgressBarText()

void decorrelator_getProgressBarText ( void *const hDecor,
char * text )

(Optional) Returns current intialisation/processing progress text

Note
"text" string should be (at least) of length: PROGRESSBARTEXT_CHAR_LENGTH

Definition at line 297 of file decorrelator.c.

◆ decorrelator_getTransientBypassFlag()

int decorrelator_getTransientBypassFlag ( void *const hDecor)

Returns whether to bypass decorrelating the transients (0 or 1)

Definition at line 321 of file decorrelator.c.

◆ decorrelator_init()

void decorrelator_init ( void *const hDecor,
int samplerate )

Initialises decorrelator with default settings, and samplerate.

Warning
This should not be called while _process() is on-going!
Parameters
[in]hDecordecorrelator handle
[in]sampleratehost samplerate.

Definition at line 97 of file decorrelator.c.

◆ decorrelator_initCodec()

void decorrelator_initCodec ( void *const hDecor)

Intialises the codec variables, based on current global/user parameters.

Note
This function is fully threadsafe. It can even be called periodically via a timer on one thread, while calling _process() on another thread. Since, if a set function is called (that warrants a re-init), then a flag is triggered internally and the next time this function is called, it will wait until the current process() function has completed before reinitialising the relevant parameters. If the _initCodec() takes longer than the time it takes for process() to be called again, then process() is simply bypassed until the codec is ready.
This function does nothing if no re-initialisations are required.
Parameters
[in]hDecordecorrelator handle

Definition at line 112 of file decorrelator.c.

◆ decorrelator_process()

void decorrelator_process ( void *const hDecor,
const float *const * inputs,
float *const * outputs,
int nInputs,
int nOutputs,
int nSamples )

Decorrelates the input signals.

Parameters
[in]hDecordecorrelator handle
[in]inputsInput channel buffers; 2-D array: nInputs x nSamples
[in]outputsOutput channel buffers; 2-D array: nOutputs x nSamples
[in]nInputsNumber of input channels
[in]nOutputsNumber of output channels
[in]nSamplesNumber of samples in 'inputs'/'output' matrices

Definition at line 161 of file decorrelator.c.

◆ decorrelator_refreshParams()

void decorrelator_refreshParams ( void *const hDecor)

Sets intialisation flags to 1, so as to re-initialise all settings/variables (as decorrelator is currently configured), at next available opportunity.

Definition at line 243 of file decorrelator.c.

◆ decorrelator_setDecorrelationAmount()

void decorrelator_setDecorrelationAmount ( void *const hDecor,
float newValue )

Sets the decorrelation amount [0..1].

Definition at line 258 of file decorrelator.c.

◆ decorrelator_setLevelCompensationFlag()

void decorrelator_setLevelCompensationFlag ( void *const hDecor,
int newValue )

Sets whether to apply level compensation (0 or 1)

Definition at line 264 of file decorrelator.c.

◆ decorrelator_setNumberOfChannels()

void decorrelator_setNumberOfChannels ( void *const hDecor,
int newValue )

Sets the number of input/output channels.

Definition at line 248 of file decorrelator.c.

◆ decorrelator_setTransientBypassFlag()

void decorrelator_setTransientBypassFlag ( void *const hDecor,
int newValue )

Sets whether to bypass decorrelating the transients (0 or 1)

Definition at line 271 of file decorrelator.c.