No Audio Being Generated but Compiles Fine...Confusing


#1

Hi everyone,

so I’m relatively new to Juce and trying to create a basic plugin that creates white noise from processBlock() but unfortunately can’t seem to hear anything when i run it in the plugin host. The code compiles fine and to me it looks like there shouldn’t be a problem but would appreciate some extra eyes to help me out.

Here is my code in the processBlock() method:

void KrotosResonatorAudioProcessor::processBlock (AudioSampleBuffer& buffer, MidiBuffer& midiMessages)
{
      
    buffer.clear();
    
    for(int chan=0; chan<buffer.getNumChannels(); chan++)
    {
        float * const float_buffer = buffer.getWritePointer(chan, 1);
        for(int i;i<buffer.getNumSamples();i++)
        {
            float_buffer[i] = random->nextFloat();
        }
    
    }
}

#2

Should probably be :
for(int i=0;i<buffer.getNumSamples();i++) :wink:


#3

Was just about to say!


#4

Absolute Heros thank you! Working perfectly now! :smiley:


#5

I think you need to increase your compiler warning level!

1??


#6

I’ve set that to 0 now so it starts from the beginning. Sorry about that!