Browse Source

Fix indentation.

tags/v2.0.1
Andrew Belt 2 years ago
parent
commit
57545c49ab
1 changed files with 19 additions and 19 deletions
  1. +19
    -19
      src/Noise.cpp

+ 19
- 19
src/Noise.cpp View File

@@ -6,25 +6,25 @@ http://www.firstpr.com.au/dsp/pink-noise/
*/
template <int QUALITY = 8>
struct PinkNoiseGenerator {
int frame = -1;
float values[QUALITY] = {};
float process() {
int lastFrame = frame;
frame++;
if (frame >= (1 << QUALITY))
frame = 0;
int diff = lastFrame ^ frame;
float sum = 0.f;
for (int i = 0; i < QUALITY; i++) {
if (diff & (1 << i)) {
values[i] = random::uniform() - 0.5f;
}
sum += values[i];
}
return sum;
}
int frame = -1;
float values[QUALITY] = {};
float process() {
int lastFrame = frame;
frame++;
if (frame >= (1 << QUALITY))
frame = 0;
int diff = lastFrame ^ frame;
float sum = 0.f;
for (int i = 0; i < QUALITY; i++) {
if (diff & (1 << i)) {
values[i] = random::uniform() - 0.5f;
}
sum += values[i];
}
return sum;
}
};




Loading…
Cancel
Save