midi.h 494 Bytes
Newer Older
Jacob Vosmaer's avatar
Jacob Vosmaer committed
1 2 3
#ifndef midi_h
#define midi_h

4
#include <stdint.h>
Jacob Vosmaer's avatar
Jacob Vosmaer committed
5

Jacob Vosmaer's avatar
Jacob Vosmaer committed
6 7 8
enum _statuses {
	MIDI_NOTE_ON,
	MIDI_NOTE_OFF,
9
	MIDI_PROGRAM_CHANGE,
10
	MIDI_CONTROL_CHANGE,
Jacob Vosmaer's avatar
Jacob Vosmaer committed
11
	MIDI_PITCH_BEND,
12
	MIDI_NUM_STATUSES,
Jacob Vosmaer's avatar
Jacob Vosmaer committed
13
};
Jacob Vosmaer's avatar
Jacob Vosmaer committed
14

Jacob Vosmaer's avatar
Jacob Vosmaer committed
15 16 17
enum _cc {
	CC_MOD_WHEEL = 1,
	CC_DETUNE = 14,
18 19
	CC_PITCH_ENV_DECAY = 15,
	CC_PITCH_ENV_AMOUNT = 16,
Jacob Vosmaer's avatar
Jacob Vosmaer committed
20 21 22
	CC_VIB_RATE = 76,
};

23
void midi_init(void);
Jacob Vosmaer's avatar
Jacob Vosmaer committed
24 25
void midi_set_channel(uint8_t channel);

Jacob Vosmaer's avatar
Jacob Vosmaer committed
26 27 28 29 30
enum {
	MIDI_READ_OK,
	MIDI_READ_NO_DATA,
};

Jacob Vosmaer's avatar
Jacob Vosmaer committed
31
uint8_t midi_read(uint8_t *status, uint8_t *data1, uint8_t *data2);
Jacob Vosmaer's avatar
Jacob Vosmaer committed
32

Jacob Vosmaer's avatar
Jacob Vosmaer committed
33
#endif