DaisySP
Loading...
Searching...
No Matches
Source
Synthesis
fm2.h
1
/*
2
Copyright (c) 2020 Electrosmith, Corp
3
4
Use of this source code is governed by an MIT-style
5
license that can be found in the LICENSE file or at
6
https://opensource.org/licenses/MIT.
7
*/
8
9
#pragma once
10
#ifndef DSY_FM2_H
11
#define DSY_FM2_H
12
13
#include <stdint.h>
14
#include "Synthesis/oscillator.h"
15
#ifdef __cplusplus
16
17
namespace
daisysp
18
{
26
class
Fm2
27
{
28
public
:
29
Fm2
() {}
30
~Fm2
() {}
31
35
void
Init
(
float
samplerate);
36
37
40
float
Process
();
41
45
void
SetFrequency
(
float
freq);
46
50
void
SetRatio
(
float
ratio);
51
55
void
SetIndex
(
float
index);
56
58
float
GetIndex
();
59
61
void
Reset
();
62
63
private
:
64
static
constexpr
float
kIdxScalar = 0.2f;
65
static
constexpr
float
kIdxScalarRecip = 1.f / kIdxScalar;
66
67
Oscillator
mod_, car_;
68
float
idx_;
69
float
freq_, lfreq_, ratio_, lratio_;
70
};
71
}
// namespace daisysp
72
#endif
73
#endif
daisysp::Fm2
Definition
fm2.h:27
daisysp::Fm2::Process
float Process()
Definition
fm2.cpp:26
daisysp::Fm2::GetIndex
float GetIndex()
Definition
fm2.cpp:56
daisysp::Fm2::Init
void Init(float samplerate)
Definition
fm2.cpp:5
daisysp::Fm2::Reset
void Reset()
Definition
fm2.cpp:61
daisysp::Fm2::SetIndex
void SetIndex(float index)
Definition
fm2.cpp:51
daisysp::Fm2::SetRatio
void SetRatio(float ratio)
Definition
fm2.cpp:46
daisysp::Fm2::SetFrequency
void SetFrequency(float freq)
Definition
fm2.cpp:41
daisysp::Oscillator
Definition
oscillator.h:21
daisysp
FIR Filter implementation, generic and ARM CMSIS DSP based.
Definition
adenv.h:16
Generated by
1.12.0