Input Buffering

Hello,

i just used the soundtouch library for pitch shifting. 

For postprocessing it works fine now, but in realtime it just creates a lot of clicks and crackling.

 

I think it would solve the problem when i buffer the input. Is it possible to change the buffersize in the processblock?

Thank you!

You'll need to use a circular buffer. Obviously it's not possible to just randomly change buffer sizes, they're provided by the audio driver or plugin host.

Thank you!
Well i wonder were i should implement the buffer, because in the processBlock i get only the bufferdata from one call and this seems to be too less for quality pitch shifting.

Is there a way to store the input for the processBlock buffer call somewhere outside?


 

Dave from dRowAudio wrote an audiosource that wraps the SoundTouch library. (Using an interim buffer).  Should be helpful even if you want to implement your own.

 

https://github.com/drowaudio/drowaudio/blob/master/dRowAudio/audio/dRowAudio_SoundTouchAudioSource.h

Merci! 

I will have a look on this :)

 

Otherwise i have another kind of stupid question maybe....

I tested a plugin in audacity and it sounds like the processed data is "added" to the original one.

I used a float pointer to get the buffer data and afterwards get each sample in the process:

float in0 = 0;
        int numSamples = buffer.getNumSamples();
        float* data = buffer.getSampleData(channel,0);
        

        for (int i = 0; i < buffer.getNumSamples(); i++)
        {
            in0 = *data;
            *data = pro0.tick(in0);
            data++;
        }
        pro0.clear();

 

is there something missing?

thank you for your help!