-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathwavefolder.h
39 lines (33 loc) · 872 Bytes
/
wavefolder.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#pragma once
#ifndef DSY_WAVEFOFOLDER_H
#define DSY_WAVEFOFOLDER_H
#include <math.h>
/** Basic wavefolder module.
Amplitude of input determines level of folding.
Amplitudes of magnitude > 1.0 will start to fold.
Original author(s) : Nick Donaldson
Year : 2022
*/
class Wavefolder {
public:
Wavefolder() {}
~Wavefolder() {}
/** Initializes the wavefolder module.
*/
void Init();
/** applies wavefolding to input
*/
float Process(float in);
/**
\param gain Set input gain.
Supports negative values for thru-zero
*/
inline void SetDrive(float gain);
/**
\param offset Offset odded to input (pre-gain) for asymmetrical folding.
*/
inline void SetOffset(float offset) { offset_ = offset; }
private:
float gain_, offset_, compens_;
};
#endif