00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifdef USE_TIMIDITY_MIDI
00025
00026 #ifndef TIMIDITY_INSTNUM_H_INCLUDED
00027 #define TIMIDITY_INSTNUM_H_INCLUDED
00028
00029 #include "timidity.h"
00030
00031 #ifdef NS_TIMIDITY
00032 namespace NS_TIMIDITY {
00033 #endif
00034
00035 struct Sample {
00036 sint32
00037 loop_start, loop_end, data_length,
00038 sample_rate, low_freq, high_freq, root_freq;
00039 sint32
00040 envelope_rate[6], envelope_offset[6];
00041 float
00042 volume;
00043 sample_t *data;
00044 sint32
00045 tremolo_sweep_increment, tremolo_phase_increment,
00046 vibrato_sweep_increment, vibrato_control_ratio;
00047 uint8
00048 tremolo_depth, vibrato_depth,
00049 modes;
00050 sint8
00051 panning, note_to_use;
00052 };
00053
00054
00055 #define MODES_16BIT (1<<0)
00056 #define MODES_UNSIGNED (1<<1)
00057 #define MODES_LOOPING (1<<2)
00058 #define MODES_PINGPONG (1<<3)
00059 #define MODES_REVERSE (1<<4)
00060 #define MODES_SUSTAIN (1<<5)
00061 #define MODES_ENVELOPE (1<<6)
00062
00063 struct Instrument {
00064 int samples;
00065 Sample *sample;
00066 };
00067
00068 struct ToneBankElement {
00069 char *name;
00070 Instrument *instrument;
00071 int note, amp, pan, strip_loop, strip_envelope, strip_tail;
00072 };
00073
00074
00075
00076 #define MAGIC_LOAD_INSTRUMENT ((Instrument *)(-1))
00077
00078 struct ToneBank {
00079 ToneBankElement tone[128];
00080 };
00081
00082 extern ToneBank *tonebank[], *drumset[];
00083
00084 extern Instrument *default_instrument;
00085 extern int default_program;
00086 extern int antialiasing_allowed;
00087 extern int fast_decay;
00088 extern int free_instruments_afterwards;
00089
00090 #define SPECIAL_PROGRAM -1
00091
00092 extern int load_missing_instruments(void);
00093 extern void free_instruments(void);
00094 extern int set_default_instrument(char *name);
00095
00096 #ifdef NS_TIMIDITY
00097 };
00098 #endif
00099
00100 #endif
00101
00102 #endif //USE_TIMIDITY_MIDI