closes #1
This commit is contained in:
@ -205,12 +205,12 @@ void Shifter::AddInterpolatedFrame(int voice, int max_index, float resampling_pe
|
||||
float value = ((1 - interp) * in_buffer[(int)f_index] + (interp)*in_buffer[(int)(f_index + 1) % 8192]) * mult;
|
||||
if(voice >= MAX_VOICES) {
|
||||
//value *= volume;
|
||||
out_buffer[0][out_index] += value;
|
||||
out_buffer[1][out_index] += value;
|
||||
out_buffer[0][out_index] += value * melody_mix;
|
||||
out_buffer[1][out_index] += value * melody_mix;
|
||||
} else {
|
||||
value *= voices[voice].CurrentAmplitude() * volume;
|
||||
out_buffer[0][out_index] += value * voices[voice].GetPanning(0);
|
||||
out_buffer[1][out_index] += value * voices[voice].GetPanning(1);
|
||||
out_buffer[0][out_index] += value * voices[voice].GetPanning(0) * harmony_mix;
|
||||
out_buffer[1][out_index] += value * voices[voice].GetPanning(1) * harmony_mix;
|
||||
}
|
||||
|
||||
|
||||
@ -307,4 +307,15 @@ void Shifter::RemoveMidiNote(int note) {
|
||||
voices[i].Release();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Shifter::SetHarmonyMix(float mix) {
|
||||
if (mix < .5) {
|
||||
melody_mix = 1.0f;
|
||||
harmony_mix = mix * 2.0f;
|
||||
}
|
||||
else {
|
||||
harmony_mix = 1.0f;
|
||||
melody_mix = (1.0f - mix) * 2.0f;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user