Audioprocessorgraph out

I am interesting in using the audioprocessorgraph. I can’t seem to get audio out of it though. I have the audiographioprocessor in a larger class and I just want to call its process function and write to the buffer from there. like this.

void SynthBase::processAudioAndMidi(juce::AudioBuffer<float>& audio_buffer, juce::MidiBuffer& midi_buffer) //, int channels, int samples, int offset, int start_sample = 0, int end_sample = 0)
{

    
    AudioThreadAction action;
    while (processorInitQueue.try_dequeue (action))
        action();

    engine_->processorGraph->processBlock(audio_buffer, midi_buffer);

  
}

I have an AudioGraphIOProcessor that is audio output in my audio graph which I would expect to be the last point in the chain that puts audio into the buffer but I must be mistaken. For some reason in juce::Connections::isConnectionLegal this line

(destIsMIDI ? dest->getProcessor()->acceptsMidi()
           : destChannel < dest->getProcessor()->getTotalNumInputChannels()); 

returns false for the audiooutputnode… specifically failing at getTotalNumInputChannels()

Looking at the tutorial maybe the AudioGraph must be added to the AudioProcessorPlayer.
Does this maybe create the input buses for the AudioGraphIOProcessor ?

looking at other examples online like this one https://github.dev/fqfdev/SimpleStrip/tree/master/Source seem to imply that is not the case.

I wonder what I am doing wrong…

just as always happens as soon as I make a forum post I answer my own question.

I was missing a call to audioProcessorGraph->enableAllBuses() Makes sense, but this call happens before adding any nodes. So I am still a little confused as to what path things are going down that allows that to work. I would expect that I would need to call that after adding the output node for it to care?

Maybe I’ll dig into that next week!

1 Like