SAF
Loading...
Searching...
No Matches
matrixconv.h
Go to the documentation of this file.
1/*
2 * Copyright 2019 Leo McCormack
3 *
4 * Permission to use, copy, modify, and/or distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
7 *
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
9 * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
10 * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
11 * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
12 * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
13 * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14 * PERFORMANCE OF THIS SOFTWARE.
15 */
16
35#ifndef __MATRIXCONV_H_INCLUDED__
36#define __MATRIXCONV_H_INCLUDED__
37
38#include "_common.h"
39
40#ifdef __cplusplus
41extern "C" {
42#endif /* __cplusplus */
43
44/* ========================================================================== */
45/* Main Functions */
46/* ========================================================================== */
47
53void matrixconv_create(void** const phMCnv);
54
60void matrixconv_destroy(void** const phMCnv);
61
69void matrixconv_init(void* const hMCnv,
70 int samplerate,
71 int hostBlockSize);
72
83void matrixconv_process(void* const hMCnv,
84 const float *const * inputs,
85 float* const* const outputs,
86 int nInputs,
87 int nOutputs,
88 int nSamples);
89
90
91/* ========================================================================== */
92/* Set Functions */
93/* ========================================================================== */
94
99void matrixconv_refreshParams(void* const hMCnv);
100
104void matrixconv_checkReInit(void* const hMCnv);
105
124void matrixconv_setFilters(void* const hMCnv,
125 const float* const* H,
126 int numChannels,
127 int numSamples,
128 int sampleRate);
129
131void matrixconv_setEnablePart(void* const hMCnv, int newState);
132
141void matrixconv_setNumInputChannels(void* const hMCnv, int newValue);
142
143
144/* ========================================================================== */
145/* Get Functions */
146/* ========================================================================== */
147
153
158int matrixconv_getEnablePart(void* const hMCnv);
159
161int matrixconv_getNumInputChannels(void* const hMCnv);
162
167int matrixconv_getNumOutputChannels(void* const hMCnv);
168
170int matrixconv_getHostBlockSize(void* const hMCnv);
171
176int matrixconv_getNfilters(void* const hMCnv);
177
179int matrixconv_getFilterLength(void* const hMCnv);
180
182int matrixconv_getFilterFs(void* const hMCnv);
183
185int matrixconv_getHostFs(void* const hMCnv);
186
191int matrixconv_getProcessingDelay(void* const hMCnv);
192
193
194#ifdef __cplusplus
195} /* extern "C" { */
196#endif /* __cplusplus */
197
198#endif /* __MATRIXCONV_H_INCLUDED__ */
A bunch of things that are common to many of the saf examples.
int matrixconv_getNumOutputChannels(void *const hMCnv)
Returns the number of output channels (the same as the number of channels in the loaded wav file)
Definition matrixconv.c:278
void matrixconv_create(void **const phMCnv)
Creates an instance of matrixconv.
Definition matrixconv.c:29
void matrixconv_setNumInputChannels(void *const hMCnv, int newValue)
Sets the number of input channels.
Definition matrixconv.c:251
void matrixconv_destroy(void **const phMCnv)
Destroys an instance of matrixconv.
Definition matrixconv.c:61
void matrixconv_process(void *const hMCnv, const float *const *inputs, float *const *const outputs, int nInputs, int nOutputs, int nSamples)
Performs the matrix convolution processing.
Definition matrixconv.c:101
void matrixconv_init(void *const hMCnv, int samplerate, int hostBlockSize)
Initialises an instance of matrixconv with default settings.
Definition matrixconv.c:81
int matrixconv_getProcessingDelay(void *const hMCnv)
Returns the processing delay in samples (may be used for delay compensation features)
Definition matrixconv.c:314
int matrixconv_getHostFs(void *const hMCnv)
Returns the samperate of the host.
Definition matrixconv.c:308
void matrixconv_setEnablePart(void *const hMCnv, int newState)
Enable (1), disable (0), partitioned convolution.
Definition matrixconv.c:242
int matrixconv_getNfilters(void *const hMCnv)
Returns the number of filters in the loaded wav file (number of outputs multiplied by the number of i...
Definition matrixconv.c:290
int matrixconv_getFilterFs(void *const hMCnv)
Returns the samplerate of the loaded filters.
Definition matrixconv.c:302
int matrixconv_getEnablePart(void *const hMCnv)
Returns a flag indicating whether partitioned convolution is enabled (1) or disabled (0)
Definition matrixconv.c:266
int matrixconv_getHostBlockSize(void *const hMCnv)
Returns the currect host block size.
Definition matrixconv.c:284
void matrixconv_checkReInit(void *const hMCnv)
Checks whether things have to be reinitialised, and does so if it is needed.
Definition matrixconv.c:172
void matrixconv_refreshParams(void *const hMCnv)
Sets all intialisation flags to 1.
Definition matrixconv.c:166
int matrixconv_getFrameSize(void)
Returns the processing framesize (i.e., number of samples processed with every _process() call )
void matrixconv_setFilters(void *const hMCnv, const float *const *H, int numChannels, int numSamples, int sampleRate)
Loads the matrix of filters, which should have the input filters concatenated for each output.
Definition matrixconv.c:210
int matrixconv_getNumInputChannels(void *const hMCnv)
Returns the number input channels.
Definition matrixconv.c:272
int matrixconv_getFilterLength(void *const hMCnv)
Returns the current filter length, in samples.
Definition matrixconv.c:296