1 /* definitions for MIDI file parsing code */ 2 extern int (*Mf_getc)(); 3 extern void (*Mf_header)(); 4 extern void (*Mf_trackstart)(); 5 extern void (*Mf_trackend)(); 6 extern void (*Mf_noteon)(); 7 extern void (*Mf_noteoff)(); 8 extern void (*Mf_pressure)(); 9 extern void (*Mf_parameter)(); 10 extern void (*Mf_pitchbend)(); 11 extern void (*Mf_program)(); 12 extern void (*Mf_chanpressure)(); 13 extern void (*Mf_sysex)(); 14 extern void (*Mf_metamisc)(); 15 extern void (*Mf_seqspecific)(); 16 extern void (*Mf_seqnum)(); 17 extern void (*Mf_text)(); 18 extern void (*Mf_eot)(); 19 extern void (*Mf_timesig)(); 20 extern void (*Mf_smpte)(); 21 extern void (*Mf_tempo)(); 22 extern void (*Mf_keysig)(); 23 extern void (*Mf_arbitrary)(); 24 extern void (*Mf_error)(); 25 extern unsigned long Mf_currtime; 26 extern unsigned long Mf_realtime; 27 extern unsigned long Mf_currtempo; 28 extern int Mf_division; 29 extern int Mf_nomerge; 30 #ifdef READ_MODS 31 extern unsigned char *Mf_file_contents; 32 extern int Mf_file_size; 33 #endif 34 35 /* definitions for MIDI file writing code */ 36 extern int (*Mf_putc)(); 37 extern int (*Mf_writetrack)(); 38 extern int (*Mf_writetempotrack)(); 39 40 extern void midifile(); 41 extern unsigned long mf_sec2ticks(); 42 extern void mfwrite(); 43 extern int mf_write_meta_event(); 44 extern int mf_write_midi_event(unsigned long delta_time, int type, 45 int chan, char *data, unsigned long size); 46 extern double mf_ticks2sec(unsigned long ticks,int division,unsigned long tempo); 47 extern void mf_write_tempo(); 48 extern void mf_write_seqnum(); 49 extern void mfread(); 50 extern void mferror(char *s); 51 52 #ifndef NO_LC_DEFINES 53 /* MIDI status commands most significant bit is 1 */ 54 #define note_off 0x80 55 #define note_on 0x90 56 #define poly_aftertouch 0xa0 57 #define control_change 0xb0 58 #define program_chng 0xc0 59 #define channel_aftertouch 0xd0 60 #define pitch_wheel 0xe0 61 #define system_exclusive 0xf0 62 #define delay_packet (1111) 63 64 /* 7 bit controllers */ 65 #define damper_pedal 0x40 66 #define portamento 0x41 67 #define sustenuto 0x42 68 #define soft_pedal 0x43 69 #define general_4 0x44 70 #define hold_2 0x45 71 #define general_5 0x50 72 #define general_6 0x51 73 #define general_7 0x52 74 #define general_8 0x53 75 #ifndef PLAYMIDI 76 #define tremolo_depth 0x5c 77 #define ctrl_chorus_depth 0x5d 78 #define detune 0x5e 79 #define phaser_depth 0x5f 80 #endif 81 82 /* parameter values */ 83 #define data_inc 0x60 84 #define data_dec 0x61 85 86 /* parameter selection */ 87 #define non_reg_lsb 0x62 88 #define non_reg_msb 0x63 89 #define reg_lsb 0x64 90 #define reg_msb 0x65 91 92 /* Standard MIDI Files meta event definitions */ 93 #define meta_event 0xFF 94 #define sequence_number 0x00 95 #define text_event 0x01 96 #define copyright_notice 0x02 97 #define sequence_name 0x03 98 #define instrument_name 0x04 99 #define lyric 0x05 100 #define marker 0x06 101 #define cue_point 0x07 102 #define channel_prefix 0x20 103 #define end_of_track 0x2f 104 #define set_tempo 0x51 105 #define smpte_offset 0x54 106 #define time_signature 0x58 107 #define key_signature 0x59 108 #define sequencer_specific 0x74 109 110 /* Manufacturer's ID number */ 111 #define Seq_Circuits (0x01) /* Sequential Circuits Inc. */ 112 #define Big_Briar (0x02) /* Big Briar Inc. */ 113 #define Octave (0x03) /* Octave/Plateau */ 114 #define Moog (0x04) /* Moog Music */ 115 #define Passport (0x05) /* Passport Designs */ 116 #define Lexicon (0x06) /* Lexicon */ 117 #define Tempi (0x20) /* Bon Tempi */ 118 #define Siel (0x21) /* S.I.E.L. */ 119 #define Kawai (0x41) 120 #define Roland (0x42) 121 #define Korg (0x42) 122 #define Yamaha (0x43) 123 #endif 124 125 /* miscellaneous definitions */ 126 #define MThd 0x4d546864 127 #define MTrk 0x4d54726b 128 129 #ifndef NO_LC_DEFINES 130 #define lowerbyte(x) ((unsigned char)(x & 0xff)) 131 #define upperbyte(x) ((unsigned char)((x & 0xff00)>>8)) 132 #endif 133