Harmonizer buffer issue sos



Hello All!

working on a capstone project for my degree in electronic production & design from Berklee College of Music, I’ve only been into JUCE/C++ for about 6 months now, but I started learning C last year in school for some DSP stuff. So I’m a noob, there’s the preface!

I have this midi Harmonizer going on, you sing into the microphone and play the piano… and you’re voice comes out of the speakers playing the piano notes you’re playing. This works, but when I’m not singing and I press the keys, there seems to be some samples left over in the buffer. They will trigger until the buffer is empty, I understand that in the juce::Synthesiser class, the numSamples varies because of the way midi works and reducing phase issues blah blah BUT I have no clue where to clear the buffer without messing everything or how to gate the signal well using allowTailOff, also there’s pops and clicks on note on and offs, and I’m the dry signal is always coming through which is annoying!

I made an autotuner/drone thing and I was able to remove the dry signal by clearing my outputbuffer before writing to it, but with the SynthVoice I’m using, if I clear before copying, it deletes the previous processed information. very frustrating and my brain hurts here, hope some one is feeling lovely enough to lead me to any documentation or idea’s that could help me!

EDIT:: would it help for me to override the JUCE synth classes renderVoices and place a temporary buffer containing the real buffer information into the renderVoices, then copy all of that information to the output buffer?

//noteTag is set to 1 for during noteOn, and 0 during noteOff//
/HarmonizerVoice RenderNextBlock/

void renderNextBlock( AudioSampleBuffer& outputBuffer, int startSample, int numSamples) override


    tmpBIn = tmpMain->getArrayofReadPointers();
    tmpBOut = tmpMain->getArrayOfWritePointers();

    avHarmonizerTuner->process(tmpBIn, numSamples, false);
       if(avHarmonizerTuner->available() >= 1024)
       avHarmonizerTuner->retrieve(tmpBOut, numSamples);
       for(auto i = outputBuffer.getNumChannels(); --i >= 0;)

{ clearCurrentNote(); 
    tmpMain->clear();  }