midiApp.h
1.87 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
/*
* midiApp.h
*/
#define STACKSIZE 0x1000
#ifdef _LANGUAGE_C
#include <dmedia/midi.h>
#include <audiotools.h>
#include <ramrom.h>
#define MAX_VOICES 32
#define MAX_SEQ_CHANNELS 16
#define MAX_BUFFER_LENGTH 1024
#define DMA_QUEUE_SIZE 50
#define MAX_UPDATES 128
#define MAX_SEQP_EVENTS 128
#define FX_BUFFER_SIZE 8192
#define AUDIO_HEAP_SIZE 250000
#define MAX_CLIST_SIZE 5000
#define MAX_AUDIO_LENGTH 640
#define FRAME_SIZE 320 /* Best if a multiple of 160 */
#define SAMPLES_RAMROM_ADDR 0x00030000
#define SAMPLES_MAX RAMROM_MSG_ADDR - SAMPLES_RAMROM_ADDR
#define MAX_RDRAM_ADDR 0x80400000
#define BANK_RDRAM_ADDR 0x80080000
#define BANK_MAX_SIZE MAX_RDRAM_ADDR - BANK_RDRAM_ADDR
#define LOOP_COUNT -1
#define MAX_MSGS 16
#define STATUS_TYPE 1
#define SYSEX_TYPE 2
#define MIDI_LOOP_START 239
#define MIDI_LOOP_END 1200
#define GET_8 1
#define GET_16 2
#define GET_32 3
#define SET_8 4
#define SET_16 5
#define SET_32 6
#define WRITE_BLOCK 7
#define START_SEQUENCE 8
#define WRITE_RAMROM 9
#define SET_BANK 10 /* presumes all pointers are already set. */
#define RESET_BANK 11 /* used when sequence is currently running */
#define GET_DEBUG 12
#define TRUE 1
#define FALSE 0
#ifndef MIN
# define MIN(a,b) (((a)<(b))?(a):(b))
#endif
typedef struct
{
unsigned char midiByte[4];
} midiMess;
typedef struct
{
int pcktType;
int numEvts;
midiMess mess[MAX_MSGS];
} midiBlock;
typedef struct
{
int pcktType;
int reqType;
int offset;
int value;
} SysExReq;
#endif