sst-waveshapers
Waveshapers submodule for the Surge Synthesizer
Namespaces | Classes | Typedefs | Enumerations | Functions | Variables
sst::waveshapers Namespace Reference

DSP code for Surge waveshapers. More...

Namespaces

 utilities
 Utility code needed for Surge waveshapers.
 

Classes

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

Typedefs

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>
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

◆ QuadWaveshaperPtr

typedef SIMD_M128(* QuadWaveshaperPtr) (QuadWaveshaperState *__restrict, SIMD_M128 in, SIMD_M128 drive)

Enumeration Type Documentation

◆ WaveshaperType

enum WaveshaperType
strong
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()

SIMD_M128 sst::waveshapers::ADAA ( QuadWaveshaperState *__restrict  s,
SIMD_M128  x 
)

◆ dcBlock()

SIMD_M128 sst::waveshapers::dcBlock ( QuadWaveshaperState *__restrict  s,
SIMD_M128  x 
)

◆ DIGI_SSE2()

SIMD_M128 sst::waveshapers::DIGI_SSE2 ( QuadWaveshaperState __restrict,
SIMD_M128  in,
SIMD_M128  drive 
)

Referenced by GetQuadWaveshaper().

◆ SINUS_SSE2()

SIMD_M128 sst::waveshapers::SINUS_SSE2 ( QuadWaveshaperState *__restrict  s,
SIMD_M128  in,
SIMD_M128  drive 
)

◆ FuzzTable()

float sst::waveshapers::FuzzTable ( const float  x)

◆ Fuzz()

SIMD_M128 sst::waveshapers::Fuzz ( QuadWaveshaperState *__restrict  s,
SIMD_M128  x,
SIMD_M128  drive 
)

◆ FuzzCtrTable()

float sst::waveshapers::FuzzCtrTable ( const float  x)

◆ FuzzEdgeTable()

float sst::waveshapers::FuzzEdgeTable ( const float  x)

◆ CHEBY_CORE()

SIMD_M128 sst::waveshapers::CHEBY_CORE ( QuadWaveshaperState *__restrict  s,
SIMD_M128  x,
SIMD_M128  drive 
)

References TANH().

◆ cheb2_kernel()

SIMD_M128 sst::waveshapers::cheb2_kernel ( SIMD_M128  x)

◆ cheb3_kernel()

SIMD_M128 sst::waveshapers::cheb3_kernel ( SIMD_M128  x)

◆ cheb4_kernel()

SIMD_M128 sst::waveshapers::cheb4_kernel ( SIMD_M128  x)

◆ cheb5_kernel()

SIMD_M128 sst::waveshapers::cheb5_kernel ( SIMD_M128  x)

◆ Plus12()

SIMD_M128 sst::waveshapers::Plus12 ( QuadWaveshaperState *__restrict  s,
SIMD_M128  in,
SIMD_M128  drive 
)

References TANH().

Referenced by GetQuadWaveshaper().

◆ Plus13()

SIMD_M128 sst::waveshapers::Plus13 ( QuadWaveshaperState *__restrict  s,
SIMD_M128  in,
SIMD_M128  drive 
)

References ChebSeries< len >::eval(), and TANH().

Referenced by GetQuadWaveshaper().

◆ Plus14()

SIMD_M128 sst::waveshapers::Plus14 ( QuadWaveshaperState *__restrict  s,
SIMD_M128  in,
SIMD_M128  drive 
)

References TANH().

Referenced by GetQuadWaveshaper().

◆ Plus15()

SIMD_M128 sst::waveshapers::Plus15 ( QuadWaveshaperState *__restrict  s,
SIMD_M128  in,
SIMD_M128  drive 
)

References ChebSeries< len >::eval(), and TANH().

Referenced by GetQuadWaveshaper().

◆ Plus12345()

SIMD_M128 sst::waveshapers::Plus12345 ( QuadWaveshaperState *__restrict  s,
SIMD_M128  in,
SIMD_M128  drive 
)

References TANH().

Referenced by GetQuadWaveshaper().

◆ PlusSaw3()

SIMD_M128 sst::waveshapers::PlusSaw3 ( QuadWaveshaperState *__restrict  s,
SIMD_M128  in,
SIMD_M128  drive 
)

References TANH().

Referenced by GetQuadWaveshaper().

◆ PlusSqr3()

SIMD_M128 sst::waveshapers::PlusSqr3 ( QuadWaveshaperState *__restrict  s,
SIMD_M128  in,
SIMD_M128  drive 
)

References ChebSeries< len >::eval(), and TANH().

Referenced by GetQuadWaveshaper().

◆ GetQuadWaveshaper()

QuadWaveshaperPtr GetQuadWaveshaper ( WaveshaperType  type)

◆ initializeWaveshaperRegister()

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

◆ posrect_kernel()

void sst::waveshapers::posrect_kernel ( SIMD_M128  x,
SIMD_M128 &  f,
SIMD_M128 &  adF 
)

◆ ADAA_POS_WAVE()

SIMD_M128 sst::waveshapers::ADAA_POS_WAVE ( QuadWaveshaperState *__restrict  s,
SIMD_M128  x,
SIMD_M128  drive 
)

