-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathOurUDPProtocol.hh
41 lines (33 loc) · 996 Bytes
/
OurUDPProtocol.hh
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
#include <array>
class OurUDPProtocol {
public:
static constexpr double TIMESTEP = 0.010; // 10 ms
static constexpr unsigned int KEYBOARDSIZE = 88;
enum {SUSTAINCOMMAND = 0,
PITCHBENDDOWNCOMMAND,
MODULATECOMMAND,
PITCHBENDUPCOMMAND,
VOLUMECOMMAND,
COMMANDKEYS};
// Start package sent from the MUSIC side
struct startPackage {
int magicNumber;
double stopTime;
};
// Data package sent to MUSIC
struct toMusicPackage {
double timestamp;
std::array<double, KEYBOARDSIZE> keysPressed;
std::array<double, COMMANDKEYS> commandKeys;
};
static constexpr int TOMUSICPORT = 9931;
static constexpr int MAGICFROMMUSIC = 4712;
static constexpr char const * MIDISERVER_IP = "130.237.221.78"; // wand.pdc.kth.se
// Data package received from MUSIC
struct fromMusicPackage {
double timestamp;
std::array<double, KEYBOARDSIZE> keysPressed;
};
static constexpr int FROMMUSICPORT = 9930;
static constexpr int MAGICTOMUSIC = 4711;
};