DaisySP
Loading...
Searching...
No Matches
clockednoise.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_CLOCKEDNOISE_H
11#define DSY_CLOCKEDNOISE_H
12
13#include <stdint.h>
14#ifdef __cplusplus
15
18namespace daisysp
19{
30{
31 public:
32 ClockedNoise() {}
33 ~ClockedNoise() {}
34
38 void Init(float sample_rate);
39
41 float Process();
42
46 void SetFreq(float freq);
47
49 void Sync();
50
51 private:
52 // Oscillator state.
53 float phase_;
54 float sample_;
55 float next_sample_;
56
57 // For interpolation of parameters.
58 float frequency_;
59
60 float sample_rate_;
61
62 static constexpr float kRandFrac = 1.f / (float)RAND_MAX;
63};
64} // namespace daisysp
65#endif
66#endif
Definition clockednoise.h:30
void Sync()
Definition clockednoise.cpp:56
void SetFreq(float freq)
Definition clockednoise.cpp:49
void Init(float sample_rate)
Definition clockednoise.cpp:7
float Process()
Definition clockednoise.cpp:17
FIR Filter implementation, generic and ARM CMSIS DSP based.
Definition adenv.h:16