SAF
Loading...
Searching...
No Matches
multiconv.h

A multi-channel convolver.

A multi-channel convolver

Files

multiconv.h (include), multiconv_internal.h, multiconv.c, multiconv_internal.c

Include Header

/*
* Copyright 2019 Leo McCormack
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
* REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
* INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
* LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
#ifndef __MULTICONV_H_INCLUDED__
#define __MULTICONV_H_INCLUDED__
#include "_common.h"
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/* ========================================================================== */
/* Main Functions */
/* ========================================================================== */
void multiconv_create(void** const phMCnv);
void multiconv_destroy(void** const phMCnv);
void multiconv_init(void* const hMCnv,
int samplerate,
int hostBlockSize);
void multiconv_process(void* const hMCnv,
const float *const * inputs,
float* const* const outputs,
int nInputs,
int nOutputs,
int nSamples);
/* ========================================================================== */
/* Set Functions */
/* ========================================================================== */
void multiconv_refreshParams(void* const hMCnv);
void multiconv_checkReInit(void* const hMCnv);
void multiconv_setFilters(void* const hMCnv,
const float* const* H,
int numChannels,
int numSamples,
int sampleRate);
void multiconv_setEnablePart(void* const hMCnv, int newState);
void multiconv_setNumChannels(void* const hMCnv, int newValue);
/* ========================================================================== */
/* Get Functions */
/* ========================================================================== */
int multiconv_getEnablePart(void* const hMCnv);
int multiconv_getNumChannels(void* const hMCnv);
int multiconv_getHostBlockSize(void* const hMCnv);
int multiconv_getNfilters(void* const hMCnv);
int multiconv_getFilterLength(void* const hMCnv);
int multiconv_getFilterFs(void* const hMCnv);
int multiconv_getHostFs(void* const hMCnv);
int multiconv_getProcessingDelay(void* const hMCnv);
#ifdef __cplusplus
} /* extern "C" { */
#endif /* __cplusplus */
#endif /* __MULTICONV_H_INCLUDED__ */
A bunch of things that are common to many of the saf examples.
int multiconv_getFilterLength(void *const hMCnv)
Returns the current filter length, in samples.
Definition multiconv.c:262
void multiconv_create(void **const phMCnv)
Creates an instance of multiconv.
Definition multiconv.c:29
int multiconv_getNfilters(void *const hMCnv)
Returns the number of filters in the loaded wav file.
Definition multiconv.c:256
int multiconv_getHostBlockSize(void *const hMCnv)
Returns the currect host block size.
Definition multiconv.c:250
int multiconv_getEnablePart(void *const hMCnv)
Returns a flag indicating whether partitioned convolution is enabled (1) or disabled (0)
Definition multiconv.c:238
int multiconv_getFilterFs(void *const hMCnv)
Returns the samplerate of the loaded filters.
Definition multiconv.c:268
void multiconv_init(void *const hMCnv, int samplerate, int hostBlockSize)
Initialises an instance of multiconv with default settings.
Definition multiconv.c:81
int multiconv_getNumChannels(void *const hMCnv)
Returns the number input/output channels.
Definition multiconv.c:244
void multiconv_checkReInit(void *const hMCnv)
Checks whether things have to be reinitialised, and does so if it is needed.
Definition multiconv.c:170
void multiconv_setEnablePart(void *const hMCnv, int newState)
Enable (1), disable (0), partitioned convolution.
Definition multiconv.c:221
void multiconv_setNumChannels(void *const hMCnv, int newValue)
Sets the number of input/output channels.
Definition multiconv.c:230
void multiconv_refreshParams(void *const hMCnv)
Sets all intialisation flags to 1.
Definition multiconv.c:164
int multiconv_getProcessingDelay(void *const hMCnv)
Returns the processing delay in samples (may be used for delay compensation features)
Definition multiconv.c:280
int multiconv_getHostFs(void *const hMCnv)
Returns the samperate of the host.
Definition multiconv.c:274
void multiconv_destroy(void **const phMCnv)
Destroys an instance of multiconv.
Definition multiconv.c:61
void multiconv_process(void *const hMCnv, const float *const *inputs, float *const *const outputs, int nInputs, int nOutputs, int nSamples)
Performs the multuchannel convolution processing.
Definition multiconv.c:101
void multiconv_setFilters(void *const hMCnv, const float *const *H, int numChannels, int numSamples, int sampleRate)
Loads the multichannel of filters.
Definition multiconv.c:201
int multiconv_getFrameSize(void)
Returns the processing framesize (i.e., number of samples processed with every _process() call )