Skip to content

Class daisysp::SyntheticSnareDrum

ClassList > daisysp > SyntheticSnareDrum

Naive snare drum model (two modulated oscillators + filtered noise). More...

  • #include <synthsnaredrum.h>

Public Functions

Type Name
void Init (float sample_rate)
float Process (bool trigger=false)
void SetAccent (float accent)
void SetDecay (float decay)
void SetFmAmount (float fm_amount)
void SetFreq (float f0)
void SetSnappy (float snappy)
void SetSustain (bool sustain)
SyntheticSnareDrum ()
void Trig ()
~SyntheticSnareDrum ()

Detailed Description

Author:

Ben Sergentanis

Date:

Jan 2021 Uses a few magic numbers taken from the 909 schematics:

  • Ratio between the two modes of the drum set to 1.47.

  • Funky coupling between the two modes.

  • Noise coloration filters and envelope shapes for the snare.

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

Public Functions Documentation

function Init

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

Init the module

Parameters:

  • sample_rate Audio engine sample rate

function Process

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

Get the next sample.

Parameters:

  • trigger True = hit the drum. This argument is optional.

function SetAccent

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

Set how much accent to use

Parameters:

  • accent Works 0-1.

function SetDecay

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

Set the length of the drum decay

Parameters:

  • decay Works with positive numbers

function SetFmAmount

void daisysp::SyntheticSnareDrum::SetFmAmount (
    float fm_amount
) 

Set the amount of fm sweep.

Parameters:

  • fm_amount Works from 0 - 1.

function SetFreq

void daisysp::SyntheticSnareDrum::SetFreq (
    float f0
) 

Set the drum's root frequency

Parameters:

  • f0 Freq in Hz

function SetSnappy

void daisysp::SyntheticSnareDrum::SetSnappy (
    float snappy
) 

Sets the mix between snare and drum.

Parameters:

  • snappy 1 = just snare. 0 = just drum.

function SetSustain

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

Make the drum ring out infinitely.

Parameters:

  • sustain True = infinite sustain.

function SyntheticSnareDrum

inline daisysp::SyntheticSnareDrum::SyntheticSnareDrum () 

function Trig

void daisysp::SyntheticSnareDrum::Trig () 

Trigger the drum


function ~SyntheticSnareDrum

inline daisysp::SyntheticSnareDrum::~SyntheticSnareDrum () 


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