LMMS
Loading...
Searching...
No Matches
OscilGen.cpp File Reference
#include "OscilGen.h"
#include "../Misc/WaveShapeSmps.h"
#include <cassert>
#include <stdlib.h>
#include <math.h>
#include <stdio.h>

Macros

#define _USE_MATH_DEFINES
#define DIFF(par)
#define FUNC(b)
#define FILTER(x)

Typedefs

typedef float(* base_func) (float, float)
typedef float(* filter_func) (unsigned int, float, float)

Functions

void clearAll (fft_t *freqs)
void clearDC (fft_t *freqs)
float normal (const fft_t *freqs, off_t x)
float abs (const fft_t *freqs, off_t x)
float arg (const fft_t *freqs, off_t x)
void normalize (fft_t *freqs)
void rmsNormalize (fft_t *freqs)
void normalize (float *smps, size_t N)
 FUNC (pulse)
 FUNC (saw)
 FUNC (triangle)
 FUNC (power)
 FUNC (gauss)
 FUNC (diode)
 FUNC (abssine)
 FUNC (pulsesine)
 FUNC (stretchsine)
 FUNC (chirp)
 FUNC (absstretchsine)
 FUNC (chebyshev)
 FUNC (sqr)
 FUNC (spike)
 FUNC (circle)
base_func getBaseFunction (unsigned char func)
 FILTER (lp)
 FILTER (hp1)
 FILTER (hp1b)
 FILTER (bp1)
 FILTER (bs1)
 FILTER (lp2)
 FILTER (hp2)
 FILTER (bp2)
 FILTER (bs2)
bool floatEq (float a, float b)
 FILTER (cos)
 FILTER (sin)
 FILTER (low_shelf)
 FILTER (s)
filter_func getFilter (unsigned char func)

Macro Definition Documentation

◆ _USE_MATH_DEFINES

#define _USE_MATH_DEFINES

◆ DIFF

#define DIFF ( par)
Value:
(old ## par != P ## par)
#define P(protos)
Definition proto.h:37

◆ FILTER

#define FILTER ( x)
Value:
float osc_ ## x(unsigned int i, float par, float par2)
register unsigned i
Definition inflate.c:1575
unsigned x[BMAX+1]
Definition inflate.c:1586

◆ FUNC

#define FUNC ( b)
Value:
float basefunc_ ## b(float x, float a)
uint8_t a
Definition Spc_Cpu.h:141
b
Definition crypt.c:628

Typedef Documentation

◆ base_func

typedef float(* base_func) (float, float)

◆ filter_func

typedef float(* filter_func) (unsigned int, float, float)

Function Documentation

◆ abs()

float abs ( const fft_t * freqs,
off_t x )
inline

◆ arg()

float arg ( const fft_t * freqs,
off_t x )
inline

◆ clearAll()

void clearAll ( fft_t * freqs)
inline

◆ clearDC()

void clearDC ( fft_t * freqs)
inline

◆ FILTER() [1/13]

FILTER ( bp1 )

◆ FILTER() [2/13]

FILTER ( bp2 )

◆ FILTER() [3/13]

FILTER ( bs1 )

◆ FILTER() [4/13]

FILTER ( bs2 )

◆ FILTER() [5/13]

FILTER ( cos )

◆ FILTER() [6/13]

FILTER ( hp1 )

◆ FILTER() [7/13]

FILTER ( hp1b )

◆ FILTER() [8/13]

FILTER ( hp2 )

◆ FILTER() [9/13]

FILTER ( low_shelf )

◆ FILTER() [10/13]

FILTER ( lp )

◆ FILTER() [11/13]

FILTER ( lp2 )

◆ FILTER() [12/13]

FILTER ( s )

◆ FILTER() [13/13]

FILTER ( sin )

◆ floatEq()

bool floatEq ( float a,
float b )

◆ FUNC() [1/15]

FUNC ( abssine )

◆ FUNC() [2/15]

FUNC ( absstretchsine )

◆ FUNC() [3/15]

FUNC ( chebyshev )

◆ FUNC() [4/15]

FUNC ( chirp )

◆ FUNC() [5/15]

FUNC ( circle )

◆ FUNC() [6/15]

FUNC ( diode )

◆ FUNC() [7/15]

FUNC ( gauss )

◆ FUNC() [8/15]

FUNC ( power )

◆ FUNC() [9/15]

FUNC ( pulse )

◆ FUNC() [10/15]

FUNC ( pulsesine )

◆ FUNC() [11/15]

FUNC ( saw )

◆ FUNC() [12/15]

FUNC ( spike )

◆ FUNC() [13/15]

FUNC ( sqr )

◆ FUNC() [14/15]

FUNC ( stretchsine )

◆ FUNC() [15/15]

FUNC ( triangle )

◆ getBaseFunction()

base_func getBaseFunction ( unsigned char func)

◆ getFilter()

filter_func getFilter ( unsigned char func)

◆ normal()

float normal ( const fft_t * freqs,
off_t x )
inline

◆ normalize() [1/2]

void normalize ( fft_t * freqs)

Take frequency spectrum and ensure values are normalized based upon magnitude to 0<=x<=1

◆ normalize() [2/2]

void normalize ( float * smps,
size_t N )
inline

◆ rmsNormalize()

void rmsNormalize ( fft_t * freqs)