summaryrefslogtreecommitdiff
path: root/apps/plugins/midi/midiutil.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/midi/midiutil.c')
-rw-r--r--apps/plugins/midi/midiutil.c42
1 files changed, 23 insertions, 19 deletions
diff --git a/apps/plugins/midi/midiutil.c b/apps/plugins/midi/midiutil.c
index 0ab5a35..41a02ae 100644
--- a/apps/plugins/midi/midiutil.c
+++ b/apps/plugins/midi/midiutil.c
@@ -40,16 +40,18 @@
#define CTRL_PANNING 10
#define CHANNEL 1
-
+//Most of these are deprecated.. rampdown is used, maybe one other one too
#define STATE_ATTACK 1
#define STATE_DECAY 2
#define STATE_SUSTAIN 3
#define STATE_RELEASE 4
#define STATE_RAMPDOWN 5
+//Loop states
#define STATE_LOOPING 7
#define STATE_NONLOOPING 8
+//Various bits in the GUS mode byte
#define LOOP_ENABLED 4
#define LOOP_PINGPONG 8
#define LOOP_REVERSE 16
@@ -65,7 +67,8 @@ unsigned char chVol[16]; //Channel volume
unsigned char chPanLeft[16]; //Channel panning
unsigned char chPanRight[16];
unsigned char chPat[16]; //Channel patch
-unsigned char chPW[16]; //Channel pitch wheel, MSB
+unsigned char chPW[16]; //Channel pitch wheel, MSB only
+
struct GPatch * gusload(char *);
struct GPatch * patchSet[128];
@@ -118,8 +121,19 @@ struct MIDIfile
int numPatches;
};
-void *my_malloc(int size);
+
+void sendEvent(struct Event * ev);
+int tick(struct MIDIfile * mf);
+inline void setPoint(struct SynthObject * so, int pt);
+struct Event * getEvent(struct Track * tr, int evNum);
+int readTwoBytes(int file);
+int readFourBytes(int file);
+int readVarData(int file);
+int midimain(void * filename);
+
+
+//Rick's code
void *alloc(int size)
{
static char *offset = NULL;
@@ -143,7 +157,7 @@ void *alloc(int size)
totalSize -= size + 4;
return ret;
}
-
+/*
void *ralloc(char *offset, int len)
{
int size;
@@ -175,18 +189,13 @@ void *ralloc(char *offset, int len)
return ret;
}
-
+*/
void * allocate(int size)
{
return alloc(size);
}
-void sendEvent(struct Event * ev);
-int tick(struct MIDIfile * mf);
-inline void setPoint(struct SynthObject * so, int pt);
-struct Event * getEvent(struct Track * tr, int evNum);
-
unsigned char readChar(int file)
{
char buf[2];
@@ -211,11 +220,9 @@ int eof(int fd)
return size+1 == rb->lseek(fd, 0, SEEK_CUR);
}
-void printf(char *fmt, ...) {}
-
-//#define my_malloc(a) malloc(a)
-
+void printf(char *fmt, ...) {fmt=fmt; }
+/*
void *audio_bufferbase;
void *audio_bufferpointer;
unsigned int audio_buffer_free;
@@ -252,11 +259,8 @@ void setmallocpos(void *pointer)
audio_bufferpointer = pointer;
audio_buffer_free = audio_bufferpointer - audio_bufferbase;
}
-
+*/
void exit(int code)
{
+ code = code; //Stub function, kill warning for now
}
-
-void free(void * ptr)
-{
-} \ No newline at end of file