sst-waveshapers
Waveshapers submodule for the Surge Synthesizer
Loading...
Searching...
No Matches
Namespaces | Classes | Typedefs | Enumerations | Functions | Variables
sst::waveshapers Namespace Reference

DSP code for Surge waveshapers. More...

Namespaces

namespace  utilities
 Utility code needed for Surge waveshapers.
 

Classes

struct  ChebSeries
 
struct  FolderADAA
 
struct  LUTBase
 
struct  QuadWaveshaperState
 
struct  WaveshaperTables
 Lookup table for waveshapers. More...
 

Typedefs

using portable_minstd_rand = std::linear_congruential_engine< uint_fast32_t, 48271, 0, 2147483647 >
 
typedef SIMD_M128(* QuadWaveshaperPtr) (QuadWaveshaperState *__restrict, SIMD_M128 in, SIMD_M128 drive)
 

Enumerations

enum class  WaveshaperType {
  wst_none = 0 , wst_soft , wst_hard , wst_asym ,
  wst_sine , wst_digital , wst_cheby2 , wst_cheby3 ,
  wst_cheby4 , wst_cheby5 , wst_fwrectify , wst_poswav ,
  wst_negwav , wst_softrect , wst_singlefold , wst_dualfold ,
  wst_westfold , wst_add12 , wst_add13 , wst_add14 ,
  wst_add15 , wst_add12345 , wst_addsaw3 , wst_addsqr3 ,
  wst_fuzz , wst_fuzzsoft , wst_fuzzheavy , wst_fuzzctr ,
  wst_fuzzsoftedge , wst_sinpx , wst_sin2xpb , wst_sin3xpb ,
  wst_sin7xpb , wst_sin10xpb , wst_2cyc , wst_7cyc ,
  wst_10cyc , wst_2cycbound , wst_7cycbound , wst_10cycbound ,
  wst_zamsat , wst_ojd , wst_softfold , wst_linearfold ,
  wst_sinefold , n_ws_types
}
 

Functions

template<void FandADF, int xR, int aR, bool updateInit = true>
SIMD_M128 ADAA (QuadWaveshaperState *__restrict s, SIMD_M128 x)
 
template<int R1, int R2, bool updateInit = true>
SIMD_M128 dcBlock (QuadWaveshaperState *__restrict s, SIMD_M128 x)
 
SIMD_M128 DIGI_SSE2 (QuadWaveshaperState *__restrict, SIMD_M128 in, SIMD_M128 drive)
 
template<bool DO_FOLD = false>
SIMD_M128 SINUS_SSE2 (QuadWaveshaperState *__restrict s, SIMD_M128 in, SIMD_M128 drive)
 
template<int scale>
float FuzzTable (const float x)
 
template<int scale, SIMD_M128 C>
SIMD_M128 Fuzz (QuadWaveshaperState *__restrict s, SIMD_M128 x, SIMD_M128 drive)
 
float FuzzCtrTable (const float x)
 
float FuzzEdgeTable (const float x)
 
template<SIMD_M128(*)(SIMD_M128) K, bool useDCBlock>
SIMD_M128 CHEBY_CORE (QuadWaveshaperState *__restrict s, SIMD_M128 x, SIMD_M128 drive)
 
SIMD_M128 cheb2_kernel (SIMD_M128 x)
 
SIMD_M128 cheb3_kernel (SIMD_M128 x)
 
SIMD_M128 cheb4_kernel (SIMD_M128 x)
 
SIMD_M128 cheb5_kernel (SIMD_M128 x)
 
SIMD_M128 Plus12 (QuadWaveshaperState *__restrict s, SIMD_M128 in, SIMD_M128 drive)
 
SIMD_M128 Plus13 (QuadWaveshaperState *__restrict s, SIMD_M128 in, SIMD_M128 drive)
 
SIMD_M128 Plus14 (QuadWaveshaperState *__restrict s, SIMD_M128 in, SIMD_M128 drive)
 
