-
Notifications
You must be signed in to change notification settings - Fork 0
/
data.h
40 lines (30 loc) · 1003 Bytes
/
data.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
#ifndef DEEPBEEP_DATA_H_
#define DEEPBEEP_DATA_H_
#include <exception>
#include <vector>
enum class Naturality {
Natural,
Sharp,
Flat
};
class Note {
private:
Note(int c4_distance, int sixteenths, Naturality modifier);
int c4_distance;
int sixteenths;
Naturality modifier;
public:
static Note whole(int c4_distance, Naturality modifier = Naturality::Natural);
static Note half(int c4_distance, Naturality modifier = Naturality::Natural);
static Note quarter(int c4_distance, Naturality modifier = Naturality::Natural);
static Note eigth(int c4_distance, Naturality modifier = Naturality::Natural);
static Note sixteenth(int c4_distance, Naturality modifier = Naturality::Natural);
int getPitch() const;
int getSixteenthsDuration() const;
Naturality getModifier() const;
float getFrequency() const;
float getUSecDuration() const;
};
using Chord = std::vector<Note>;
using Song = std::vector<Chord>;
#endif // DEEPBEEP_DATA_H_