midiApp.h 1.87 KB
/*
 * 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