Skip to content

daisysp

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

Classes

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

Types

Name
enum AdEnvSegment
enum @0
enum @1
enum @2
enum class Mapping
template <size_t max_size,size_t max_block>
using FIRFilterImplGeneric< max_size, max_block >
FIR

Functions

Name
uint32_t hash_xs32(uint32_t x)
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 >
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)

Attributes

Name
constexpr float kRandFrac
constexpr float kOneTwelfth

Detailed Description

FIR Filter implementation, generic and ARM CMSIS DSP based.

Author: Alexander Petrov-Savchenko ([email protected])

Date: February 2021

Types Documentation

enum AdEnvSegment

Enumerator Value Description
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)

See: AdEnv

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

enum @0

Enumerator Value Description
ADSR_SEG_IDLE 0
ADSR_SEG_ATTACK 1
ADSR_SEG_DECAY 2
ADSR_SEG_RELEASE 4

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

enum @1

Enumerator Value Description
CROSSFADE_LIN
CROSSFADE_CPOW
CROSSFADE_LOG
CROSSFADE_EXP
CROSSFADE_LAST

Curve applied to the CrossFade

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

enum @2

Enumerator Value Description
PLUCK_MODE_RECURSIVE
PLUCK_MODE_WEIGHTED_AVERAGE
PLUCK_LAST

The method of natural decay that the algorithm will use.

  • RECURSIVE: 1st order recursive filter, with coefs .5.
  • WEIGHTED_AVERAGE: weighted averaging.

enum Mapping

Enumerator Value Description
LINEAR
EXP
LOG

Curves to use with the fmap function

using FIR

template <size_t max_size,
size_t max_block>
using daisysp::FIR = typedef FIRFilterImplGeneric<max_size, max_block>;

Functions Documentation

function hash_xs32

static inline uint32_t hash_xs32(
    uint32_t x
)

function myrand

inline uint32_t myrand()

function fmax

inline float fmax(
    float a,
    float b
)

efficient floating point min/max ℅ stephen mccaul

function fmin

inline float fmin(
    float a,
    float b
)

function fclamp

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

quick fp clamp

function fastpower

inline float fastpower(
    float f,
    int n
)

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

function fastroot

inline float fastroot(
    float f,
    int n
)

function fastmod1f

inline float fastmod1f(
    float x
)

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

function pow10f

inline float pow10f(
    float f
)

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)

function fastlog2f

inline float fastlog2f(
    float f
)

function fastlog10f

inline float fastlog10f(
    float f
)

function mtof

inline float mtof(
    float m
)

Midi to frequency helper

function fonepole

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

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

function fmap

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

Parameters:

  • in a value between 0 to 1 that will be mapped to the new range.
  • min the new minimum value
  • max the new maxmimum value
  • curve a Mapping Value to adjust the response curve of the transformation defaults to Linear.

Returns:

  • returns the transformed float within the new range.

See: Mapping

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

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

function median

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

Simple 3-point median filter ℅ stephen mccaul

function ThisBlepSample

inline float ThisBlepSample(
    float t
)

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

function NextBlepSample

inline float NextBlepSample(
    float t
)

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

function NextIntegratedBlepSample

inline float NextIntegratedBlepSample(
    float t
)

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

function ThisIntegratedBlepSample

inline float ThisIntegratedBlepSample(
    float t
)

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

function SoftLimit

inline float SoftLimit(
    float x
)

Soft Limiting function ported extracted from pichenettes/stmlib

function SoftClip

inline float SoftClip(
    float x
)

Soft Clipping function extracted from pichenettes/stmlib

function TestFloat

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

Parameters:

  • x value passed by reference, replaced by y if invalid.
  • y value to replace x if invalidity is found.

Quick check for Invalid float values (NaN, Inf, out of range) When DEBUG is true in the build, this will halt execution for tracing the reason for the invalidity.

function soft_saturate

inline float soft_saturate(
    float in,
    float thresh
)

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

function is_power2

constexpr bool is_power2(
    uint32_t x
)

function get_next_power2

inline uint32_t get_next_power2(
    uint32_t x
)

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.

Attributes Documentation

variable kRandFrac

static constexpr float kRandFrac = 1.f / (float)RAND_MAX;

variable kOneTwelfth

static constexpr float kOneTwelfth = 1.f / 12.f;

Updated on 2024-01-03 at 19:38:46 +0000