Ensure mod wheel value is used in respective vibrato mode

This commit is contained in:
Jack Andersen 2018-06-21 11:03:35 -10:00
parent d7011f0e77
commit 1e8ce19b16
1 changed files with 5 additions and 1 deletions

View File

@ -454,7 +454,7 @@ void Voice::preSupplyAudio(double dt)
m_vibratoTime += dt;
float vibrato = std::sin(m_vibratoTime / m_vibratoPeriod * (2.f * M_PIF));
if (m_vibratoModWheel)
newPitch += m_vibratoModLevel * vibrato;
newPitch += m_vibratoModLevel * vibrato * (m_state.m_curMod / 127.f);
else
newPitch += m_vibratoLevel * vibrato;
refresh = true;
@ -1404,6 +1404,10 @@ void Voice::_notifyCtrlChange(uint8_t ctrl, int8_t val)
{
setAuxBVol(val / 127.f);
}
else if (ctrl == 0x1)
{
m_state.m_curMod = uint8_t(val);
}
for (std::shared_ptr<Voice>& vox : m_childVoices)
vox->_notifyCtrlChange(ctrl, val);