Hi there,
I am working on a little expression evaluator, for doing graphs, but my main goal was to let the user fill in any formula to create new sound effects to apply to the sound realtime.
This code gets turned inside out and calculated 10000 times in 1400ms on my Intel P4 2.04Ghz.
My question: is this fast enough?
truncation = 10;
manipulation = 121;
hertz = 6;
noise = 300;
n = random(noise)/1000;
y = sin(x * hertz);
y = y^manipulation;
y = trunc(y * truncation)/truncation;
y = y + (n-(noise/2000));
It does this (10000 calculations) in 78ms:
y=sin(x);
I calculated (don't know exactly) that 50ms of stereo 16-bit data is 882 samples, so I tried the first formula on 882 samples, and it returned 125ms, which is too slow I guess??