An arbitrary array panner (HRIRs, microphone array IRs, etc.) with coherent and incoherent spreading modes.
An arbitrary array panner (HRIRs, microphone array IRs, etc.) with coherent and incoherent spreading modes.
#ifndef __SPREADER_H_INCLUDED__
#define __SPREADER_H_INCLUDED__
#ifdef __cplusplus
extern "C" {
#endif
#define SPREADER_MAX_NUM_SOURCES ( 8 )
typedef enum {
int samplerate);
const float *const * inputs,
float* const* outputs,
int nInputs,
int nOutputs,
int nSamples);
int index,
float newAzi_deg);
int index,
float newElev_deg);
int index,
float newSpread_deg);
#ifdef __cplusplus
}
#endif
#endif
A bunch of things that are common to many of the saf examples.
CODEC_STATUS
Current status of the codec.
void spreader_init(void *const hSpr, int samplerate)
Initialises an instance of spreader with default settings.
int spreader_getNumSources(void *const hSpr)
Returns the number of inputs/sources in the current config.
int spreader_getProcessingDelay(void)
Returns the processing delay in samples (may be used for delay compensation purposes)
int spreader_getIRsamplerate(void *const hSpr)
Returns the IR sample rate.
int spreader_getMaxNumSources(void)
Returns the maximum number of input sources supported by spreader.
int spreader_getNDirs(void *const hSpr)
Returns the number of directions in the currently used HRIR set.
float spreader_getIRAzi_deg(void *const hSpr, int index)
Returns the IR/TF azimuth for a given index, in DEGREES.
void spreader_setSourceSpread_deg(void *const hSpr, int index, float newSpread_deg)
Sets the source spread for a specific channel index, in DEGREES.
int * spreader_getDirectionActivePtr(void *const hSpr, int index)
Returns the pointer to a vector describing which directions are currently being used for the spreadin...
void spreader_setSpreadingMode(void *const hSpr, int newMode)
Sets the spreading mode (see SPREADER_PROC_MODES)
float spreader_getSourceElev_deg(void *const hSpr, int index)
Returns the source elevation for a given source index, in DEGREES.
void spreader_create(void **const phSpr)
Creates an instance of the spreader.
int spreader_getFrameSize(void)
Returns the processing framesize (i.e., number of samples processed with every _process() call )
int spreader_getIRlength(void *const hSpr)
Returns the length of IRs in time-domain samples.
int spreader_getDAWsamplerate(void *const hSpr)
Returns the DAW/Host sample rate.
void spreader_initCodec(void *const hSpr)
Intialises the codec variables, based on current global/user parameters.
float spreader_getAveragingCoeff(void *const hSpr)
Returns the averaging coefficient [0..1].
SPREADER_PROC_MODES
Available processing modes.
@ SPREADER_MODE_NAIVE
Simple coherent copies of the input signal(s) areassigned to the spreading areas.
@ SPREADER_MODE_EVD
Basic solution based on an Eigenvalue decomposition.
@ SPREADER_MODE_OM
Optimal mixing solution.
float spreader_getProgressBar0_1(void *const hSpr)
(Optional) Returns current intialisation/processing progress, between 0..1
float spreader_getIRElev_deg(void *const hSpr, int index)
Returns the IR/TF elevation for a given index, in DEGREES.
void spreader_setSofaFilePath(void *const hSpr, const char *path)
Sets the file path for a .sofa file, in order to employ a custom HRIR set for the decoding.
float spreader_getSourceSpread_deg(void *const hSpr, int index)
Returns the source spread for a given source index, in DEGREES.
void spreader_getProgressBarText(void *const hSpr, char *text)
(Optional) Returns current intialisation/processing progress text
int spreader_getNumOutputs(void *const hSpr)
Returns the number of ears possessed by the average homo sapien.
void spreader_setSourceElev_deg(void *const hSpr, int index, float newElev_deg)
Sets the panning elevation for a specific channel index, in DEGREES.
void spreader_setNumSources(void *const hSpr, int new_nSources)
Sets the number of input channels/sources to binauralise.
void spreader_refreshSettings(void *const hSpr)
Sets all intialisation flags to 1; re-initialising all settings/variables as spreader is currently co...
int spreader_getUseDefaultHRIRsflag(void *const hSpr)
Returns the value of a flag used to dictate whether the default HRIRs in the Spatial_Audio_Framework ...
void spreader_setSourceAzi_deg(void *const hSpr, int index, float newAzi_deg)
Sets the panning azimuth for a specific channel index, in DEGREES.
float spreader_getSourceAzi_deg(void *const hSpr, int index)
Returns the source azimuth for a given source index, in DEGREES.
void spreader_destroy(void **const phSpr)
Destroys an instance of the spreader.
int spreader_getSpreadingMode(void *const hSpr)
Returns the spreading mode (see SPREADER_PROC_MODES)
void spreader_setAveragingCoeff(void *const hSpr, float newValue)
Sets the averaging coefficient [0..1].
char * spreader_getSofaFilePath(void *const hSpr)
Returns the file path for a .sofa file.
void spreader_setUseDefaultHRIRsflag(void *const hSpr, int newState)
Sets flag to dictate whether the default HRIRs in the Spatial_Audio_Framework should be used (1),...
CODEC_STATUS spreader_getCodecStatus(void *const hSpr)
Returns current codec status codec status (see CODEC_STATUS enum)
void spreader_process(void *const hSpr, const float *const *inputs, float *const *outputs, int nInputs, int nOutputs, int nSamples)
Spatialises and spreads the input signals in the user specified directions.