DaisySP
Loading...
Searching...
No Matches
analogbassdrum.h
Go to the documentation of this file.
1/*
2Copyright (c) 2020 Electrosmith, Corp, Emilie Gillet
3
4Use of this source code is governed by an MIT-style
5license that can be found in the LICENSE file or at
6https://opensource.org/licenses/MIT.
7*/
8
9#pragma once
10#ifndef DSY_ANALOG_BD_H
11#define DSY_ANALOG_BD_H
12
13#include <stdint.h>
14#ifdef __cplusplus
15
16#include "Synthesis/oscillator.h"
17#include "Filters/svf.h"
18
21namespace daisysp
22{
32{
33 public:
36
40 void Init(float sample_rate);
41
45 float Process(bool trigger = false);
46
48 void Trig();
49
53 void SetSustain(bool sustain);
54
58 void SetAccent(float accent);
59
63 void SetFreq(float f0);
64
68 void SetTone(float tone);
69
73 void SetDecay(float decay);
74
78 void SetAttackFmAmount(float attack_fm_amount);
79
83 void SetSelfFmAmount(float self_fm_amount);
84
85 private:
86 inline float Diode(float x);
87
88 float sample_rate_;
89
90 float accent_, f0_, tone_, decay_;
91 float attack_fm_amount_, self_fm_amount_;
92
93 bool trig_, sustain_;
94
95 int pulse_remaining_samples_;
96 int fm_pulse_remaining_samples_;
97 float pulse_;
98 float pulse_height_;
99 float pulse_lp_;
100 float fm_pulse_lp_;
101 float retrig_pulse_;
102 float lp_out_;
103 float tone_lp_;
104 float sustain_gain_;
105
106 Svf resonator_;
107
108 //for use in sin + cos osc. in sustain mode
109 float phase_;
110};
111} // namespace daisysp
112#endif
113#endif
808 bass drum model, revisited.
Definition analogbassdrum.h:32
void Trig()
Definition analogbassdrum.cpp:152
void SetSustain(bool sustain)
Definition analogbassdrum.cpp:157
void SetDecay(float decay)
Definition analogbassdrum.cpp:178
void SetSelfFmAmount(float self_fm_amount)
Definition analogbassdrum.cpp:189
float Process(bool trigger=false)
Definition analogbassdrum.cpp:50
void SetFreq(float f0)
Definition analogbassdrum.cpp:167
void Init(float sample_rate)
Definition analogbassdrum.cpp:7
void SetTone(float tone)
Definition analogbassdrum.cpp:173
void SetAccent(float accent)
Definition analogbassdrum.cpp:162
void SetAttackFmAmount(float attack_fm_amount)
Definition analogbassdrum.cpp:184
Definition svf.h:27
FIR Filter implementation, generic and ARM CMSIS DSP based.
Definition adenv.h:16