SIMD_M128 Plus15 (QuadWaveshaperState *__restrict s, SIMD_M128 in, SIMD_M128 drive)
 
SIMD_M128 Plus12345 (QuadWaveshaperState *__restrict s, SIMD_M128 in, SIMD_M128 drive)
 
SIMD_M128 PlusSaw3 (QuadWaveshaperState *__restrict s, SIMD_M128 in, SIMD_M128 drive)
 
SIMD_M128 PlusSqr3 (QuadWaveshaperState *__restrict s, SIMD_M128 in, SIMD_M128 drive)
 
QuadWaveshaperPtr GetQuadWaveshaper (WaveshaperType type)
 
void initializeWaveshaperRegister (WaveshaperType type, float R[n_waveshaper_registers])
 
void posrect_kernel (SIMD_M128 x, SIMD_M128 &f, SIMD_M128 &adF)
 
template<int R1, int R2>
SIMD_M128 ADAA_POS_WAVE (QuadWaveshaperState *__restrict s, SIMD_M128 x, SIMD_M128 drive)
 
void negrect_kernel (SIMD_M128 x, SIMD_M128 &f, SIMD_M128 &adF)
 
template<int R1, int R2>
SIMD_M128 ADAA_NEG_WAVE (QuadWaveshaperState *__restrict s, SIMD_M128 x, SIMD_M128 drive)
 
void fwrect_kernel (SIMD_M128 x, SIMD_M128 &F, SIMD_M128 &adF)
 
SIMD_M128 ADAA_FULL_WAVE (QuadWaveshaperState *__restrict s, SIMD_M128 x, SIMD_M128 drive)
 
void softrect_kernel (SIMD_M128 x, SIMD_M128 &F, SIMD_M128 &adF)
 
SIMD_M128 ADAA_SOFTRECT_WAVE (QuadWaveshaperState *__restrict s, SIMD_M128 x, SIMD_M128 drive)
 
SIMD_M128 CLIP (QuadWaveshaperState *__restrict, SIMD_M128 in, SIMD_M128 drive)
 
SIMD_M128 TANH (QuadWaveshaperState *__restrict, SIMD_M128 in, SIMD_M128 drive)
 
SIMD_M128 ZAMSAT (QuadWaveshaperState *__restrict s, SIMD_M128 x, SIMD_M128 drive)
 
SIMD_M128 ASYM_SSE2 (QuadWaveshaperState *__restrict s, SIMD_M128 in, SIMD_M128 drive)
 
SIMD_M128 OJD (QuadWaveshaperState *__restrict s, SIMD_M128 x, SIMD_M128 drive)
 
float SinPlusX (const float x)
 
template<int T>
float SinNXPlusXBound (const float x)
 
template<int T>
float SinNX (const float x)
 
template<int T>
float SinNXBound (const float x)
 
void singleFoldADAA (SIMD_M128 x, SIMD_M128 &f, SIMD_M128 &adf)
 
void dualFoldADAA (SIMD_M128 x, SIMD_M128 &f, SIMD_M128 &adf)
 
void westCoastFoldADAA (SIMD_M128 x, SIMD_M128 &f, SIMD_M128 &adf)
 
template<void F>
SIMD_M128 WAVEFOLDER (QuadWaveshaperState *__restrict s, SIMD_M128 x, SIMD_M128 drive)
 
SIMD_M128 SoftOneFold (QuadWaveshaperState *__restrict, SIMD_M128 x, SIMD_M128 drive)
 
SIMD_M128 LINFOLD_SSE2 (QuadWaveshaperState *__restrict s, SIMD_M128 in, SIMD_M128 drive)
 
std::vector< std::pair< int, std::string > > WaveshaperGroupName ()
 
template<int xRes, int xCenter, int size>
SIMD_M128 WS_LUT (QuadWaveshaperState *__restrict, const float *table, SIMD_M128 in, SIMD_M128 drive)
 
