closes #1
This commit is contained in:
@ -66,6 +66,7 @@ void WebViewPluginAudioProcessor::processBlock(juce::AudioBuffer<float>& buffer,
|
||||
shifter.SetAutoTuneSpeed(state.getParameterAsValue("autoTuneSpeed").getValue());
|
||||
shifter.SetAutoTuneDepth(state.getParameterAsValue("autoTuneDepth").getValue());
|
||||
shifter.SetPortamentoTime(state.getParameterAsValue("portTime").getValue());
|
||||
shifter.SetHarmonyMix(state.getParameterAsValue("harmonyMix").getValue());
|
||||
juce::AudioBuffer<float> const_buff;
|
||||
const_buff.makeCopyOf(buffer);
|
||||
shifter.Process(const_buff.getArrayOfReadPointers(), (float**)buffer.getArrayOfWritePointers(), buffer.getNumSamples());
|
||||
|
||||
@ -72,6 +72,14 @@ public:
|
||||
"AutoTune Speed",
|
||||
NormalisableRange<float> {0.001f, 0.1f, .001f},
|
||||
.5f);
|
||||
|
||||
sliderIds.push_back("harmonyMix");
|
||||
addToLayout<AudioParameterFloat>(layout,
|
||||
ParameterID("harmonyMix"),
|
||||
"Harmony Mix",
|
||||
NormalisableRange<float> {0.0f, 1.0f, .01f},
|
||||
.01f);
|
||||
|
||||
sliderIds.push_back("portTime");
|
||||
addToLayout<AudioParameterFloat>(layout,
|
||||
ParameterID("portTime"),
|
||||
|
||||
@ -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;
|
||||
}
|
||||
}
|
||||
@ -156,6 +156,7 @@ public:
|
||||
}
|
||||
float getInputPitch() const { return sample_rate_ / in_period; }
|
||||
float getOutputPitch() const { return sample_rate_ / out_period; }
|
||||
void SetHarmonyMix(float mix);
|
||||
|
||||
float out_midi = 40;
|
||||
ShifterVoice voices[MAX_VOICES];
|
||||
@ -185,6 +186,8 @@ private:
|
||||
double smear_step = 0.003;
|
||||
bool onset_trigger = false;
|
||||
bool pitch_trigger = false;
|
||||
float harmony_mix = 0.0f;
|
||||
float melody_mix = 0.0f;
|
||||
|
||||
int trigger_bank;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user