Cascading first order digital filters in C++
My late night brain made foolish mistakes, for the record, if anyone needs this, the working code is as follows:
Header:
float state1;
float state2;
float state3;

Implementation:
In Constructor:
state1 = 0;
state2 = 0;
state3 = 0;

Robert's function:
// this processes one sample

float first_order_filter(float input, float pole, float zero, float *state)
{
    float new_state = input + pole*(*state);
    float output = new_state - zero*(*state);
    *state = new_state;
    return output;
}

Then in the loop, for (int i=0; i &lt; numSamples; i++)
float first = first_order_filter(whiteNoise, 0.99572754, 0.98443604, &amp;state1);
float second = first_order_filter(first, 0.94790649, 0.83392334, &amp;state2);
float third = first_order_filter(second, 0.53567505, 0.07568359, &amp;state3);
out1 = third;

Of course this works like a charm, producing Pink Noise and if the poles and zeros are swapped it produces Blue/ Azure Noise.