DaisySP
Loading...
Searching...
No Matches
Classes | Typedefs | Enumerations | Functions
daisysp Namespace Reference

FIR Filter implementation, generic and ARM CMSIS DSP based. More...

Classes

class  AdEnv
 
class  Adsr
 
class  AnalogBassDrum
 808 bass drum model, revisited. More...
 
class  AnalogSnareDrum
 808 snare drum model, revisited. More...
 
class  Autowah
 
class  Chorus
 Chorus Effect. More...
 
class  ChorusEngine
 Single Chorus engine. Used in Chorus. More...
 
class  ClockedNoise
 
class  CrossFade
 
class  DcBlock
 
class  Decimator
 
class  DelayLine
 
class  Drip
 
class  Dust
 Dust Module. More...
 
class  FIRFilterImplGeneric
 
struct  FIRMemory
 
struct  FIRMemory< 0, 0 >
 
class  Flanger
 Flanging Audio Effect. More...
 
class  Fm2
 
class  FormantOscillator
 Formant Oscillator Module. More...
 
class  FractalRandomGenerator
 Fractal Noise, stacks octaves of a noise source. More...
 
class  GrainletOscillator
 Granular Oscillator Module. More...
 
class  GranularPlayer
 
class  HarmonicOscillator
 Harmonic Oscillator Module based on Chebyshev polynomials. More...
 
class  HiHat
 808 HH, with a few extra parameters to push things to the CY territory... More...
 
class  LadderFilter
 
class  Limiter
 
class  LinearVCA
 Linear type VCA. More...
 
class  Looper
 
class  Maytrig
 
class  Metro
 
class  ModalVoice
 Simple modal synthesis voice with a mallet exciter: click -> LPF -> resonator. More...
 
class  OnePole
 One Pole Lowpass / Highpass Filter. More...
 
class  Oscillator
 
class  OscillatorBank
 Oscillator Bank module. More...
 
class  Overdrive
 Distortion / Overdrive Module. More...
 
class  Particle
 Random impulse train processed by a resonant filter. More...
 
class  Phaser
 Phaser Effect. More...
 
class  PhaserEngine
 Single Phaser engine. Used in Phaser. More...
 
class  Phasor
 
class  PitchShifter
 
class  Resonator
 Resonant Body Simulation. More...
 
class  ResonatorSvf
 SVF for use in the Resonator Class
. More...
 
class  RingModNoise
 Ring mod style metallic noise generator. More...
 
class  SampleHold
 
class  SampleRateReducer
 Sample rate reducer. More...
 
class  SmoothRandomGenerator
 Smooth random generator for internal modulation.
. More...
 
class  Soap
 
class  SquareNoise
 808 style "metallic noise" with 6 square oscillators. More...
 
class  String
 Comb filter / KS string. More...
 
class  StringVoice
 Extended Karplus-Strong, with all the niceties from Rings. More...
 
class  Svf
 
class  SwingVCA
 Swing type VCA. More...
 
class  SyntheticBassDrum
 Naive bass drum model (modulated oscillator with FM + envelope). More...
 
class  SyntheticBassDrumAttackNoise
 Attack Noise generator for SyntheticBassDrum. More...
 
class  SyntheticBassDrumClick
 Click noise for SyntheticBassDrum. More...
 
class  SyntheticSnareDrum
 Naive snare drum model (two modulated oscillators + filtered noise). More...
 
class  Tremolo
 Tremolo effect. More...
 
class  VariableSawOscillator
 Variable Saw Oscillator. More...
 
class  VariableShapeOscillator
 Variable Waveshape Oscillator. More...
 
class  VosimOscillator
 Vosim Oscillator Module
. More...
 
class  Wavefolder
 
class  WhiteNoise
 
class  ZOscillator
 ZOscillator Module
. More...
 

Typedefs

template<size_t max_size, size_t max_block>
using FIR = FIRFilterImplGeneric<max_size, max_block>
 

Enumerations

enum  AdEnvSegment { ADENV_SEG_IDLE , ADENV_SEG_ATTACK , ADENV_SEG_DECAY , ADENV_SEG_LAST }
 
enum  { ADSR_SEG_IDLE = 0 , ADSR_SEG_ATTACK = 1 , ADSR_SEG_DECAY = 2 , ADSR_SEG_RELEASE = 4 }
 
enum  {
  CROSSFADE_LIN , CROSSFADE_CPOW , CROSSFADE_LOG , CROSSFADE_EXP ,
  CROSSFADE_LAST
}
 
enum class  Mapping { LINEAR , EXP , LOG }
 

Functions

uint32_t myrand ()
 
float fmax (float a, float b)
 
float fmin (float a, float b)
 
float fclamp (float in, float min, float max)
 
float fastpower (float f, int n)
 
float fastroot (float f, int n)
 
float fastmod1f (float x)
 
float pow10f (float f)
 
float fastlog2f (float f)
 
float fastlog10f (float f)
 
float mtof (float m)
 
void fonepole (float &out, float in, float coeff)
 
float fmap (float in, float min, float max, Mapping curve=Mapping::LINEAR)
 
template<typename T >
median (T a, T b, T c)
 
float ThisBlepSample (float t)
 
float NextBlepSample (float t)
 
float NextIntegratedBlepSample (float t)
 
float ThisIntegratedBlepSample (float t)
 
float SoftLimit (float x)
 
float SoftClip (float x)
 
void TestFloat (float &x, float y=0.f)
 
