aboutsummaryrefslogtreecommitdiff
path: root/audio/softsynth/mt32/Synth.h
diff options
context:
space:
mode:
Diffstat (limited to 'audio/softsynth/mt32/Synth.h')
-rwxr-xr-xaudio/softsynth/mt32/Synth.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/audio/softsynth/mt32/Synth.h b/audio/softsynth/mt32/Synth.h
index 5561d8d5db..fe31d99f02 100755
--- a/audio/softsynth/mt32/Synth.h
+++ b/audio/softsynth/mt32/Synth.h
@@ -120,6 +120,8 @@ friend class PartialManager;
friend class Poly;
friend class Renderer;
friend class RhythmPart;
+friend class SamplerateAdapter;
+friend class SoxrAdapter;
friend class TVA;
friend class TVP;
@@ -254,6 +256,14 @@ public:
}
}
+ static inline Bit16s convertSample(float sample) {
+ return Synth::clipSampleEx(Bit32s(sample * 16384.0f)); // This multiplier takes into account the DAC bit shift
+ }
+
+ static inline float convertSample(Bit16s sample) {
+ return float(sample) / 16384.0f; // This multiplier takes into account the DAC bit shift
+ }
+
// Returns library version as an integer in format: 0x00MMmmpp, where:
// MM - major version number
// mm - minor version number