Skip to content

daisysp::SyntheticBassDrum

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

#include <synthbassdrum.h>

Public Functions

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

Detailed Description

class daisysp::SyntheticBassDrum;

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

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 SyntheticBassDrum

inline SyntheticBassDrum()

function ~SyntheticBassDrum

inline ~SyntheticBassDrum()

function Init

void Init(
    float sample_rate
)

Parameters:

  • sample_rate Audio engine sample rate.

Init the module


function DistortedSine

inline float DistortedSine(
    float phase,
    float phase_noise,
    float dirtiness
)

Generates a distorted sine wave


function TransistorVCA

inline float TransistorVCA(
    float s,
    float gain
)

Parameters:

  • s Input sample.
  • gain VCA gain.

Transistor VCA simulation.


function Process

float Process(
    bool trigger =false
)

Parameters:

  • trigger True triggers the BD. This is optional.

Get the next sample.


function Trig

void Trig()

Trigger the drum


function SetSustain

void SetSustain(
    bool sustain
)

Parameters:

  • sustain True sets the drum on infinite sustain.

Allows the drum to play continuously


function SetAccent

void SetAccent(
    float accent
)

Parameters:

  • accent Works 0-1.

Sets the amount of accent.


function SetFreq

void SetFreq(
    float freq
)

Parameters:

  • Frequency in Hz.

Set the bass drum's root frequency.


function SetTone

void SetTone(
    float tone
)

Parameters:

  • tone Works 0-1.

Sets the overall bright / darkness of the drum.


function SetDecay

void SetDecay(
    float decay
)

Parameters:

  • Works 0-1.

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


function SetDirtiness

void SetDirtiness(
    float dirtiness
)

Parameters:

  • dirtiness Works 0-1.

Makes things grimy


function SetFmEnvelopeAmount

void SetFmEnvelopeAmount(
    float fm_envelope_amount
)

Parameters:

  • fm_envelope_amount Works 0-1.

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


function SetFmEnvelopeDecay

void SetFmEnvelopeDecay(
    float fm_envelope_decay
)

Parameters:

  • fm_envelope_decay Works 0-1.

Sets how long the initial pitch sweep takes.

---

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