DaisySP
Loading...
Searching...
No Matches
formantosc.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_FORMANTOSCILLATOR_H
11#define DSY_FORMANTOSCILLATOR_H
12
13#include <stdint.h>
14#ifdef __cplusplus
15
18namespace daisysp
19{
30{
31 public:
34
38 void Init(float sample_rate);
39
42 float Process();
43
47 void SetFormantFreq(float freq);
48
52 void SetCarrierFreq(float freq);
53
57 void SetPhaseShift(float ps);
58
59 private:
60 inline float Sine(float phase);
61 inline float ThisBlepSample(float t);
62 inline float NextBlepSample(float t);
63
64 // Oscillator state.
65 float carrier_phase_;
66 float formant_phase_;
67 float next_sample_;
68
69 // For interpolation of parameters.
70 float carrier_frequency_;
71 float formant_frequency_;
72 float phase_shift_;
73 float ps_inc_;
74
75 float sample_rate_;
76
77 //DISALLOW_COPY_AND_ASSIGN(FormantOscillator);
78};
79} //namespace daisysp
80#endif
81#endif
Formant Oscillator Module.
Definition formantosc.h:30
void SetCarrierFreq(float freq)
Definition formantosc.cpp:68
void SetFormantFreq(float freq)
Definition formantosc.cpp:59
float Process()
Definition formantosc.cpp:20
void SetPhaseShift(float ps)
Definition formantosc.cpp:77
void Init(float sample_rate)
Definition formantosc.cpp:7
FIR Filter implementation, generic and ARM CMSIS DSP based.
Definition adenv.h:16