DaisySP
Loading...
Searching...
No Matches
stringvoice.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_STRINGVOICE_H
11#define DSY_STRINGVOICE_H
12
13#include "Filters/svf.h"
15#include "Noise/dust.h"
16#include <stdint.h>
17#ifdef __cplusplus
18
21namespace daisysp
22{
33{
34 public:
35 StringVoice() {}
36 ~StringVoice() {}
37
41 void Init(float sample_rate);
42
44 void Reset();
45
49 float Process(bool trigger = false);
50
54 void SetSustain(bool sustain);
55
57 void Trig();
58
62 void SetFreq(float freq);
63
67 void SetAccent(float accent);
68
72 void SetStructure(float structure);
73
77 void SetBrightness(float brightness);
78
82 void SetDamping(float damping);
83
85 float GetAux();
86
87 private:
88 float sample_rate_;
89
90 bool sustain_, trig_;
91 float f0_, brightness_, damping_;
92 float density_, accent_;
93 float aux_;
94
95 Dust dust_;
96 Svf excitation_filter_;
97 String string_;
98 size_t remaining_noise_samples_;
99};
100} // namespace daisysp
101#endif
102#endif
Dust Module.
Definition dust.h:32
Comb filter / KS string.
Definition KarplusString.h:36
Extended Karplus-Strong, with all the niceties from Rings.
Definition stringvoice.h:33
void SetFreq(float freq)
Definition stringvoice.cpp:39
void Reset()
Definition stringvoice.cpp:24
float GetAux()
Definition stringvoice.cpp:72
void SetAccent(float accent)
Definition stringvoice.cpp:46
void SetDamping(float damping)
Definition stringvoice.cpp:67
void Trig()
Definition stringvoice.cpp:34
void SetStructure(float structure)
Definition stringvoice.cpp:51
void SetBrightness(float brightness)
Definition stringvoice.cpp:61
void SetSustain(bool sustain)
Definition stringvoice.cpp:29
void Init(float sample_rate)
Definition stringvoice.cpp:7
float Process(bool trigger=false)
Definition stringvoice.cpp:77
Definition svf.h:27
FIR Filter implementation, generic and ARM CMSIS DSP based.
Definition adenv.h:16