diff options
author | Jerome Fisher | 2004-11-28 05:35:07 +0000 |
---|---|---|
committer | Jerome Fisher | 2004-11-28 05:35:07 +0000 |
commit | 077d19f5008e5cb911b1291f59b63fc46da18cc8 (patch) | |
tree | d3361671ac04d9d7f0e5e4354a78f4bd48a847d1 /backends/midi/mt32/partial.h | |
parent | 67b8abac08befed3e545dd500df4f28b7524348a (diff) | |
download | scummvm-rg350-077d19f5008e5cb911b1291f59b63fc46da18cc8.tar.gz scummvm-rg350-077d19f5008e5cb911b1291f59b63fc46da18cc8.tar.bz2 scummvm-rg350-077d19f5008e5cb911b1291f59b63fc46da18cc8.zip |
- Added graphical representation of initialisation progress. This is quite hacky.
- Initialisation is now interruptible.
- All data is now loaded from MT32_CONTROL.ROM. drumpat.rom, Preset1.syx, Preset2.syx and patchlog.cfg are no longer used.
- Major cleanup. In particular, separated Rhythm part into a new class, instead of dealing with it as a special case everywhere.
- Improved accuracy of pitch key-follow.
- Recaching now happens lazily.
- Changed some right-shifts to divs, due to the former not being arithmetic on some architectures.
- Setting "MT32EMU_ACCURATENOTES" to 1 will generate lookup tables for the exact frequency of every note played. Not recommended.
- Several small bugs fixed.
svn-id: r15929
Diffstat (limited to 'backends/midi/mt32/partial.h')
-rw-r--r-- | backends/midi/mt32/partial.h | 35 |
1 files changed, 19 insertions, 16 deletions
diff --git a/backends/midi/mt32/partial.h b/backends/midi/mt32/partial.h index 2760b8fa2a..52b07bfeb1 100644 --- a/backends/midi/mt32/partial.h +++ b/backends/midi/mt32/partial.h @@ -33,7 +33,7 @@ enum EnvelopeType { EnvelopeType_pitch = 2 }; -struct envstatus { +struct EnvelopeStatus { Bit32s envpos; Bit32s envstat; Bit32s envbase; @@ -51,7 +51,7 @@ struct envstatus { // Class definition of MT-32 partials. 32 in all. class Partial { private: - Synth *synth; // Only used for sending debug output + Synth *synth; int ownerPart; // -1 if unassigned int mixType; @@ -63,25 +63,28 @@ private: bool play; // Keyfollowed note value +#if MT32EMU_ACCURATENOTES == 1 + NoteLookup noteLookupStorage; + float noteVal; +#else int noteVal; - NoteLookup *noteLookup; // Lookup stuff for this noteVal - - int keyVal; - NoteLookup *keyLookup; + int fineShift; +#endif + const NoteLookup *noteLookup; // LUTs for this noteVal // Keyfollowed filter values int realVal; int filtVal; - envstatus envs[3]; + EnvelopeStatus envs[3]; int pulsewidth; Bit32u lfoPos; soundaddr partialOff; - Bit32u ampEnvCache; - Bit32u pitchEnvCache; + Bit32u ampEnvVal; + Bit32u pitchEnvVal; float history[32]; @@ -93,19 +96,19 @@ private: int bendShift; - Bit16s *mixBuffers(Bit16s * buf1, Bit16s * buf2, int len); - Bit16s *mixBuffersRingMix(Bit16s * buf1, Bit16s * buf2, int len); - Bit16s *mixBuffersRing(Bit16s * buf1, Bit16s * buf2, int len); - void mixBuffersStereo(Bit16s * buf1, Bit16s * buf2, Bit16s * outBuf, int len); + Bit16s *mixBuffers(Bit16s *buf1, Bit16s *buf2, int len); + Bit16s *mixBuffersRingMix(Bit16s *buf1, Bit16s *buf2, int len); + Bit16s *mixBuffersRing(Bit16s *buf1, Bit16s *buf2, int len); + void mixBuffersStereo(Bit16s *buf1, Bit16s *buf2, Bit16s *outBuf, int len); Bit32s getFiltEnvelope(); - Bit32s getAmpEnvelope(); + Bit32u getAmpEnvelope(); Bit32s getPitchEnvelope(); void initKeyFollow(int freqNum); public: - PatchCache *patchCache; + const PatchCache *patchCache; PatchCache cachebackup; Partial *pair; @@ -119,7 +122,7 @@ public: bool isActive(); void activate(int part); void deactivate(void); - void startPartial(dpoly *usePoly, PatchCache *useCache, Partial *pairPartial); + void startPartial(dpoly *usePoly, const PatchCache *useCache, Partial *pairPartial); void startDecay(EnvelopeType envnum, Bit32s startval); void startDecayAll(); void setBend(float factor); |