aboutsummaryrefslogtreecommitdiff
path: root/src/adlmidi_midiplay.cpp
diff options
context:
space:
mode:
authorWohlstand <admin@wohlnet.ru>2020-09-09 12:01:08 +0300
committerWohlstand <admin@wohlnet.ru>2020-09-09 12:01:08 +0300
commit20b8c754c09ea9bc0c65b81ea716324f2c5391be (patch)
tree7e614f353b1af21b7260625185a1be09a36603f9 /src/adlmidi_midiplay.cpp
parentd2e63250435db78f0706a70b94efd7ee39d19dd9 (diff)
downloadlibADLMIDI-20b8c754c09ea9bc0c65b81ea716324f2c5391be.tar.gz
libADLMIDI-20b8c754c09ea9bc0c65b81ea716324f2c5391be.tar.bz2
libADLMIDI-20b8c754c09ea9bc0c65b81ea716324f2c5391be.zip
Simplify the bend passing to a frequency formula calls
Diffstat (limited to 'src/adlmidi_midiplay.cpp')
-rw-r--r--src/adlmidi_midiplay.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/adlmidi_midiplay.cpp b/src/adlmidi_midiplay.cpp
index 31be12c..ad9ccde 100644
--- a/src/adlmidi_midiplay.cpp
+++ b/src/adlmidi_midiplay.cpp
@@ -1586,26 +1586,28 @@ void MIDIplay::noteUpdate(size_t midCh,
if(vibrato && (d.is_end() || d->value.vibdelay_us >= chan.vibdelay_us))
bend += static_cast<double>(vibrato) * chan.vibdepth * std::sin(chan.vibpos);
+ bend += phase;
+
// Use different frequency formulas in depend on a volume model
switch(synth.m_volumeScale)
{
case Synth::VOLUME_DMX:
case Synth::VOLUME_DMX_FIXED:
- finalFreq = s_dmxFreq(currentTone, bend + phase);
+ finalFreq = s_dmxFreq(currentTone, bend);
break;
case Synth::VOLUME_APOGEE:
case Synth::VOLUME_APOGEE_FIXED:
- finalFreq = s_apogeeFreq(currentTone, bend + phase);
+ finalFreq = s_apogeeFreq(currentTone, bend);
break;
case Synth::VOLUME_9X:
case Synth::VOLUME_9X_GENERIC_FM:
- finalFreq = s_9xFreq(currentTone, bend + phase);
+ finalFreq = s_9xFreq(currentTone, bend);
break;
default:
- finalFreq = s_commonFreq(currentTone, bend + phase);
+ finalFreq = s_commonFreq(currentTone, bend);
}
synth.noteOn(c, c_slave, finalFreq);