-
Notifications
You must be signed in to change notification settings - Fork 16
/
ModuleLooper.h
46 lines (36 loc) · 857 Bytes
/
ModuleLooper.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
40
41
42
43
44
45
46
/*
* +------------------------+
* | ModuleLooper |
* |------------------------|
* > trigger_input |
* > sample_rate_input |
* | output >
* +------------------------+
*
*/
// =============================================================================
//
//
#ifndef ModuleLooper_h
#define ModuleLooper_h
#include "Arduino.h"
#include "Module.h"
class ModuleLooper : public Module
{
public:
ModuleLooper();
uint16_t compute();
// Inputs
Module *sample_input;
Module *sample_rate_input;
Module *slice_input;
Module *trigger_input;
private:
boolean triggered;
boolean playing;
uint32_t t; // Accumulator used in equations
uint32_t w; // The final output
uint32_t fixed_point_20_12_index;
void stop_playback();
};
#endif