# Audio Plugin has no results

**URL:** <https://forum.juce.com/t/audio-plugin-has-no-results/21414>\
**Category:** Audio Plugins\
**Created:** [March 20, 2017, 2:01am UTC](https://forum.juce.com/t/audio-plugin-has-no-results/21414 "2017-03-20T02:01:13Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![mUmbler](https://avatars.discourse-cdn.com/v4/letter/m/b19c9b/32.png) [@mUmbler](https://forum.juce.com/u/mUmbler)\
**Post date:** [March 20, 2017, 2:01am UTC](https://forum.juce.com/t/audio-plugin-has-no-results/21414/1 "2017-03-20T02:01:13Z")

</div>

Hello again!

This relates to the FFT that I made a post about before.

When I apply my FFT to the buffer in the processBlock method, nothing happens in my DAW! I set the new values of the buffer using write pointers.

I poke at the original buffer with my debugger and see that the values are changed in it after my operations, and are different from the readPointers that I initially request from it.

Could this be because I resize the buffer inside of processBlock? Is this allowed? Any thoughts?

Thanks again.

---

<div class="post-metadata">

**Author:** ![sambecket](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/sambecket/32/1862_2.png) [@sambecket](https://forum.juce.com/u/sambecket)\
**Post date:** [March 20, 2017, 4:46am UTC](https://forum.juce.com/t/audio-plugin-has-no-results/21414/2 "2017-03-20T04:46:09Z")

</div>

can we see yo code yo

---

<div class="post-metadata">

**Author:** ![mUmbler](https://avatars.discourse-cdn.com/v4/letter/m/b19c9b/32.png) [@mUmbler](https://forum.juce.com/u/mUmbler)\
**Post date:** [March 20, 2017, 5:37am UTC](https://forum.juce.com/t/audio-plugin-has-no-results/21414/3 "2017-03-20T05:37:23Z")

</div>

Here is a snippit.

The calculations not shown cause the values in bufferInput[0] and bufferInput[1] to be different than the values of buffer.getSample(0, 0) and buffer.getSample(0, 1). But what is returned from the DAW is the unchanged sound.

```auto
    // Inside of process block

    // Resize buffer to fftSize. Saves the data that is already in the buffer.
        buffer.setSize(buffer.getNumChannels(), fftSize, true, true); 
        for (int channel = 0; channel < buffer.getNumChannels(); ++channel)
	    {
		float* bufferWriters = buffer.getWritePointer(channel);
		const float* bufferInput = buffer.getReadPointer(channel);

            // Calculations I cant show because this is my senior project ;)

            for (int sample = 0; sample < fftSize; ++sample)
	            bufferWriters[sample] = bufferCopy[sample];
        }
```

Any glaring issues in this, or must I dig deeper in what I am doing in what isn’t shown?

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [March 20, 2017, 7:24am UTC](https://forum.juce.com/t/audio-plugin-has-no-results/21414/4 "2017-03-20T07:24:00Z")

</div>

Yeah, if that’s the buffer that the host passed into processBlock for you to fill, then obviously changing its size will allocate new memory, so you’ll no longer be writing to the memory the host actually asked you for! (And changing its size also makes no sense at all in this context)

---

<div class="post-metadata">

**Author:** ![mUmbler](https://avatars.discourse-cdn.com/v4/letter/m/b19c9b/32.png) [@mUmbler](https://forum.juce.com/u/mUmbler)\
**Post date:** [March 22, 2017, 3:06am UTC](https://forum.juce.com/t/audio-plugin-has-no-results/21414/5 "2017-03-22T03:06:07Z")

</div>

Ahh, I see. This yielded results, thanks again!

I was resizing originally because I was under the impression that the resulting data from the convolution would be longer than the buffer coming in if my impulse response length was longer than the buffer. How do I add this new data then?

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [March 22, 2017, 8:18am UTC](https://forum.juce.com/t/audio-plugin-has-no-results/21414/6 "2017-03-22T08:18:11Z")

</div>

Well, you’d need your own FIFO to collect and process the data.

---

<div class="post-metadata">

**Author:** ![mUmbler](https://avatars.discourse-cdn.com/v4/letter/m/b19c9b/32.png) [@mUmbler](https://forum.juce.com/u/mUmbler)\
**Post date:** [March 23, 2017, 1:38am UTC](https://forum.juce.com/t/audio-plugin-has-no-results/21414/7 "2017-03-23T01:38:39Z")

</div>

Ahh that’d made sense.

How would I clear the FIFO when processBlock is no longer called and the FIFO still has data? I am looking at the AudioProcessor documentation and nothing is standing out to me.

---

<div class="post-metadata">

**Author:** ![xenakios](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/xenakios/32/4047_2.png) [@xenakios](https://forum.juce.com/u/xenakios)\
**Post date:** [March 23, 2017, 3:13am UTC](https://forum.juce.com/t/audio-plugin-has-no-results/21414/8 "2017-03-23T03:13:46Z")

</div>

Clear your FIFO in the prepareToPlay and/or releaseResources calls. (But be also prepared for the situation the host application might not make those calls as often as expected.)

---

<div class="post-metadata">

**Author:** ![daniel](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/daniel/32/790_2.png) [@daniel](https://forum.juce.com/u/daniel)\
**Post date:** [March 23, 2017, 10:40am UTC](https://forum.juce.com/t/audio-plugin-has-no-results/21414/9 "2017-03-23T10:40:10Z")

</div>

> [@mUmbler](#):
>
> How would I clear the FIFO when processBlock is no longer called and the FIFO still has data?

If you use juce’s [AbstractFifo](https://www.juce.com/doc/classAbstractFifo), you don’t need to clear, because the prepareToRead takes into account, if the data was already read. It will not read unless valid data was written to it.  
You can check getNumReady() to see, how much data is there to read.

---

<div class="post-metadata">

**Author:** ![mUmbler](https://avatars.discourse-cdn.com/v4/letter/m/b19c9b/32.png) [@mUmbler](https://forum.juce.com/u/mUmbler)\
**Post date:** [March 23, 2017, 11:56pm UTC](https://forum.juce.com/t/audio-plugin-has-no-results/21414/10 "2017-03-23T23:56:10Z")

</div>

Okay, that makes sense. When I was referring to ‘clear’ I was meaning adding the data in the FIFO to the end of the processed data. So the data isn’t lost, just tacked on to the end.

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [March 24, 2017, 10:04am UTC](https://forum.juce.com/t/audio-plugin-has-no-results/21414/11 "2017-03-24T10:04:20Z")

</div>

When the host stops calling processBlock() then that’s because it no longer needs any more data, so you can safely not worry about the dregs left in your buffer.

---

<div class="post-metadata">

**Author:** ![mUmbler](https://avatars.discourse-cdn.com/v4/letter/m/b19c9b/32.png) [@mUmbler](https://forum.juce.com/u/mUmbler)\
**Post date:** [March 25, 2017, 9:36pm UTC](https://forum.juce.com/t/audio-plugin-has-no-results/21414/12 "2017-03-25T21:36:55Z")

</div>

Great that’s what I was wondering!
