Hi.

Could I get a clarification concerning parameterless functions?

I tried this code

// stateless random generator
rand = fn / RAND_MAX
with {
  fn = ffunction(int rand(), <math.h>, "");
  RAND_MAX = fconstant(int RAND_MAX, <math.h>);
};

process = rand, rand, rand, rand;


and got the following result

    virtual void compute (int count, FAUSTFLOAT** input, FAUSTFLOAT**
output) {
FAUSTFLOAT* output0 = output[0];
FAUSTFLOAT* output1 = output[1];
FAUSTFLOAT* output2 = output[2];
FAUSTFLOAT* output3 = output[3];
for (int i=0; i<count; i++) {
float fTemp0 = (float(rand()) / float(RAND_MAX));
output0[i] = (FAUSTFLOAT)fTemp0;
output1[i] = (FAUSTFLOAT)fTemp0;
output2[i] = (FAUSTFLOAT)fTemp0;
output3[i] = (FAUSTFLOAT)fTemp0;
}
}

I expected four random numbers in parallel.

What is the right way to call rand() from Faust?

Br,
Timo
------------------------------------------------------------------------------
Start Your Social Network Today - Download eXo Platform
Build your Enterprise Intranet with eXo Platform Software
Java Based Open Source Intranet - Social, Extensible, Cloud Ready
Get Started Now And Turn Your Intranet Into A Collaboration Platform
http://p.sf.net/sfu/ExoPlatform
_______________________________________________
Faudiostream-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/faudiostream-users

Reply via email to