aboutsummaryrefslogtreecommitdiff
path: root/audio/softsynth/mt32/TVF.h
diff options
context:
space:
mode:
authorWillem Jan Palenstijn2013-04-18 23:35:23 +0200
committerWillem Jan Palenstijn2013-05-08 20:40:58 +0200
commit9c2341678ef4984bf92b3878295250faf980b066 (patch)
tree2fb4805e05e16b9924e80c9947e6bad723b28c4b /audio/softsynth/mt32/TVF.h
parent8172d679df5148a4a32f46074b20cb6caf91844f (diff)
parenta5f4ff36ffc386d48f2da49387a9655ce9295a4d (diff)
downloadscummvm-rg350-9c2341678ef4984bf92b3878295250faf980b066.tar.gz
scummvm-rg350-9c2341678ef4984bf92b3878295250faf980b066.tar.bz2
scummvm-rg350-9c2341678ef4984bf92b3878295250faf980b066.zip
Merge branch 'master'
Diffstat (limited to 'audio/softsynth/mt32/TVF.h')
-rw-r--r--audio/softsynth/mt32/TVF.h54
1 files changed, 54 insertions, 0 deletions
diff --git a/audio/softsynth/mt32/TVF.h b/audio/softsynth/mt32/TVF.h
new file mode 100644
index 0000000000..490d8de504
--- /dev/null
+++ b/audio/softsynth/mt32/TVF.h
@@ -0,0 +1,54 @@
+/* Copyright (C) 2003, 2004, 2005, 2006, 2008, 2009 Dean Beeler, Jerome Fisher
+ * Copyright (C) 2011 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
+ * the Free Software Foundation, either version 2.1 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef MT32EMU_TVF_H
+#define MT32EMU_TVF_H
+
+namespace MT32Emu {
+
+class TVF {
+private:
+ const Partial * const partial;
+ LA32Ramp *cutoffModifierRamp;
+ const TimbreParam::PartialParam *partialParam;
+
+ Bit8u baseCutoff;
+ int keyTimeSubtraction;
+ unsigned int levelMult;
+
+ Bit8u target;
+ unsigned int phase;
+
+ void startRamp(Bit8u newTarget, Bit8u newIncrement, int newPhase);
+ void nextPhase();
+
+public:
+ TVF(const Partial *partial, LA32Ramp *cutoffModifierRamp);
+ void reset(const TimbreParam::PartialParam *partialParam, Bit32u basePitch);
+ // Returns the base cutoff (without envelope modification).
+ // The base cutoff is calculated when reset() is called and remains static
+ // for the lifetime of the partial.
+ // Barring bugs, the number returned is confirmed accurate
+ // (based on specs from Mok).
+ Bit8u getBaseCutoff() const;
+ void handleInterrupt();
+ void startDecay();
+};
+
+}
+
+#endif