References CLIP().

◆ negrect_kernel()

void sst::waveshapers::negrect_kernel ( SIMD_M128  x,
SIMD_M128 &  f,
SIMD_M128 &  adF 
)

◆ ADAA_NEG_WAVE()

SIMD_M128 sst::waveshapers::ADAA_NEG_WAVE ( QuadWaveshaperState *__restrict  s,
SIMD_M128  x,
SIMD_M128  drive 
)

References CLIP().

◆ fwrect_kernel()

void sst::waveshapers::fwrect_kernel ( SIMD_M128  x,
SIMD_M128 &  F,
SIMD_M128 &  adF 
)

◆ ADAA_FULL_WAVE()

SIMD_M128 sst::waveshapers::ADAA_FULL_WAVE ( QuadWaveshaperState *__restrict  s,
SIMD_M128  x,
SIMD_M128  drive 
)

References CLIP().

Referenced by GetQuadWaveshaper().

◆ softrect_kernel()

void sst::waveshapers::softrect_kernel ( SIMD_M128  x,
SIMD_M128 &  F,
SIMD_M128 &  adF 
)

◆ ADAA_SOFTRECT_WAVE()

SIMD_M128 sst::waveshapers::ADAA_SOFTRECT_WAVE ( QuadWaveshaperState *__restrict  s,
SIMD_M128  x,
SIMD_M128  drive 
)

References TANH().

Referenced by GetQuadWaveshaper().

◆ CLIP()

SIMD_M128 sst::waveshapers::CLIP ( QuadWaveshaperState __restrict,
SIMD_M128  in,
SIMD_M128  drive 
)

◆ TANH()

SIMD_M128 sst::waveshapers::TANH ( QuadWaveshaperState __restrict,
SIMD_M128  in,
SIMD_M128  drive 
)

◆ ZAMSAT()

SIMD_M128 sst::waveshapers::ZAMSAT ( QuadWaveshaperState *__restrict  s,
SIMD_M128  x,
SIMD_M128  drive 
)

References CLIP().

Referenced by GetQuadWaveshaper().

◆ ASYM_SSE2()

SIMD_M128 sst::waveshapers::ASYM_SSE2 ( QuadWaveshaperState *__restrict  s,
SIMD_M128  in,
SIMD_M128  drive 
)

References wst_asym.

Referenced by GetQuadWaveshaper().

◆ OJD()

SIMD_M128 sst::waveshapers::OJD ( QuadWaveshaperState *__restrict  s,
SIMD_M128  x,
SIMD_M128  drive 
)

Referenced by GetQuadWaveshaper().

◆ SinPlusX()

float sst::waveshapers::SinPlusX ( const float  x)

◆ SinNXPlusXBound()

float sst::waveshapers::SinNXPlusXBound ( const float  x)

◆ SinNX()

float sst::waveshapers::SinNX ( const float  x)

◆ SinNXBound()

float sst::waveshapers::SinNXBound ( const float  x)

◆ singleFoldADAA()

void sst::waveshapers::singleFoldADAA ( SIMD_M128  x,
SIMD_M128 &  f,
SIMD_M128 &  adf 
)

◆ dualFoldADAA()

void sst::waveshapers::dualFoldADAA ( SIMD_M128  x,
SIMD_M128 &  f,
SIMD_M128 &  adf 
)

◆ westCoastFoldADAA()

void sst::waveshapers::westCoastFoldADAA ( SIMD_M128  x,
SIMD_M128 &  f,
SIMD_M128 &  adf 
)

◆ WAVEFOLDER()

SIMD_M128 sst::waveshapers::WAVEFOLDER ( QuadWaveshaperState *__restrict  s,
SIMD_M128  x,
SIMD_M128  drive 
)

◆ SoftOneFold()

SIMD_M128 sst::waveshapers::SoftOneFold ( QuadWaveshaperState __restrict,
SIMD_M128  x,
SIMD_M128  drive 
)

Referenced by GetQuadWaveshaper().

◆ LINFOLD_SSE2()

SIMD_M128 sst::waveshapers::LINFOLD_SSE2 ( QuadWaveshaperState *__restrict  s,
SIMD_M128  in,
SIMD_M128  drive 
)

Referenced by GetQuadWaveshaper().

◆ WaveshaperGroupName()

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

◆ WS_LUT()

SIMD_M128 sst::waveshapers::WS_LUT ( QuadWaveshaperState __restrict,
const float *  table,
SIMD_M128  in,
SIMD_M128  drive 
)

◆ WS_PM1_LUT()

SIMD_M128 sst::waveshapers::WS_PM1_LUT ( const float *  table,
SIMD_M128  in 
)

◆ TableEval()

SIMD_M128 sst::waveshapers::TableEval ( QuadWaveshaperState *__restrict  s,
SIMD_M128  x,
SIMD_M128  drive 
)

Variable Documentation

◆ n_waveshaper_registers

constexpr int n_waveshaper_registers = 4
constexpr

◆ wst_names

const char wst_names[(int) WaveshaperType::n_ws_types][32]