SAF
Loading...
Searching...
No Matches
multiconv.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 __MULTICONV_H_INCLUDED__
36#define __MULTICONV_H_INCLUDED__
37
38#include "_common.h"
39
40#ifdef __cplusplus
41extern "C" {
42#endif /* __cplusplus */
43
44/* ========================================================================== */
45/* Main Functions */
46/* ========================================================================== */
47
53void multiconv_create(void** const phMCnv);
54
60void multiconv_destroy(void** const phMCnv);
61
69void multiconv_init(void* const hMCnv,
70 int samplerate,
71 int hostBlockSize);
72
83void multiconv_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 multiconv_refreshParams(void* const hMCnv);
100
104void multiconv_checkReInit(void* const hMCnv);
105
117void multiconv_setFilters(void* const hMCnv,
118 const float* const* H,
119 int numChannels,
120 int numSamples,
121 int sampleRate);
122
124void multiconv_setEnablePart(void* const hMCnv, int newState);
125
127void multiconv_setNumChannels(void* const hMCnv, int newValue);
128
129
130/* ========================================================================== */
131/* Get Functions */
132/* ========================================================================== */
133
139
144int multiconv_getEnablePart(void* const hMCnv);
145
147int multiconv_getNumChannels(void* const hMCnv);
148
150int multiconv_getHostBlockSize(void* const hMCnv);
151
153int multiconv_getNfilters(void* const hMCnv);
154
156int multiconv_getFilterLength(void* const hMCnv);
157
159int multiconv_getFilterFs(void* const hMCnv);
160
162int multiconv_getHostFs(void* const hMCnv);
163
168int multiconv_getProcessingDelay(void* const hMCnv);
169
170
171#ifdef __cplusplus
172} /* extern "C" { */
173#endif /* __cplusplus */
174
175#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 )