-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathseq.h
49 lines (41 loc) · 784 Bytes
/
seq.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
47
48
49
#ifndef SEQ_H
#define SEQ_H
#include "daisysp.h"
#include "register.h"
#include "synth.h"
#include "quantizer.h"
using namespace daisysp;
struct NoteClock
{
Oscillator clock;
float speed = 15.f;
bool gate = false;
bool done = false;
};
struct Clock
{
Oscillator mainClock;
bool run = false;
float speed = 1.f;
std::vector<NoteClock> noteClocks;
};
class Seq
{
public:
enum class Param
{
SPEED,
SPREAD,
};
Seq(int numNoteClocks);
void Init(Register *reg, Synth *synth, Quantizer *quantizer, float sampleRate);
void Process();
void SetParam(Param param, float value);
private:
float sampleRate_;
Clock clock_;
Register *reg_;
Synth *synth_;
Quantizer *quantizer_;
};
#endif // SEQ_H