pink.h (637B)
1 #define PINK_MAX_RANDOM_ROWS (30) 2 #define PINK_RANDOM_BITS (24) 3 #define PINK_RANDOM_SHIFT ((sizeof(long)*8)-PINK_RANDOM_BITS) 4 5 typedef struct 6 { 7 long pink_rows[PINK_MAX_RANDOM_ROWS]; 8 long pink_running_sum; /* Used to optimize summing of generators. */ 9 int pink_index; /* Incremented each sample. */ 10 int pink_index_mask; /* Index wrapped by ANDing with this mask. */ 11 float pink_scalar; /* Used to scale within range of -1.0 to +1.0 */ 12 } pink_noise_t; 13 14 void initialize_pink_noise( pink_noise_t *pink, int num_rows ); 15 float generate_pink_noise_sample( pink_noise_t *pink );