template<int N>
SIMD_M128 WS_PM1_LUT (const float *table, SIMD_M128 in)
 
template<float F, int N, SIMD_M128 C, bool block = true>
SIMD_M128 TableEval (QuadWaveshaperState *__restrict s, SIMD_M128 x, SIMD_M128 drive)
 

Variables

constexpr int n_waveshaper_registers = 4
 
const char wst_names [(int) WaveshaperType::n_ws_types][32]
 

Detailed Description

DSP code for Surge waveshapers.

Typedef Documentation

◆ portable_minstd_rand

using portable_minstd_rand = std::linear_congruential_engine<uint_fast32_t, 48271, 0, 2147483647>

◆ QuadWaveshaperPtr

Enumeration Type Documentation

◆ WaveshaperType

Enumerator
wst_none 
wst_soft 
wst_hard 
wst_asym 
wst_sine 
wst_digital 
wst_cheby2 
wst_cheby3 
wst_cheby4 
wst_cheby5 
wst_fwrectify 
wst_poswav 
wst_negwav 
wst_softrect 
wst_singlefold 
wst_dualfold 
wst_westfold 
wst_add12 
wst_add13 
wst_add14 
wst_add15 
wst_add12345 
wst_addsaw3 
wst_addsqr3 
wst_fuzz 
wst_fuzzsoft 
wst_fuzzheavy 
wst_fuzzctr 
wst_fuzzsoftedge 
wst_sinpx 
wst_sin2xpb 
wst_sin3xpb 
wst_sin7xpb 
wst_sin10xpb 
wst_2cyc 
wst_7cyc 
wst_10cyc 
wst_2cycbound 
wst_7cycbound 
wst_10cycbound 
wst_zamsat 
wst_ojd 
wst_softfold 
wst_linearfold 
wst_sinefold 
n_ws_types 

Function Documentation

◆ ADAA()

template<void FandADF, int xR, int aR, bool updateInit = true>
SIMD_M128 ADAA ( QuadWaveshaperState *__restrict  s,
SIMD_M128  x 
)

◆ dcBlock()

template<int R1, int R2, bool updateInit = true>
SIMD_M128 dcBlock ( QuadWaveshaperState *__restrict  s,
SIMD_M128  x 
)

◆ DIGI_SSE2()

SIMD_M128 DIGI_SSE2 ( QuadWaveshaperState __restrict,
SIMD_M128  in,
SIMD_M128  drive 
)

Referenced by GetQuadWaveshaper().

◆ SINUS_SSE2()

template<bool DO_FOLD = false>
SIMD_M128 SINUS_SSE2 ( QuadWaveshaperState *__restrict  s,
SIMD_M128  in,
SIMD_M128  drive 
)

References wst_sine.

◆ FuzzTable()

template<int scale>
float FuzzTable ( const float  x)

◆ Fuzz()

template<int scale, SIMD_M128 C>
SIMD_M128 Fuzz ( QuadWaveshaperState *__restrict  s,
SIMD_M128  x,
SIMD_M128  drive 
)

References dcBlock().

◆ FuzzCtrTable()

float FuzzCtrTable ( const float  x)

References dcBlock().

◆ FuzzEdgeTable()

float FuzzEdgeTable ( const float  x)

References dcBlock().

◆ CHEBY_CORE()

template<SIMD_M128(*)(SIMD_M128) K, bool useDCBlock>
SIMD_M128 CHEBY_CORE ( QuadWaveshaperState *__restrict  s,
SIMD_M128  x,
SIMD_M128  drive 
)

References dcBlock(), and TANH().

◆ cheb2_kernel()

SIMD_M128 cheb2_kernel ( SIMD_M128  x)

References dcBlock().

◆ cheb3_kernel()

SIMD_M128 cheb3_kernel ( SIMD_M128  x)

