BogaudioModules

BogaudioModules for VCV Rack
Log | Files | Refs | README | LICENSE

commit 6bee078a9c1e9c2dd4f5673155adb00cd2afd606
parent 1fbc6328ec12d8017d0873f15173f920b004d513
Author: Matt Demanett <matt@demanett.net>
Date:   Tue,  5 Dec 2017 01:56:18 -0500

Merge.

Diffstat:
Msrc/Analyzer.cpp | 10+++-------
Msrc/dsp/analyzer.hpp | 2+-
Msrc/dsp/noise.hpp | 6+++---
3 files changed, 7 insertions(+), 11 deletions(-)

diff --git a/src/Analyzer.cpp b/src/Analyzer.cpp @@ -164,14 +164,10 @@ void Analyzer::resetChannels() { } SpectrumAnalyzer::Size Analyzer::size() { - switch (_quality) { - case QUALITY_HIGH: { - return SpectrumAnalyzer::SIZE_4096; - } - case QUALITY_GOOD: { - return SpectrumAnalyzer::SIZE_1024; - } + if (_quality == QUALITY_HIGH) { + return SpectrumAnalyzer::SIZE_4096; } + return SpectrumAnalyzer::SIZE_1024; } void Analyzer::step() { diff --git a/src/dsp/analyzer.hpp b/src/dsp/analyzer.hpp @@ -162,7 +162,7 @@ struct SpectrumAnalyzer : OverlappingBuffer<float> { delete[] _fftOut; } - virtual void process(float* samples) { + virtual void process(float* samples) override { float* input = samples; if (_window) { _window->apply(samples, _windowOut); diff --git a/src/dsp/noise.hpp b/src/dsp/noise.hpp @@ -9,7 +9,7 @@ struct WhiteNoiseGenerator : NoiseGenerator { const float _randMax = powf(2.0, 31) - 1; int _last = rack::randomu32(); - virtual float _next() { + virtual float _next() override { // don't use this for cryptography. _last = ((_last * 1103515245) + 12345) & _mask; return _last / _randMax; @@ -23,7 +23,7 @@ struct BasePinkNoiseGenerator : NoiseGenerator { G _gs[_n]; uint32_t _count = rack::randomu32(); - virtual float _next() { + virtual float _next() override { // See: http://www.firstpr.com.au/dsp/pink-noise/ float sum = _g.next(); for (int i = 0, bit = 1; i < _n; ++i, bit <<= 1) { @@ -46,7 +46,7 @@ struct RedNoiseGenerator : BasePinkNoiseGenerator<PinkNoiseGenerator> {}; struct GaussianNoiseGenerator : NoiseGenerator { GaussianNoiseGenerator() {} - virtual float _next() { + virtual float _next() override { return rack::randomNormal(); } };