2
$Id: instrum.h,v 1.28 2000/12/01 21:59:02 malte Exp $
4
TiMidity -- Experimental MIDI to WAVE converter
5
Copyright (C) 1995 Tuukka Toivonen <toivonen@clinet.fi>
7
This program is free software; you can redistribute it and/or modify
8
it under the terms of the GNU General Public License as published by
9
the Free Software Foundation; either version 2 of the License, or
10
(at your option) any later version.
12
This program is distributed in the hope that it will be useful,
13
but WITHOUT ANY WARRANTY; without even the implied warranty of
14
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
GNU General Public License for more details.
17
You should have received a copy of the GNU General Public License
18
along with this program; if not, write to the Free Software
19
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
30
loop_start, loop_end, data_length,
31
sample_rate, low_freq, high_freq, root_freq;
37
envelope_rate[7], envelope_offset[7],
38
modulation_rate[7], modulation_offset[7];
41
modEnvToFilterFc, modEnvToPitch, modLfoToFilterFc;
44
tremolo_sweep_increment, tremolo_phase_increment,
45
lfo_sweep_increment, lfo_phase_increment,
46
vibrato_sweep_increment;
48
vibrato_control_ratio,
51
reverberation, chorusdepth,
52
tremolo_depth, vibrato_depth,
55
panning, note_to_use, exclusiveClass;
57
scale_tuning, keyToModEnvHold, keyToModEnvDecay,
58
keyToVolEnvHold, keyToVolEnvDecay;
60
attenuation, freq_center;
62
freq_scale, vibrato_delay;
66
#define MODES_16BIT (1<<0)
67
#define MODES_UNSIGNED (1<<1)
68
#define MODES_LOOPING (1<<2)
69
#define MODES_PINGPONG (1<<3)
70
#define MODES_REVERSE (1<<4)
71
#define MODES_SUSTAIN (1<<5)
72
#define MODES_ENVELOPE (1<<6)
73
#define MODES_FAST_RELEASE (1<<7)
86
unsigned char *contents;
89
typedef struct _InstrumentLayer {
92
Instrument *instrument;
93
struct _InstrumentLayer *next;
102
InstrumentLayer *layer;
103
int font_type, sf_ix, last_used, tuning;
105
int note, amp, pan, strip_loop, strip_envelope, strip_tail;
107
int note, amp, pan, strip_loop, strip_envelope, strip_tail,
108
gm_num, tpgm, reverb, main_volume;
112
/* A hack to delay instrument loading until after reading the
114
#define MAGIC_LOAD_INSTRUMENT ((InstrumentLayer *)(-1))
117
#define SFXBANK (MAXBANK-1)
118
#define SFXDRUM1 (MAXBANK-2)
119
#define SFXDRUM2 (MAXBANK-1)
124
ToneBankElement tone[MAXPROG];
126
ToneBankElement tone[MAX_TONE_VOICES];
130
extern char *sf_file;
132
extern ToneBank *tonebank[], *drumset[];
134
extern ToneBank *tonebank[];
137
extern InstrumentLayer *default_instrument;
138
extern int default_program;
139
extern int antialiasing_allowed;
140
extern int fast_decay;
141
extern int free_instruments_afterwards;
142
extern int cutoff_allowed;
144
#define SPECIAL_PROGRAM -1
146
extern int load_missing_instruments(void);
147
extern void free_instruments(void);
148
extern void end_soundfont(void);
149
extern int set_default_instrument(char *name);
151
extern int32 convert_tremolo_sweep(uint8 sweep);
152
extern int32 convert_vibrato_sweep(uint8 sweep, int32 vib_control_ratio);
153
extern int32 convert_tremolo_rate(uint8 rate);
154
extern int32 convert_vibrato_rate(uint8 rate);
156
extern void init_soundfont(char *fname, int oldbank, int newbank, int level);
157
#ifdef FFF_HAS_BEEN_FIXED
158
extern InstrumentLayer *load_fff_patch(const char *name, int gm_num, int bank, int percussion,
159
int panning, int amp, int note_to_use, int strip_loop, int strip_envelope, int strip_tail);
161
extern InstrumentLayer *load_sbk_patch(const char *name, int gm_num, int bank, int percussion,
162
int panning, int amp, int note_to_use, int sf_ix);
163
extern int current_tune_number;
164
extern int max_patch_memory;
165
extern int current_patch_memory;