diff options
author | Jerome Fisher | 2004-11-14 08:04:56 +0000 |
---|---|---|
committer | Jerome Fisher | 2004-11-14 08:04:56 +0000 |
commit | 504d54e8ab65dc68d71ac1a77ad4a393fb69e3e9 (patch) | |
tree | 010ff1888a14d19f860fd99252fc910421188d03 /backends/midi/mt32/tables.h | |
parent | 0ed79dfad78aeb61961c7f865e8cc7f45840fe28 (diff) | |
download | scummvm-rg350-504d54e8ab65dc68d71ac1a77ad4a393fb69e3e9.tar.gz scummvm-rg350-504d54e8ab65dc68d71ac1a77ad4a393fb69e3e9.tar.bz2 scummvm-rg350-504d54e8ab65dc68d71ac1a77ad4a393fb69e3e9.zip |
- Huge cleanup of LUT stuff.
- No longer stores a sawtooth waveform twice, once with each sample negated.
- More graceful handling of truncated waveformcache files.
- Fixed tuning of patterns for non-32KHz sample rates (needs checking).
- Note: Waveform cache format changed, will automatically be rebuilt.
svn-id: r15804
Diffstat (limited to 'backends/midi/mt32/tables.h')
-rw-r--r-- | backends/midi/mt32/tables.h | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/backends/midi/mt32/tables.h b/backends/midi/mt32/tables.h index 3e73400edf..46be3f1548 100644 --- a/backends/midi/mt32/tables.h +++ b/backends/midi/mt32/tables.h @@ -42,7 +42,7 @@ const int MIDDLEA = 69; // By this I mean "A above middle C" // FIXME:KG: Keeping it at 440.0f for now, as in original. Check with CC const float TUNING = 440.0f; -const int NUM_NOTES = 128; // MIDI supports 128 notes/keys +const int NUM_NOTES = 128; // Number of slots for note LUT (we actually only use 12..108) // Amplitude of waveform generator const int WGAMP = 7168; // 8192? @@ -55,17 +55,12 @@ extern Bit16s smallnoise[MAX_SAMPLE_OUTPUT]; // Some optimization stuff extern Bit32s keytable[217]; -extern Bit32s divtable[NUM_NOTES]; -extern Bit32s smalldivtable[NUM_NOTES]; -extern Bit32u wavtabler[54][NUM_NOTES]; -extern Bit32u looptabler[9][10][NUM_NOTES]; extern Bit16s sintable[65536]; extern Bit32u lfotable[101]; extern Bit32s penvtable[16][101]; extern Bit32s filveltable[128][101]; extern Bit32s veltkeytable[5][128]; extern Bit32s pulsetable[101]; -extern Bit32s sawtable[NUM_NOTES][101]; extern Bit32s ampbiastable[13][128]; extern Bit32s fbiastable[15][128]; extern float filtcoeff[FILTERGRAN][31][8]; @@ -79,23 +74,28 @@ extern Bit32s lasttimetable[101]; extern Bit32s voltable[128]; extern float ResonInv[31]; -extern Bit16s freqtable[NUM_NOTES]; -extern Bit32s fildeptable[5][NUM_NOTES]; -extern Bit32s timekeytable[5][NUM_NOTES]; -extern int filttable[2][NUM_NOTES][201]; -extern int nfilttable[NUM_NOTES][101][101]; - -extern const Bit8s LoopPatterns[9][10]; +struct NoteLookup { + Bit32s div; + Bit32u wavTable[54]; + Bit32u loopTable[9][10]; + Bit32s sawTable[101]; + Bit32s fildepTable[5]; + Bit32s timekeyTable[5]; + int filtTable[2][201]; + int nfiltTable[101][101]; + Bit16s *waveforms[3]; + Bit32u waveformSize[3]; +}; -extern Bit16s *waveforms[4][NUM_NOTES]; -extern Bit32u waveformsize[4][NUM_NOTES]; +extern NoteLookup noteLookups[NUM_NOTES]; class TableInitialiser { static void initMT32ConstantTables(Synth *synth); - static void initWave(Synth *synth, File *file, bool reading, bool writing, int f, float freq, float rate, double ampsize, Bit32s div); - static void initNotes(Synth *synth, PCMWave pcms[54], float rate); + static File *initWave(Synth *synth, NoteLookup *noteLookup, float ampsize, float div, File *file); + static void initNotes(Synth *synth, PCMWave pcms[54], float rate, float tuning); public: static bool initMT32Tables(Synth *synth, PCMWave pcms[54], float sampleRate); + static File *initNote(Synth *synth, NoteLookup *noteLookup, float note, float rate, float tuning, PCMWave pcmWaves[54], File *file); }; } |