#include <stdio.h>
#include <string.h>
#include <stdbool.h>
#include <math.h>
#define ods_log1 -2.30258509 |
#define PI 3.1415926535898f |
#define MINUSPI -3.1415926535898f |
#define TWOPI 6.28318530717952646f |
#define INV_TWOPI 0.1591549430919f |
#define ods_abs | ( | a | ) | ((a)<0? -(a) : (a)) |
#define ods_max | ( | a, | |||
b | ) | (((a) > (b)) ? (a) : (b)) |
#define ods_min | ( | a, | |||
b | ) | (((a) < (b)) ? (a) : (b)) |
#define ODS_LOG_LOWER_LIMIT 2e-42 |
#define ODS_LOGOF_LOG_LOWER_LIMIT -96.0154267 |
#define ODS_ABSINVOF_LOGOF_LOG_LOWER_LIMIT 0.010414993 |
enum onsetsds_fft_types |
Types of incoming FFT data format. OnsetsDS needs to know where the FFT data comes from in order to interpret it correctly.
ODS_FFT_SC3_COMPLEX | SuperCollider, cartesian co-ords ("SCComplexBuf") [dc, nyq, real[1], imag[1], real[2], imag[2]...] - NB it's more efficient to provide polar data from SC. |
ODS_FFT_SC3_POLAR | SuperCollider, polar co-ords ("SCPolarBuf") [dc, nyq, mag[1], phase[1], mag[2], phase[2]...]. |
ODS_FFT_FFTW3_HC | FFTW "halfcomplex" format - [dc, real[1], real[2] ... nyq, imag[nyq-1] ... imag[1]]. |
ODS_FFT_FFTW3_R2C | FFTW regular format, typically produced using real-to-complex transform. |
ODS_FFT_SC3_COMPLEX | SuperCollider, cartesian co-ords ("SCComplexBuf") [dc, nyq, real[1], imag[1], real[2], imag[2]...] - NB it's more efficient to provide polar data from SC. |
ODS_FFT_SC3_POLAR | SuperCollider, polar co-ords ("SCPolarBuf") [dc, nyq, mag[1], phase[1], mag[2], phase[2]...]. |
ODS_FFT_FFTW3_HC | FFTW "halfcomplex" format - [dc, real[1], real[2] ... nyq, imag[nyq-1] ... imag[1]]. |
ODS_FFT_FFTW3_R2C | FFTW regular format, typically produced using real-to-complex transform. |
enum onsetsds_odf_types |
Types of onset detection function
enum onsetsds_wh_types |
Types of whitening - may not all be implemented yet.
ODS_WH_NONE | No whitening - onsetsds_whiten() becomes a no-op. |
ODS_WH_ADAPT_MAX1 | Adaptive whitening - tracks recent-peak-magnitude in each bin, normalises that to 1. |
ODS_WH_NORMMAX | Simple normalisation - each frame is normalised (independent of others) so largest magnitude becomes 1. Not implemented. |
ODS_WH_NORMMEAN | Simple normalisation - each frame is normalised (independent of others) so mean magnitude becomes 1. Not implemented. |
ODS_WH_NONE | No whitening - onsetsds_whiten() becomes a no-op. |
ODS_WH_ADAPT_MAX1 | Adaptive whitening - tracks recent-peak-magnitude in each bin, normalises that to 1. |
ODS_WH_NORMMAX | Simple normalisation - each frame is normalised (independent of others) so largest magnitude becomes 1. Not implemented. |
ODS_WH_NORMMEAN | Simple normalisation - each frame is normalised (independent of others) so mean magnitude becomes 1. Not implemented. |