A very basic multichannel pitch shifter.
#ifndef __PITCH_SHIFTER_H_INCLUDED__
#define __PITCH_SHIFTER_H_INCLUDED__
#ifdef __cplusplus
extern "C" {
#endif
typedef enum {
PITCH_SHIFTER_FFTSIZE_512 = 1,
PITCH_SHIFTER_FFTSIZE_1024,
PITCH_SHIFTER_FFTSIZE_2048,
PITCH_SHIFTER_FFTSIZE_4096,
PITCH_SHIFTER_FFTSIZE_8192,
PITCH_SHIFTER_FFTSIZE_16384
#define PITCH_SHIFTER_NUM_FFTSIZE_OPTIONS ( 6 )
typedef enum {
PITCH_SHIFTER_OSAMP_2 = 1,
PITCH_SHIFTER_OSAMP_4,
PITCH_SHIFTER_OSAMP_8,
PITCH_SHIFTER_OSAMP_16,
PITCH_SHIFTER_OSAMP_32
#define PITCH_SHIFTER_NUM_OSAMP_OPTIONS ( 5 )
#define PITCH_SHIFTER_MAX_SHIFT_FACTOR ( 2.0f )
#define PITCH_SHIFTER_MIN_SHIFT_FACTOR ( 0.5f )
int samplerate);
const float *const * inputs,
float* const* const outputs,
int nInputs,
int nOutputs,
int nSamples);
#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 pitch_shifter_setOSampOption(void *const hPS, PITCH_SHIFTER_OSAMP_OPTIONS newOption)
Sets the oversampling factor used by the algorithm (see PITCH_SHIFTER_OSAMP_OPTIONS enum)
void pitch_shifter_setPitchShiftFactor(void *const hPS, float newValue)
Sets the pitch shift factor, 1: no change, 2: up one octave, 0.5: down one octave.
void pitch_shifter_getProgressBarText(void *const hPS, char *text)
(Optional) Returns current intialisation/processing progress text
void pitch_shifter_create(void **const phPS)
Creates an instance of pitch_shifter.
PITCH_SHIFTER_FFTSIZE_OPTIONS
Available FFT size options.
int pitch_shifter_getProcessingDelay(void *const hPS)
Returns the processing delay in samples (may be used for delay compensation features)
float pitch_shifter_getProgressBar0_1(void *const hPS)
(Optional) Returns current intialisation/processing progress, between 0..1
PITCH_SHIFTER_OSAMP_OPTIONS
Available oversampling options.
void pitch_shifter_setFFTSizeOption(void *const hPS, PITCH_SHIFTER_FFTSIZE_OPTIONS newOption)
Sets the FFT size used by the algorithm (see PITCH_SHIFTER_FFTSIZE_OPTIONS enum)
void pitch_shifter_destroy(void **const phPS)
Destroys an instance of pitch_shifter.
void pitch_shifter_initCodec(void *const hPS)
Intialises the codec variables, based on current global/user parameters.
CODEC_STATUS pitch_shifter_getCodecStatus(void *const hPS)
Returns current codec status (see CODEC_STATUS enum)
void pitch_shifter_init(void *const hPS, int samplerate)
Initialises an instance of pitch_shifter with default settings.
int pitch_shifter_getNCHrequired(void *const hPS)
Returns the number of channels required by the current configuration.
float pitch_shifter_getPitchShiftFactor(void *const hPS)
Returns the pitch shift factor, 1: no change, 2: up one octave, 0.5: down one octave.
PITCH_SHIFTER_OSAMP_OPTIONS pitch_shifter_getOSampOption(void *const hPS)
Returns the oversampling factor used by the algorithm (see PITCH_SHIFTER_OSAMP_OPTIONS enum)
PITCH_SHIFTER_FFTSIZE_OPTIONS pitch_shifter_getFFTSizeOption(void *const hPS)
Returns the FFT size used by the algorithm (see PITCH_SHIFTER_FFTSIZE_OPTIONS enum)
void pitch_shifter_process(void *const hPS, const float *const *inputs, float *const *const outputs, int nInputs, int nOutputs, int nSamples)
Pitch shifts the input signals.
int pitch_shifter_getFrameSize(void)
Returns the processing framesize (i.e., number of samples processed with every _process() call )
void pitch_shifter_setNumChannels(void *const hPS, int newValue)
Sets the number channels to pitch shift.
void pitch_shifter_refreshParams(void *const hPS)
Sets all intialisation flags to 1; re-initialising all settings/variables as pitch_shifter is current...