buffer.getNumSamples() is 0 in Arpeggiator example

Hi all,

When I try to run Arpeggiator example, the AudioBuffer passed in processBlock function seems not provide the block size information. buffer.getNumSamples() always returns 0 and hence no MIDI msg is sent out. When I tried to run Arpeggiator example before(1 year or so ago,) it worked …

    void processBlock (AudioBuffer<float>& buffer, MidiBuffer& midi) override
        // the audio buffer in a midi effect will have zero channels!
        jassert (buffer.getNumChannels() == 0);

        // however we use the buffer to get timing information
        auto numSamples = buffer.getNumSamples(); // -> this becomes zero.

If I configure audio output for Arpeggiator example, then buffer.getNumSamples() return correct value (>0) and Arpeggiator example runs as expected.

        : AudioProcessor (BusesProperties()
                          .withOutput ("Output", AudioChannelSet::stereo(), true)  // Add this
        addParameter (speed = new AudioParameterFloat ("speed", "Arpeggiator Speed", 0.0, 1.0, 0.5));

Was there any recent change regarding this part ? i.e. when no audio channel is configured, sample size information will be no longer provided in AudioBuffer ? ( If so, the arpeggiator example is no longer valid ?).

I might overlooking something but appreciate your help on this.

Version : V6.1.0
OS : Mac OSX 10.15.17
Plugin Type : Audio Unit

Thanks !

You need to add an audio input. See: