# [Faudiostream-users] compiler hangs on this program?

```Hi, me again.  Thanks very much to you all for your advice lately!
I’m digging into Faust & trying to come up with an interesting
paper for the conference.  At the very least I’m getting better
at the language.  But I’m also hitting various snags … so again,
thanks very much for all your help.```
```
My latest problem: my Faust program seems to hang the compiler,
locking up one CPU on my system until I terminate it.

I admit that I’m doing a bit of voodoo with this one, trying
to translate an algorithm from C that does an inverse FFT
transform to generate noise of arbitrary spectra — 1/f^n
for various values of N, including white, pink & brown noise.
I might not totally grok how the Faust ifft is expecting to
receive its input signals.  But I’d hope this would at least
compile, or else not compile.

Listing is included below.  Thanks again for any advice.

-mykle-

———————

import("stdfaust.lib");

// Implementing Paul Bourke's 1/f^b (for 1<=b<=3) noise generator, from
http://paulbourke.net/fractals/noise/gennoise.c
// More background at http://paulbourke.net/fractals/noise/

betanoise(beta) = real, imag : an.ifft(N) : select2(0)
with {
N=8192; // 2^13

//// In C it's a for-loop that fills in an array from the ends to the middle.
//// Relevant excerpts:
//
//  #define TWOPOWER 13
//
//  for (i=1;i<=N/2;i++) {
//    mag = pow(i+1.0,-beta/2) * RandomGaussian(0.0,1.0); // Note to self a
number of years later, why "i+1"
//    pha = TWOPI * RandomUniform();
//    real[i] = mag * cos(pha);
//    imag[i] = mag * sin(pha);
//    real[N-i] =  real[i];
//    imag[N-i] = -imag[i];
//  }
//
//  FFT(-1,TWOPOWER,real,imag);

// In Faust time flows in one direction, so our loop is a triangle wave btwn
0 & +1
i = os.lf_trianglepos(ma.SR/N) * N;             // Using a float here ...
Bourke used an int.
i_slope = ba.if(i>i', 1, -1);
mag = pow(i + 1, -beta/2) * abs(no.gnoise(12)); // NOTE: Bole's Faust
tutorial explains why 12 is a good choice for gnoise() order.
// (I have no clue about i+1
either.)
pha = 2 * ma.PI * abs(no.noise);
real = mag * cos(pha);
imag = mag * sin(pha) * i_slope;
};

process = betanoise(hslider("beta", 1, 1, 3, 0.01)) * hslider("gain", 0.5, 0,
1, 0.001) * checkbox("gate");

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most