References dcBlock().

◆ cheb4_kernel()

SIMD_M128 cheb4_kernel ( SIMD_M128  x)

References dcBlock().

◆ cheb5_kernel()

SIMD_M128 cheb5_kernel ( SIMD_M128  x)

References dcBlock().

◆ Plus12()

SIMD_M128 Plus12 ( QuadWaveshaperState *__restrict  s,
SIMD_M128  in,
SIMD_M128  drive 
)

References dcBlock(), and TANH().

Referenced by GetQuadWaveshaper().

◆ Plus13()

SIMD_M128 Plus13 ( QuadWaveshaperState *__restrict  s,
SIMD_M128  in,
SIMD_M128  drive 
)

References dcBlock(), and TANH().

Referenced by GetQuadWaveshaper().

◆ Plus14()

SIMD_M128 Plus14 ( QuadWaveshaperState *__restrict  s,
SIMD_M128  in,
SIMD_M128  drive 
)

References dcBlock(), and TANH().

Referenced by GetQuadWaveshaper().

◆ Plus15()

SIMD_M128 Plus15 ( QuadWaveshaperState *__restrict  s,
SIMD_M128  in,
SIMD_M128  drive 
)

References dcBlock(), and TANH().

Referenced by GetQuadWaveshaper().

◆ Plus12345()

SIMD_M128 Plus12345 ( QuadWaveshaperState *__restrict  s,
SIMD_M128  in,
SIMD_M128  drive 
)

References dcBlock(), and TANH().

Referenced by GetQuadWaveshaper().

◆ PlusSaw3()

SIMD_M128 PlusSaw3 ( QuadWaveshaperState *__restrict  s,
SIMD_M128  in,
SIMD_M128  drive 
)

References dcBlock(), and TANH().

Referenced by GetQuadWaveshaper().

◆ PlusSqr3()

SIMD_M128 PlusSqr3 ( QuadWaveshaperState *__restrict  s,
SIMD_M128  in,
SIMD_M128  drive 
)

References dcBlock(), and TANH().

Referenced by GetQuadWaveshaper().

◆ GetQuadWaveshaper()

QuadWaveshaperPtr GetQuadWaveshaper ( WaveshaperType  type)

◆ initializeWaveshaperRegister()

void initializeWaveshaperRegister ( WaveshaperType  type,
float  R[n_waveshaper_registers] 
)

◆ posrect_kernel()

void posrect_kernel ( SIMD_M128  x,
SIMD_M128 f,
SIMD_M128 adF 
)

References dcBlock().

◆ ADAA_POS_WAVE()

template<int R1, int R2>
SIMD_M128 ADAA_POS_WAVE ( QuadWaveshaperState *__restrict  s,
SIMD_M128  x,
SIMD_M128  drive 
)

References CLIP(), and dcBlock().

◆ negrect_kernel()

void negrect_kernel ( SIMD_M128  x,
SIMD_M128 f,
SIMD_M128 adF 
)

References dcBlock().

◆ ADAA_NEG_WAVE()

template<int R1, int R2>
SIMD_M128 ADAA_NEG_WAVE ( QuadWaveshaperState *__restrict  s,
SIMD_M128  x,
SIMD_M128  drive 
)

References CLIP(), and dcBlock().

◆ fwrect_kernel()

void fwrect_kernel ( SIMD_M128  x,
SIMD_M128 F,
SIMD_M128 adF 
)

References dcBlock().

◆ ADAA_FULL_WAVE()

SIMD_M128 ADAA_FULL_WAVE ( QuadWaveshaperState *__restrict  s,
SIMD_M128  x,
SIMD_M128  drive 
)

References CLIP(), and dcBlock().

Referenced by GetQuadWaveshaper().

◆ softrect_kernel()

void softrect_kernel ( SIMD_M128  x,
SIMD_M128 F,
SIMD_M128 adF 
)

