DaisySP
Loading...
Searching...
No Matches
metro.h
1/*
2Copyright (c) 2020 Electrosmith, Corp
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_METRO_H
11#define DSY_METRO_H
12#include <stdint.h>
13#ifdef __cplusplus
14
15namespace daisysp
16{
19class 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
Definition metro.h:20
float GetFreq()
Definition metro.h:46
void SetFreq(float freq)
Definition metro.cpp:26
void Reset()
Definition metro.h:39
void Init(float freq, float sample_rate)
Definition metro.cpp:7
uint8_t Process()
Definition metro.cpp:15
FIR Filter implementation, generic and ARM CMSIS DSP based.
Definition adenv.h:16