I have already solved this problem:
I have a white noise generated as an array of doubles:

```
public static double[] whiteNoise(int length) {
double[] out = new double[length];
for (int i = 0; i < length; i++) {
out[i] = (Math.random() * 2 - 1.0)/2.0;
}
return out;
}
```

I obtain the red noise from the white noise in the following way:

```
public static double[] redNoise(int length, int m) {
double out[] = whiteNoise(length);
for (int i=0; i<length/m-1; i++) {
int k = i*m;
int l = ((i+1)*m <= length-1) ? (i+1)*m : length-1;
double d = (out[l] - out[k])/((double)(m));
for (int j=0; j<m; j++) {
out[k+j] = out[k] + d*j;
}
}
return out;
}
```

Where the m parameter is the number of interpolated samples (we take the first sample, and the m+1 sample, and interpolate values of all samples between these two).

## And now the SHOW BEGINS

I generate the red noise with the interpolation number equals to let's say 10000. According to the value of consecutive samples, I alter this red noise with different values obtained from these samples taken as the interpolation number parameter. In this way a rocket sound effect is obtained.

```
int interpolatedframes = 10000;
double[] rednoise1 = SigGen.redNoise(duration, interpolatedframes);
while(i<rednoise1.length-1)
{
selectedNumber = (int)Math.floor(Math.abs((100*(rednoise1[i]+0.5)+100)));
if(i+selectedNumber < rednoise1.length-1) {
rednoise1 = SigGen.alterRedNoise(rednoise1, i, selectedNumber);
}
else
{
break;
}
i+=selectedNumber;
}
```

With the following code the array with the noise is altered in a way, that it interpolates "interpolationNumber" of samples beginning from the startingIndex.

```
public static double[] alterRedNoise(double[] input, int startIndex, int interpolationNumber)
{
int k = startIndex;
int l = ((startIndex + interpolationNumber)<input.length-1?(startIndex+interpolationNumber):input.length-1);
double d = (input[l] - input[k])/((double)(interpolationNumber));
for (int j=0; j<interpolationNumber; j++) {
input[k+j] = input[k] + d*j;
}
return input;
}
```

Sorry for a bit messy code, but I just wanted to publish it ASAP.

i've never heard of red noise.. do you mean pink noise perhaps? – Arnoud Traa – 2015-05-26T11:06:54.747

I guess it is similar. I'm not sure, but it's also called the Brownian noise. I have already solved this problem, I will publish it soon. – Piotr Kopczyński – 2015-05-27T12:11:00.050