The compiler is doing integer division instead of floating point devision.
This is because both the numerator and denominator of the devision are integer values. Specifically p is an int and 12 is an integer literal.
There are several fixes. Simplest would be to change 12 to 12.0f. This will work because as long at least one of the two operands used is a floating point value, the compiler will do floating point devision.
Also I noticed in your code you are directly setting channels here
outputs[POLY_ALLOWED_OUTPUT].channels=16;
According to the comments in the source code, this is deprecated and an unstable part of the API. I.E. this code may break in the future. You should instead do this: