DaisySP
Loading...
Searching...
No Matches
modalvoice.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_MODAL_H
11#define DSY_MODAL_H
12
13#include <stdint.h>
14#include "Filters/svf.h"
16#include "Noise/dust.h"
17#ifdef __cplusplus
18
21namespace daisysp
22{
34{
35 public:
36 ModalVoice() {}
37 ~ModalVoice() {}
38
42 void Init(float sample_rate);
43
47 float Process(bool trigger = false);
48
52 void SetSustain(bool sustain);
53
55 void Trig();
56
60 void SetFreq(float freq);
61
65 void SetAccent(float accent);
66
70 void SetStructure(float structure);
71
75 void SetBrightness(float brightness);
76
80 void SetDamping(float damping);
81
83 float GetAux();
84
85 private:
86 float sample_rate_;
87
88 bool sustain_, trig_;
89 float f0_, structure_, brightness_, damping_;
90 float density_, accent_;
91 float aux_;
92
93 ResonatorSvf<1> excitation_filter_;
94 Resonator resonator_;
95 Dust dust_;
96};
97} // namespace daisysp
98#endif
99#endif
Dust Module.
Definition dust.h:32
Simple modal synthesis voice with a mallet exciter: click -> LPF -> resonator.
Definition modalvoice.h:34
void SetStructure(float structure)
Definition modalvoice.cpp:46
void SetDamping(float damping)
Definition modalvoice.cpp:57
void SetFreq(float freq)
Definition modalvoice.cpp:34
void SetSustain(bool sustain)
Definition modalvoice.cpp:24
void Init(float sample_rate)
Definition modalvoice.cpp:6
void SetBrightness(float brightness)
Definition modalvoice.cpp:51
float GetAux()
Definition modalvoice.cpp:62
void Trig()
Definition modalvoice.cpp:29
float Process(bool trigger=false)
Definition modalvoice.cpp:67
void SetAccent(float accent)
Definition modalvoice.cpp:41
Resonant Body Simulation.
Definition resonator.h:134
SVF for use in the Resonator Class .
Definition resonator.h:35
FIR Filter implementation, generic and ARM CMSIS DSP based.
Definition adenv.h:16