InstrumentTrack: scale output volume by 2 for MIDI-based instruments

As of 0ca3901ab8 MIDI-based instruments are
played at velocity 63 for volume=100%.  In order to get the same output
volume, we need to scale it by 2.
This commit is contained in:
Tobias Doerffel
2014-03-08 12:55:14 +01:00
parent ae105c22cc
commit ba324f4aa8

View File

@@ -185,6 +185,13 @@ void InstrumentTrack::processAudioBuffer( sampleFrame* buf, const fpp_t frames,
float v_scale = (float) getVolume() / DefaultVolume;
// We play MIDI-based instruments at velocity 63 for volume=100%. In order
// to get the same output volume, we need to scale it by 2
if( m_instrument->flags().testFlag( Instrument::IsMidiBased ) )
{
v_scale *= 2;
}
// instruments using instrument-play-handles will call this method
// without any knowledge about notes, so they pass NULL for n, which
// is no problem for us since we just bypass the envelopes+LFOs