timidity_instrum.h

Go to the documentation of this file.
00001 /*
00002 
00003     TiMidity -- Experimental MIDI to WAVE converter
00004     Copyright (C) 1995 Tuukka Toivonen <toivonen@clinet.fi>
00005 
00006     This program is free software; you can redistribute it and/or modify
00007     it under the terms of the GNU General Public License as published by
00008     the Free Software Foundation; either version 2 of the License, or
00009     (at your option) any later version.
00010 
00011     This program is distributed in the hope that it will be useful,
00012     but WITHOUT ANY WARRANTY; without even the implied warranty of
00013     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014     GNU General Public License for more details.
00015 
00016     You should have received a copy of the GNU General Public License
00017     along with this program; if not, write to the Free Software
00018     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00019 
00020    instrum.h
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 /* Bits in modes: */
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 /* A hack to delay instrument loading until after reading the
00075    entire MIDI file. */
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

Generated on Fri Jul 27 22:27:44 2007 for pentagram by  doxygen 1.4.7