Skip to content

daisysp::SyntheticSnareDrum

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

#include <synthsnaredrum.h>

Public Functions

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

Detailed Description

class daisysp::SyntheticSnareDrum;

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

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 SyntheticSnareDrum

inline SyntheticSnareDrum()

function ~SyntheticSnareDrum

inline ~SyntheticSnareDrum()

function Init

void Init(
    float sample_rate
)

Parameters:

  • sample_rate Audio engine sample rate

Init the module


function Process

float Process(
    bool trigger =false
)

Parameters:

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

Get the next sample.


function Trig

void Trig()

Trigger the drum


function SetSustain

void SetSustain(
    bool sustain
)

Parameters:

  • sustain True = infinite sustain.

Make the drum ring out infinitely.


function SetAccent

void SetAccent(
    float accent
)

Parameters:

  • accent Works 0-1.

Set how much accent to use


function SetFreq

void SetFreq(
    float f0
)

Parameters:

  • f0 Freq in Hz

Set the drum's root frequency


function SetFmAmount

void SetFmAmount(
    float fm_amount
)

Parameters:

  • fm_amount Works from 0 - 1.

Set the amount of fm sweep.


function SetDecay

void SetDecay(
    float decay
)

Parameters:

  • decay Works with positive numbers

Set the length of the drum decay


function SetSnappy

void SetSnappy(
    float snappy
)

Parameters:

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

Sets the mix between snare and drum.

---

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