SAF
Loading...
Searching...
No Matches
pitch_shifter_internal.h
Go to the documentation of this file.
1/*
2 * Copyright 2020 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
26#ifndef __PITCH_SHIFTER_INTERNAL_H_INCLUDED__
27#define __PITCH_SHIFTER_INTERNAL_H_INCLUDED__
28
29#include "pitch_shifter.h" /* Include header for this example */
30#include "saf.h" /* Main include header for SAF */
31#include "saf_externals.h" /* To also include SAF dependencies (cblas etc.) */
32
33#ifdef __cplusplus
34extern "C" {
35#endif /* __cplusplus */
36
37/* ========================================================================== */
38/* Internal Parameters */
39/* ========================================================================== */
40
41#if !defined(PITCH_SHIFTER_FRAME_SIZE)
42# if defined(FRAME_SIZE) /* Use the global framesize if it is specified: */
43# define PITCH_SHIFTER_FRAME_SIZE ( FRAME_SIZE )
44# else /* Otherwise, the default framesize for this example is: */
45# define PITCH_SHIFTER_FRAME_SIZE ( 128 )
46# endif
47#endif
48
49/* ========================================================================== */
50/* Structures */
51/* ========================================================================== */
52
81
82
83/* ========================================================================== */
84/* Internal Functions */
85/* ========================================================================== */
86
88void pitch_shifter_setCodecStatus(void* const hPS,
89 CODEC_STATUS newStatus);
90
91
92#ifdef __cplusplus
93} /* extern "C" { */
94#endif /* __cplusplus */
95
96#endif /* __PITCH_SHIFTER_INTERNAL_H_INCLUDED__ */
#define MAX_NUM_CHANNELS
Maximum number of input/output channels supported.
Definition _common.h:230
PROC_STATUS
Current status of the processing loop.
Definition _common.h:219
CODEC_STATUS
Current status of the codec.
Definition _common.h:201
A very basic multichannel pitch shifter.
PITCH_SHIFTER_FFTSIZE_OPTIONS
Available FFT size options.
PITCH_SHIFTER_OSAMP_OPTIONS
Available oversampling options.
#define PITCH_SHIFTER_FRAME_SIZE
Framesize, in time-domain samples.
void pitch_shifter_setCodecStatus(void *const hPS, CODEC_STATUS newStatus)
Sets codec status (see CODEC_STATUS enum)
Main include header for the Spatial_Audio_Framework (SAF)
Include header for SAF externals.
Main struct for the pitch_shifter.
float pitchShift_factor
1: no shift, 0.5: down one octave, 2: up one octave
float ** inFIFO
Input FIFO buffer.
char * progressBarText
Current (re)initialisation step, string.
int new_nChannels
(current value will be replaced by this after next re-init)
float progressBar0_1
Current (re)initialisation progress, between [0..1].
int FIFO_idx
FIFO buffer index.
int stepsize
Hop size in samples.
void * hSmb
pitch-shifter handle
float ** outFIFO
Output FIFO buffer.
PITCH_SHIFTER_OSAMP_OPTIONS osamp_option
see PITCH_SHIFTER_OSAMP_OPTIONS
PROC_STATUS procStatus
see PROC_STATUS
float sampleRate
Host sampling rate, in Hz.
int nChannels
Current number of input/output channels.
PITCH_SHIFTER_FFTSIZE_OPTIONS fftsize_option
see PITCH_SHIFTER_FFTSIZE_OPTIONS
CODEC_STATUS codecStatus
see CODEC_STATUS