float soft_saturate (float in, float thresh)
 
constexpr bool is_power2 (uint32_t x)
 
uint32_t get_next_power2 (uint32_t x)
 

Detailed Description

FIR Filter implementation, generic and ARM CMSIS DSP based.

Author
Alexander Petrov-Savchenko (axp@s.nosp@m.oft-.nosp@m.amp.c.nosp@m.om)
Date
February 2021

Enumeration Type Documentation

◆ anonymous enum

Distinct stages that the phase of the envelope can be located in.

  • IDLE = located at phase location 0, and not currently running
  • ATTACK = First segment of envelope where phase moves from 0 to 1
  • DECAY = Second segment of envelope where phase moves from 1 to SUSTAIN value
  • RELEASE = Fourth segment of envelop where phase moves from SUSTAIN to 0

◆ anonymous enum

Curve applied to the CrossFade

  • LIN = linear
  • CPOW = constant power
  • LOG = logarithmic
  • EXP exponential
  • LAST = end of enum (used for array indexing)

◆ AdEnvSegment

Distinct stages that the phase of the envelope can be located in.

See also
AdEnv
Enumerator
ADENV_SEG_IDLE 

located at phase location 0, and not currently running

ADENV_SEG_ATTACK 

First segment of envelope where phase moves from MIN value to MAX value

ADENV_SEG_DECAY 

Second segment of envelope where phase moves from MAX to MIN value

ADENV_SEG_LAST 

The final segment of the envelope (currently decay)

◆ Mapping

Curves to use with the fmap function

Function Documentation

◆ fastmod1f()

float daisysp::fastmod1f ( float x)
inline

Significantly more efficient than fmodf(x, 1.0f) for calculating the decimal part of a floating point value.

◆ fastpower()

float daisysp::fastpower ( float f,
int n )
inline

From Musicdsp.org "Fast power and root estimates for 32bit floats) Original code by Stefan Stenzel These are approximations

◆ fclamp()

float daisysp::fclamp ( float in,
float min,
float max )
inline

quick fp clamp

◆ fmap()

float daisysp::fmap ( float in,
float min,
float max,
Mapping curve = Mapping::LINEAR )
inline

Maps a float between a specified range, using a specified curve.

Parameters
ina value between 0 to 1 that will be mapped to the new range.
minthe new minimum value
maxthe new maxmimum value
curvea Mapping Value to adjust the response curve of the transformation defaults to Linear.
See also
Mapping

When using the log curve min and max, must be greater than zero.

Return values
returnsthe transformed float within the new range.

◆ fmax()

float daisysp::fmax ( float a,
float b )
inline

efficient floating point min/max c/o stephen mccaul

◆ fonepole()

void daisysp::fonepole ( float & out,
float in,
float coeff )
inline

one pole lpf out is passed by reference, and must be retained between calls to properly filter the signal coeff can be calculated: coeff = 1.0 / (time * sample_rate) ; where time is in seconds

◆ get_next_power2()

uint32_t daisysp::get_next_power2 ( uint32_t x)
inline

Prior to C++14 constexpr functions were required to be a single return statement. So this clause guards against that behavior to allow the library, and this function to continue to work with C++11. The function itself is not currently (12 May 2021) used within the library itself.

◆ median()

template<typename T >
T daisysp::median ( T a,
T b,
T c )

Simple 3-point median filter c/o stephen mccaul

◆ mtof()

float daisysp::mtof ( float m)
inline

Midi to frequency helper

◆ NextBlepSample()

float daisysp::NextBlepSample ( float t)
inline

Ported from pichenettes/eurorack/plaits/dsp/oscillator/oscillator.h

◆ NextIntegratedBlepSample()

float daisysp::NextIntegratedBlepSample ( float t)
inline

Ported from pichenettes/eurorack/plaits/dsp/oscillator/oscillator.h

◆ pow10f()

float daisysp::pow10f ( float f)
inline

From http://openaudio.blogspot.com/2017/02/faster-log10-and-pow.html No approximation, pow10f(x) gives a 90% speed increase over powf(10.f, x)

◆ soft_saturate()

float daisysp::soft_saturate ( float in,
float thresh )
inline

Based on soft saturate from: musicdsp.org Bram de Jong (2002-01-17) This still needs to be tested/fixed. Definitely does some weird stuff described as: x < a: f(x) = x x > a: f(x) = a + (x-a)/(1+((x-a)/(1-a))^2) x > 1: f(x) = (a + 1)/2

◆ SoftClip()

float daisysp::SoftClip ( float x)
inline

Soft Clipping function extracted from pichenettes/stmlib

◆ SoftLimit()

float daisysp::SoftLimit ( float x)
inline

Soft Limiting function ported extracted from pichenettes/stmlib

◆ TestFloat()

void daisysp::TestFloat ( float & x,
float y = 0.f )
inline

Quick check for Invalid float values (NaN, Inf, out of range)

Parameters
xvalue passed by reference, replaced by y if invalid.
yvalue to replace x if invalidity is found.

When DEBUG is true in the build, this will halt execution for tracing the reason for the invalidity.

◆ ThisBlepSample()

float daisysp::ThisBlepSample ( float t)
inline

Ported from pichenettes/eurorack/plaits/dsp/oscillator/oscillator.h

◆ ThisIntegratedBlepSample()

float daisysp::ThisIntegratedBlepSample ( float t)
inline

Ported from pichenettes/eurorack/plaits/dsp/oscillator/oscillator.h