AudaciousTunes/Audacious/Gen.cs
/// <summary>
/// Generates samples of white noise.
/// </summary>
/// <param name="ms">The length of the noise in milliseconds.</param>
Generates samples of white noise.
Generates samples of white noise .
public static List<float> Noise(long sampleNum)
        {
            Random rng = new Random();            
            List<float> result = new List<float>();
            for (int i = 0; i < sampleNum; i++)
            {
                result.Add
                    (((float)(rng.NextDouble() - 0.5) * float.MaxValue));
            }
            return result;
        }
public static List < float > Noise ( long sampleNum ) { Random rng = new Random ( ) ; List < float > result = new List < float > ( ) ; for ( int i = 0 ; i < sampleNum ; i ++ ) { result . Add ( ( ( float ) ( rng . NextDouble ( ) - 0.5 ) * float . MaxValue ) ) ; } return result ; }
Generates samples of white noise.
Generates samples of white noise .
//Iterates through the samples to add data. //Converts the result to the float range.
sampleNum
long
ms
The length of the noise in milliseconds.
The length of the noise in milliseconds .