DaisySP
Loading...
Searching...
No Matches
Source
Utility
metro.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_METRO_H
11
#define DSY_METRO_H
12
#include <stdint.h>
13
#ifdef __cplusplus
14
15
namespace
daisysp
16
{
19
class
Metro
20
{
21
public
:
22
Metro
() {}
23
~Metro
() {}
31
void
Init
(
float
freq,
float
sample_rate);
32
35
uint8_t
Process
();
36
39
inline
void
Reset
() { phs_ = 0.0f; }
42
void
SetFreq
(
float
freq);
43
46
inline
float
GetFreq
() {
return
freq_; }
47
48
private
:
49
float
freq_;
50
float
phs_, sample_rate_, phs_inc_;
51
};
52
}
// namespace daisysp
53
#endif
54
#endif
daisysp::Metro
Definition
metro.h:20
daisysp::Metro::GetFreq
float GetFreq()
Definition
metro.h:46
daisysp::Metro::SetFreq
void SetFreq(float freq)
Definition
metro.cpp:26
daisysp::Metro::Reset
void Reset()
Definition
metro.h:39
daisysp::Metro::Init
void Init(float freq, float sample_rate)
Definition
metro.cpp:7
daisysp::Metro::Process
uint8_t Process()
Definition
metro.cpp:15
daisysp
FIR Filter implementation, generic and ARM CMSIS DSP based.
Definition
adenv.h:16
Generated by
1.12.0