Hello,
first i have to say that i just started programming vst plugins using juce and that i am new here in the forum.
Well, i tried to make a pitch shift plugin with 3 bands (one original and two filtered that should be pitched).
My problem know is, that compiling works, but when i put my dll in audacity and start the plugin it crashes when i want to use it on a audio track.
I would be very glad if someone could help me :)
Kind regards, flat
Here is the part of the audioprocessing:
void PitchShiftingAudioProcessor::processBlock (AudioSampleBuffer& buffer, MidiBuffer& midiMessages)
{
for (int channel = 0; channel < getNumInputChannels(); ++channel)
{
int numSamples = buffer.getNumSamples();
AudioSampleBuffer buffer0 = buffer; //original
AudioSampleBuffer buffer1 = AudioSampleBuffer(1,numSamples);
buffer1.copyFrom(0,0,buffer0,0,0,numSamples);
AudioSampleBuffer buffer2 = AudioSampleBuffer(1,numSamples);
buffer2.copyFrom(0,0,buffer0,0,0,numSamples);
float* in_0 = buffer0.getSampleData(0, 0);
float* in_1 = buffer1.getSampleData(0, 0);
float* in_2 = buffer2.getSampleData(0, 0);
//filter_1->processSamples(in_1, numSamples);
//filter_2->processSamples(in_2, numSamples);
processor_0->putSamples(in_0, numSamples);
processor_0->receiveSamples(in_0, numSamples);
processor_1->putSamples(in_1, numSamples);
processor_1->receiveSamples(in_1, numSamples);
processor_2->putSamples(in_2, numSamples);
processor_2->receiveSamples(in_2, numSamples);
buffer0.applyGain (0, 0, buffer0.getNumSamples(), gain0);
buffer1.applyGain (0, 0, buffer1.getNumSamples(), gain1);
buffer2.applyGain (0, 0, buffer2.getNumSamples(), gain2);
buffer.addFrom(0,0,buffer1,0,0,numSamples);
buffer.copyFrom(1,0,buffer,1,0,numSamples);
buffer.addFrom(0,0,buffer2,0,0,numSamples);
buffer.copyFrom(1,0,buffer,1,0,numSamples);
buffer.applyGain (0, 0, buffer.getNumSamples(), gain);
}
// In case we have more outputs than inputs, we'll clear any output
// channels that didn't contain input data, (because these aren't
// guaranteed to be empty - they may contain garbage).
for (int i = getNumInputChannels(); i < getNumOutputChannels(); ++i)
{
buffer.clear (i, 0, buffer.getNumSamples());
}
}