Skip to content

Class daisysp::SyntheticBassDrum

ClassList > daisysp > SyntheticBassDrum

Naive bass drum model (modulated oscillator with FM + envelope). More...

  • #include <synthbassdrum.h>

Public Functions

Type Name
float DistortedSine (float phase, float phase_noise, float dirtiness)
void Init (float sample_rate)
float Process (bool trigger=false)
void SetAccent (float accent)
void SetDecay (float decay)
void SetDirtiness (float dirtiness)
void SetFmEnvelopeAmount (float fm_envelope_amount)
void SetFmEnvelopeDecay (float fm_envelope_decay)
void SetFreq (float freq)
void SetSustain (bool sustain)
void SetTone (float tone)
SyntheticBassDrum ()
float TransistorVCA (float s, float gain)
void Trig ()
~SyntheticBassDrum ()

Detailed Description

Author:

Ben Sergentanis

Date:

Jan 2021 Inadvertently 909-ish.

Ported from pichenettes/eurorack/plaits/dsp/drums/synthetic_bass_drum.h to an independent module. Original code written by Emilie Gillet in 2016.

Public Functions Documentation

function DistortedSine

inline float daisysp::SyntheticBassDrum::DistortedSine (
    float phase,
    float phase_noise,
    float dirtiness
) 

Generates a distorted sine wave


function Init

void daisysp::SyntheticBassDrum::Init (
    float sample_rate
) 

Init the module

Parameters:

  • sample_rate Audio engine sample rate.

function Process

float daisysp::SyntheticBassDrum::Process (
    bool trigger=false
) 

Get the next sample.

Parameters:

  • trigger True triggers the BD. This is optional.

function SetAccent

void daisysp::SyntheticBassDrum::SetAccent (
    float accent
) 

Sets the amount of accent.

Parameters:

  • accent Works 0-1.

function SetDecay

void daisysp::SyntheticBassDrum::SetDecay (
    float decay
) 

Sets how long the drum's volume takes to decay.

Parameters:

  • Works 0-1.

function SetDirtiness

void daisysp::SyntheticBassDrum::SetDirtiness (
    float dirtiness
) 

Makes things grimy

Parameters:

  • dirtiness Works 0-1.

function SetFmEnvelopeAmount

void daisysp::SyntheticBassDrum::SetFmEnvelopeAmount (
    float fm_envelope_amount
) 

Sets how much of a pitch sweep the drum experiences when triggered.

Parameters:

  • fm_envelope_amount Works 0-1.

function SetFmEnvelopeDecay

void daisysp::SyntheticBassDrum::SetFmEnvelopeDecay (
    float fm_envelope_decay
) 

Sets how long the initial pitch sweep takes.

Parameters:

  • fm_envelope_decay Works 0-1.

function SetFreq

void daisysp::SyntheticBassDrum::SetFreq (
    float freq
) 

Set the bass drum's root frequency.

Parameters:

  • Frequency in Hz.

function SetSustain

void daisysp::SyntheticBassDrum::SetSustain (
    bool sustain
) 

Allows the drum to play continuously

Parameters:

  • sustain True sets the drum on infinite sustain.

function SetTone

void daisysp::SyntheticBassDrum::SetTone (
    float tone
) 

Sets the overall bright / darkness of the drum.

Parameters:

  • tone Works 0-1.

function SyntheticBassDrum

inline daisysp::SyntheticBassDrum::SyntheticBassDrum () 

function TransistorVCA

inline float daisysp::SyntheticBassDrum::TransistorVCA (
    float s,
    float gain
) 

Transistor VCA simulation.

Parameters:

  • s Input sample.
  • gain VCA gain.

function Trig

void daisysp::SyntheticBassDrum::Trig () 

Trigger the drum


function ~SyntheticBassDrum

inline daisysp::SyntheticBassDrum::~SyntheticBassDrum () 


The documentation for this class was generated from the following file external-docs/DaisySP/Source/Drums/synthbassdrum.h