SAF
|
A very basic multichannel pitch shifter. More...
#include "_common.h"
Go to the source code of this file.
Macros | |
#define | PITCH_SHIFTER_NUM_FFTSIZE_OPTIONS ( 6 ) |
Number of FFT size options. | |
#define | PITCH_SHIFTER_NUM_OSAMP_OPTIONS ( 5 ) |
Number of over-sampling options. | |
#define | PITCH_SHIFTER_MAX_SHIFT_FACTOR ( 2.0f ) |
Maximum pitch shifting factor. | |
#define | PITCH_SHIFTER_MIN_SHIFT_FACTOR ( 0.5f ) |
Minimum pitch shifting factor. | |
Enumerations | |
enum | PITCH_SHIFTER_FFTSIZE_OPTIONS { 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 } |
Available FFT size options. More... | |
enum | PITCH_SHIFTER_OSAMP_OPTIONS { PITCH_SHIFTER_OSAMP_2 = 1 , PITCH_SHIFTER_OSAMP_4 , PITCH_SHIFTER_OSAMP_8 , PITCH_SHIFTER_OSAMP_16 , PITCH_SHIFTER_OSAMP_32 } |
Available oversampling options. More... | |
Functions | |
void | pitch_shifter_create (void **const phPS) |
Creates an instance of pitch_shifter. | |
void | pitch_shifter_destroy (void **const phPS) |
Destroys an instance of pitch_shifter. | |
void | pitch_shifter_init (void *const hPS, int samplerate) |
Initialises an instance of pitch_shifter with default settings. | |
void | pitch_shifter_initCodec (void *const hPS) |
Intialises the codec variables, based on current global/user parameters. | |
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. | |
void | pitch_shifter_refreshParams (void *const hPS) |
Sets all intialisation flags to 1; re-initialising all settings/variables as pitch_shifter is currently configured, at next available opportunity. | |
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_setNumChannels (void *const hPS, int newValue) |
Sets the number channels to pitch shift. | |
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_setOSampOption (void *const hPS, PITCH_SHIFTER_OSAMP_OPTIONS newOption) |
Sets the oversampling factor used by the algorithm (see PITCH_SHIFTER_OSAMP_OPTIONS enum) | |
int | pitch_shifter_getFrameSize (void) |
Returns the processing framesize (i.e., number of samples processed with every _process() call ) | |
CODEC_STATUS | pitch_shifter_getCodecStatus (void *const hPS) |
Returns current codec status (see CODEC_STATUS enum) | |
float | pitch_shifter_getProgressBar0_1 (void *const hPS) |
(Optional) Returns current intialisation/processing progress, between 0..1 | |
void | pitch_shifter_getProgressBarText (void *const hPS, char *text) |
(Optional) Returns current intialisation/processing progress text | |
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_FFTSIZE_OPTIONS | pitch_shifter_getFFTSizeOption (void *const hPS) |
Returns the FFT size used by the algorithm (see PITCH_SHIFTER_FFTSIZE_OPTIONS enum) | |
PITCH_SHIFTER_OSAMP_OPTIONS | pitch_shifter_getOSampOption (void *const hPS) |
Returns the oversampling factor used by the algorithm (see PITCH_SHIFTER_OSAMP_OPTIONS enum) | |
int | pitch_shifter_getNCHrequired (void *const hPS) |
Returns the number of channels required by the current configuration. | |
int | pitch_shifter_getProcessingDelay (void *const hPS) |
Returns the processing delay in samples (may be used for delay compensation features) | |
A very basic multichannel pitch shifter.
Definition in file pitch_shifter.h.
#define PITCH_SHIFTER_MAX_SHIFT_FACTOR ( 2.0f ) |
Maximum pitch shifting factor.
Definition at line 83 of file pitch_shifter.h.
#define PITCH_SHIFTER_MIN_SHIFT_FACTOR ( 0.5f ) |
Minimum pitch shifting factor.
Definition at line 86 of file pitch_shifter.h.
#define PITCH_SHIFTER_NUM_FFTSIZE_OPTIONS ( 6 ) |
Number of FFT size options.
Definition at line 64 of file pitch_shifter.h.
#define PITCH_SHIFTER_NUM_OSAMP_OPTIONS ( 5 ) |
Number of over-sampling options.
Definition at line 80 of file pitch_shifter.h.
Available FFT size options.
The higher it is, the more drastic the pitch shifting factor can be, at the cost of increased latency and cpu requirements
Definition at line 53 of file pitch_shifter.h.
Available oversampling options.
The higher it is, the better the signal fidelity, but at the cost of increased latency and cpu requirements
Definition at line 70 of file pitch_shifter.h.
void pitch_shifter_create | ( | void **const | phPS | ) |
Creates an instance of pitch_shifter.
[in] | phPS | (&) address of pitch_shifter handle |
Definition at line 29 of file pitch_shifter.c.
void pitch_shifter_destroy | ( | void **const | phPS | ) |
Destroys an instance of pitch_shifter.
[in] | phPS | (&) address of pitch_shifter handle |
Definition at line 65 of file pitch_shifter.c.
CODEC_STATUS pitch_shifter_getCodecStatus | ( | void *const | hPS | ) |
Returns current codec status (see CODEC_STATUS enum)
Definition at line 270 of file pitch_shifter.c.
PITCH_SHIFTER_FFTSIZE_OPTIONS pitch_shifter_getFFTSizeOption | ( | void *const | hPS | ) |
Returns the FFT size used by the algorithm (see PITCH_SHIFTER_FFTSIZE_OPTIONS enum)
Definition at line 294 of file pitch_shifter.c.
int pitch_shifter_getFrameSize | ( | void | ) |
Returns the processing framesize (i.e., number of samples processed with every _process() call )
Definition at line 265 of file pitch_shifter.c.
int pitch_shifter_getNCHrequired | ( | void *const | hPS | ) |
Returns the number of channels required by the current configuration.
Definition at line 306 of file pitch_shifter.c.
PITCH_SHIFTER_OSAMP_OPTIONS pitch_shifter_getOSampOption | ( | void *const | hPS | ) |
Returns the oversampling factor used by the algorithm (see PITCH_SHIFTER_OSAMP_OPTIONS enum)
Definition at line 300 of file pitch_shifter.c.
float pitch_shifter_getPitchShiftFactor | ( | void *const | hPS | ) |
Returns the pitch shift factor, 1: no change, 2: up one octave, 0.5: down one octave.
Definition at line 288 of file pitch_shifter.c.
int pitch_shifter_getProcessingDelay | ( | void *const | hPS | ) |
Returns the processing delay in samples (may be used for delay compensation features)
Definition at line 312 of file pitch_shifter.c.
float pitch_shifter_getProgressBar0_1 | ( | void *const | hPS | ) |
(Optional) Returns current intialisation/processing progress, between 0..1
Definition at line 276 of file pitch_shifter.c.
void pitch_shifter_getProgressBarText | ( | void *const | hPS, |
char * | text ) |
(Optional) Returns current intialisation/processing progress text
Definition at line 282 of file pitch_shifter.c.
void pitch_shifter_init | ( | void *const | hPS, |
int | samplerate ) |
Initialises an instance of pitch_shifter with default settings.
[in] | hPS | pitch_shifter handle |
[in] | samplerate | Host samplerate. |
Definition at line 89 of file pitch_shifter.c.
void pitch_shifter_initCodec | ( | void *const | hPS | ) |
Intialises the codec variables, based on current global/user parameters.
[in] | hPS | pitch_shifter handle |
Definition at line 103 of file pitch_shifter.c.
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.
[in] | hPS | pitch_shifter handle |
[in] | inputs | Input channel buffers; 2-D array: nInputs x nSamples |
[in] | outputs | Output channel buffers; 2-D array: nOutputs x nSamples |
[in] | nInputs | Number of input channels |
[in] | nOutputs | Number of output channels |
[in] | nSamples | Number of samples in 'inputs'/'output' matrices |
Definition at line 163 of file pitch_shifter.c.
void pitch_shifter_refreshParams | ( | void *const | hPS | ) |
Sets all intialisation flags to 1; re-initialising all settings/variables as pitch_shifter is currently configured, at next available opportunity.
[in] | hPS | pitch_shifter handle |
Definition at line 222 of file pitch_shifter.c.
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)
Definition at line 240 of file pitch_shifter.c.
void pitch_shifter_setNumChannels | ( | void *const | hPS, |
int | newValue ) |
Sets the number channels to pitch shift.
Definition at line 233 of file pitch_shifter.c.
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)
Definition at line 251 of file pitch_shifter.c.
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.
Definition at line 227 of file pitch_shifter.c.