summaryrefslogtreecommitdiffstats
path: root/arts/midi/midimsg.h
blob: 3bba90d7ec5cdf61794941b91c0c01e7e53c3ba5 (plain)
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

#ifndef MIDIMSG_H
#define MIDIMSG_H

typedef unsigned char Byte;

#define MIDIMSG_NOTE_OFF 0x80
#define MIDIMSG_NOTE_ON 0x90
#define MIDIMSG_KEY_PRESSURE 0xa0
#define MIDIMSG_PARAMETER 0xb0
#define MIDIMSG_PROGRAM 0xc0
#define MIDIMSG_CHANNEL_PRESSURE 0xd0
#define MIDIMSG_PITCH_WHEEL 0xe0

#ifndef True
#define True  1
#define False 0
#endif

int  midimsgGetMessageType(Byte *message);
void midimsgSetMessageType(Byte *message_inout, int message_type);

int  midimsgGetChannel(Byte *message);
void midimsgSetChannel(Byte *message_inout, int channel);

int  midimsgGetPitch(Byte *message);
void midimsgSetPitch(Byte *message_inout, int pitch);

int  midimsgGetVelocity(Byte *message);
void midimsgSetVelocity(Byte *message_inout, int velocity);

int  midimsgGetParameterNumber(Byte *message);
void midimsgSetParameterNumber(Byte *message_inout, int number);

int  midimsgGetParameterValue(Byte *message);
void midimsgSetParameterValue(Byte *message_inout, int value);

int  midimsgGetPitchWheelValue(Byte *message);

void midimsgRead(int fd, Byte *message_return);
void midimsgWrite(int fd, Byte *message_return);

#endif