-
Notifications
You must be signed in to change notification settings - Fork 253
Expand file tree
/
Copy pathbytebeat_synth.h
More file actions
40 lines (29 loc) · 1.12 KB
/
bytebeat_synth.h
File metadata and controls
40 lines (29 loc) · 1.12 KB
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
#ifndef BYTEBEAT_SYNTH_H
#define BYTEBEAT_SYNTH_H
#include "daisy_patch.h"
#include "control_manager.h"
// *******************************************************************
//
// Bytebeat Synth h
//
// *******************************************************************
class BytebeatSynth {
public:
void Init(daisy::DaisyPatch* p) { patch = p; }
float GenerateSample();
void UpdateControls(ControlManager& controlManager);
int a, b, c, formulaIndex;
static const int FORMULA_COUNT = 6;
private:
daisy::DaisyPatch* patch;
// Bytebeat formulas
using BytebeatFunc = uint8_t (*)(uint32_t, BytebeatSynth*);
static BytebeatFunc formulaTable[];
static uint8_t BytebeatFormula0(uint32_t t, BytebeatSynth* synth);
static uint8_t BytebeatFormula1(uint32_t t, BytebeatSynth* synth);
static uint8_t BytebeatFormula2(uint32_t t, BytebeatSynth* synth);
static uint8_t BytebeatFormula3(uint32_t t, BytebeatSynth* synth);
static uint8_t BytebeatFormula4(uint32_t t, BytebeatSynth* synth);
static uint8_t BytebeatFormula5(uint32_t t, BytebeatSynth* synth);
};
#endif // BYTEBEAT_SYNTH_H