1 /* midifns.h -- definitions for users of midifns.c */
2 
3 /*****************************************************************************
4 *           Change Log
5 *  Date     | Change
6 *-----------+-----------------------------------------------------------------
7 *  5-Mar-92 | GWL : insert definitions and logs from JMN's mpu.h
8 *                   for LATTICE322, only variable type in prototypes
9 * 28-Apr-03 |  DM : random() is now named cmtrand() to avoid conflicts
10 *****************************************************************************/
11 
12 #ifndef _MIDIFNS_H_
13 #define _MIDIFNS_H_
14 
15 /* declaration types */
16 
17 typedef unsigned long time_type;
18 typedef long sgnd_time_type;
19 
20 /* Maximum time value: */
21 #define MAXTIME 0xFFFFFFFFL
22 
23 #define delay_type      long
24 
25 /* controller numbers */
26 
27 #define MODWHEEL        1
28 #define BREATH          2
29 #define FOOT            4
30 #define PORTARATE       5
31 #define VOLUME          7
32 #define SUSTAIN         64
33 #define PORTASWITCH     65
34 
35 #include "midierr.h"
36 
37 extern char *midifns_syntax;
38 
39 /* support for allocating sysex buffer - examples in mm.c & exget.c */
40 #ifdef DOS
41 #define midibuff_alloc(size) (byte huge *) halloc(size, 1)
42 #endif
43 #ifndef midibuff_alloc
44 #define midibuff_alloc (byte *) MALLOC
45 #endif
46 
47 /* DMH: from mpu.h -- definitions for users of mpu.c */
48 
49 #ifdef OLD_PROTOTYPES
50 
51 void    eventwait();
52 void    exclusive(boolean);
53 boolean getbuf(boolean, unsigned char * );
54 long	get_excl();
55 boolean getxbuf();
56 boolean testxbuf();
57 short   getkey(boolean);
58 ulong   gettime(void);          /*DMH: note- now unsigned*/
59 void    l_rest(long);
60 void    l_restuntil(long);
61 void    metronome(boolean);
62 void    midi_bend(short,short);
63 boolean midi_buffer(byte * , ulong);
64 void    midi_cont(boolean);
65 void    midi_clock();
66 void    midi_ctrl(short, short, short);
67 void    midi_exclusive(unsigned char * );
68 void    midi_note(short, short, short);
69 void    midi_program(short, short);
70 void    midi_real();
71 void    midi_start();
72 void    midi_stop();
73 #ifdef AMIGA
74 /* MIDI_THRU defined means that it is really implemented. */
75 #define MIDI_THRU
76 #endif
77 void    midi_thru();/*boolean onflag*/
78 void    midi_touch(short, short);
79 void    midi_write();
80 void    musicinit();
81 short	  cmtrand(short, short);
82 void    read_tuning();/*char *filename*/
83 void    settime();
84 void    synth_init();/*void*/
85 void    timereset();
86 void    trace();
87 void    tracemidi();
88 boolean is_exclusive(void);
89 unsigned char get_exclusive(void);
90 
91 #else
92 
93 void alloff(void);
94 void eventwait(long timeout);
95 void exclusive(boolean onflag);
96 long get_excl(byte *buffer, long len);
97 boolean getbuf(boolean waitflag, unsigned char * p);
98 short getkey(boolean waitflag);
99 ulong gettime(void);
100 void l_rest(long time);
101 void l_restuntil(long time);
102 void metronome(boolean onflag);
103 void midi_bend(int channel, int value);
104 boolean midi_buffer(byte *buffer, ulong size);
105 void midi_clock(void);
106 void midi_cont(boolean onflag);
107 void midi_ctrl(int channel, int control, int value);
108 void midi_exclusive(unsigned char *msg);
109 void midi_flush(void);
110 void midi_note(int channel, int pitch, int velocity);
111 void midi_program(int channel, int program);
112 void midi_real(boolean onflag);
113 void midi_start(void);
114 void midi_stop(void);
115 void midi_thru(boolean onflag);
116 void midi_touch(int channel, int value);
117 void read_tuning(char *filename);
118 void midi_write(int n, int port, unsigned char c1, unsigned char c2, unsigned char c3);
119 void midi_write_trace(int n, int port,
120               unsigned char c1, unsigned char c2, unsigned char c3);
121 void musicinit(void);
122 void settime(time_type newtime);
123 void timereset(void);
124 void trace(boolean flag);
125 void tracemidi(boolean flag);
126 
127 
128 boolean check_midi(void);
129 #endif  /* ifdef OLD_PROTOTYPES */
130 
131 
132 #ifdef AMIGA
133 byte    *head_of_excl();
134 byte    *tail_of_excl();
135 #endif
136 
137 #endif /* _MIDIFNS_H_ */
138