References dcBlock().

◆ ADAA_SOFTRECT_WAVE()

SIMD_M128 ADAA_SOFTRECT_WAVE ( QuadWaveshaperState *__restrict  s,
SIMD_M128  x,
SIMD_M128  drive 
)

References dcBlock(), and TANH().

Referenced by GetQuadWaveshaper().

◆ CLIP()

SIMD_M128 CLIP ( QuadWaveshaperState __restrict,
SIMD_M128  in,
SIMD_M128  drive 
)

◆ TANH()

SIMD_M128 TANH ( QuadWaveshaperState __restrict,
SIMD_M128  in,
SIMD_M128  drive 
)

◆ ZAMSAT()

SIMD_M128 ZAMSAT ( QuadWaveshaperState *__restrict  s,
SIMD_M128  x,
SIMD_M128  drive 
)

References CLIP(), and dcBlock().

Referenced by GetQuadWaveshaper().

◆ ASYM_SSE2()

SIMD_M128 ASYM_SSE2 ( QuadWaveshaperState *__restrict  s,
SIMD_M128  in,
SIMD_M128  drive 
)

References dcBlock(), and wst_asym.

Referenced by GetQuadWaveshaper().

◆ OJD()

References dcBlock().

Referenced by GetQuadWaveshaper().

◆ SinPlusX()

float SinPlusX ( const float  x)

References dcBlock().

◆ SinNXPlusXBound()

template<int T>
float SinNXPlusXBound ( const float  x)

References dcBlock().

◆ SinNX()

template<int T>
float SinNX ( const float  x)

References dcBlock().

◆ SinNXBound()

template<int T>
float SinNXBound ( const float  x)

References dcBlock().

◆ singleFoldADAA()

void singleFoldADAA ( SIMD_M128  x,
SIMD_M128 f,
SIMD_M128 adf 
)

References dcBlock().

◆ dualFoldADAA()

void dualFoldADAA ( SIMD_M128  x,
SIMD_M128 f,
SIMD_M128 adf 
)

References dcBlock().

◆ westCoastFoldADAA()

void westCoastFoldADAA ( SIMD_M128  x,
SIMD_M128 f,
SIMD_M128 adf 
)

References dcBlock().

◆ WAVEFOLDER()

template<void F>
SIMD_M128 WAVEFOLDER ( QuadWaveshaperState *__restrict  s,
SIMD_M128  x,
SIMD_M128  drive 
)

References dcBlock().

◆ SoftOneFold()

SIMD_M128 SoftOneFold ( QuadWaveshaperState __restrict,
SIMD_M128  x,
SIMD_M128  drive 
)

References dcBlock().

Referenced by GetQuadWaveshaper().

◆ LINFOLD_SSE2()

SIMD_M128 LINFOLD_SSE2 ( QuadWaveshaperState *__restrict  s,
SIMD_M128  in,
SIMD_M128  drive 
)

References dcBlock().

Referenced by GetQuadWaveshaper().

◆ WaveshaperGroupName()

std::vector< std::pair< int, std::string > > WaveshaperGroupName ( )

◆ WS_LUT()

template<int xRes, int xCenter, int size>
SIMD_M128 WS_LUT ( QuadWaveshaperState __restrict,
const float table,
SIMD_M128  in,
SIMD_M128  drive 
)

References dcBlock().

◆ WS_PM1_LUT()

template<int N>
SIMD_M128 WS_PM1_LUT ( const float table,
SIMD_M128  in 
)

References dcBlock().

◆ TableEval()

template<float F, int N, SIMD_M128 C, bool block = true>
SIMD_M128 TableEval ( QuadWaveshaperState *__restrict  s,
SIMD_M128  x,
SIMD_M128  drive 
)

References dcBlock().

Variable Documentation

◆ n_waveshaper_registers

constexpr int n_waveshaper_registers = 4
constexpr

◆ wst_names