aboutsummaryrefslogtreecommitdiff
path: root/audio/softsynth/mt32/AReverbModel.h
diff options
context:
space:
mode:
authorFilippos Karapetis2012-12-25 23:22:36 +0200
committerFilippos Karapetis2012-12-25 23:48:25 +0200
commitd9e555afd5932c458f559034c6dca1df346ead4b (patch)
treee7d41c550ff221d47664dd7fe4b3c1d4c9aa8af8 /audio/softsynth/mt32/AReverbModel.h
parent0e5bfb66f03551f998405ce6674f3e6eab4a0150 (diff)
downloadscummvm-rg350-d9e555afd5932c458f559034c6dca1df346ead4b.tar.gz
scummvm-rg350-d9e555afd5932c458f559034c6dca1df346ead4b.tar.bz2
scummvm-rg350-d9e555afd5932c458f559034c6dca1df346ead4b.zip
MT32: Update the MT32 emulator to a newer munt commit
Previous munt commit was f969d20 (Nov 15, 2012) Current munt commit is 84b2819 (Dec 22, 2012) We are still missing the changes from commit 788f7b1 onwards (Dec 22, 2012). There are bigger ROM access-related changes from that point, which we'll have to integrate as well.
Diffstat (limited to 'audio/softsynth/mt32/AReverbModel.h')
-rw-r--r--audio/softsynth/mt32/AReverbModel.h57
1 files changed, 29 insertions, 28 deletions
diff --git a/audio/softsynth/mt32/AReverbModel.h b/audio/softsynth/mt32/AReverbModel.h
index 3fae08c34c..d70e9ee14f 100644
--- a/audio/softsynth/mt32/AReverbModel.h
+++ b/audio/softsynth/mt32/AReverbModel.h
@@ -1,5 +1,5 @@
/* Copyright (C) 2003, 2004, 2005, 2006, 2008, 2009 Dean Beeler, Jerome Fisher
- * Copyright (C) 2011 Dean Beeler, Jerome Fisher, Sergey V. Mikayev
+ * Copyright (C) 2011, 2012 Dean Beeler, Jerome Fisher, Sergey V. Mikayev
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
@@ -21,66 +21,67 @@
namespace MT32Emu {
struct AReverbSettings {
- const Bit32u *allpassSizes;
- const Bit32u *delaySizes;
- const float *decayTimes;
- const float *wetLevels;
- float filtVal;
- float damp1;
- float damp2;
+ const Bit32u * const allpassSizes;
+ const Bit32u * const combSizes;
+ const Bit32u * const outLPositions;
+ const Bit32u * const outRPositions;
+ const Bit32u * const filterFactor;
+ const Bit32u * const decayTimes;
+ const Bit32u * const wetLevels;
+ const Bit32u lpfAmp;
};
class RingBuffer {
protected:
float *buffer;
- Bit32u size;
+ const Bit32u size;
Bit32u index;
+
public:
- RingBuffer(Bit32u size);
+ RingBuffer(const Bit32u size);
virtual ~RingBuffer();
float next();
- bool isEmpty();
+ bool isEmpty() const;
void mute();
};
class AllpassFilter : public RingBuffer {
public:
- AllpassFilter(Bit32u size);
- float process(float in);
+ AllpassFilter(const Bit32u size);
+ float process(const float in);
};
-class Delay : public RingBuffer {
+class CombFilter : public RingBuffer {
+ float feedbackFactor;
+ float filterFactor;
+
public:
- Delay(Bit32u size);
- float process(float in);
+ CombFilter(const Bit32u size);
+ void process(const float in);
+ float getOutputAt(const Bit32u outIndex) const;
+ void setFeedbackFactor(const float useFeedbackFactor);
+ void setFilterFactor(const float useFilterFactor);
};
class AReverbModel : public ReverbModel {
AllpassFilter **allpasses;
- Delay **delays;
+ CombFilter **combs;
- const AReverbSettings *currentSettings;
- float decayTime;
+ const AReverbSettings &currentSettings;
+ float lpfAmp;
float wetLevel;
- float filterhist1, filterhist2;
- float combhist;
void mute();
+
public:
- AReverbModel(const AReverbSettings *newSettings);
+ AReverbModel(const ReverbMode mode);
~AReverbModel();
void open(unsigned int sampleRate);
void close();
void setParameters(Bit8u time, Bit8u level);
void process(const float *inLeft, const float *inRight, float *outLeft, float *outRight, unsigned long numSamples);
bool isActive() const;
-
- static const AReverbSettings REVERB_MODE_0_SETTINGS;
- static const AReverbSettings REVERB_MODE_1_SETTINGS;
- static const AReverbSettings REVERB_MODE_2_SETTINGS;
};
-// Default reverb settings for modes 0-2
-
}
#endif