From 7004502ed9633ef8bbaa9ebb348e40b4ceb10d41 Mon Sep 17 00:00:00 2001 From: Andrew Belt Date: Thu, 21 Jun 2018 14:38:07 -0400 Subject: [PATCH] samplerate and convolver cleanup --- README.md | 4 +++- include/dsp/fir.hpp | 2 +- include/dsp/samplerate.hpp | 1 + include/util/math.hpp | 10 ++++++++++ 4 files changed, 15 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 3c93ea4e..1648cdfa 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,9 @@ I rarely accept code contributions to Rack itself, so please notify me in advanc ## Setting up your development environment -Rack's dependencies (GLEW, glfw, etc) do not need to be installed on your system, since specific versions are compiled locally during the build process. However, you need proper tools to build these dependencies. +Before building Rack, you must install build dependencies provided by your system's package manager. +Rack's own dependencies (GLEW, glfw, etc) do not need to be installed on your system, since specific versions are compiled locally during the build process. +However, you need proper tools to build Rack and these dependencies. ### Mac diff --git a/include/dsp/fir.hpp b/include/dsp/fir.hpp index e34c052b..4756e6ec 100644 --- a/include/dsp/fir.hpp +++ b/include/dsp/fir.hpp @@ -102,7 +102,7 @@ struct RealTimeConvolver { } /** Applies reverb to input - input and output must be size blockSize + input and output must be of size `blockSize` */ void processBlock(const float *input, float *output) { if (kernelBlocks == 0) { diff --git a/include/dsp/samplerate.hpp b/include/dsp/samplerate.hpp index ebb99559..ab4acd2e 100644 --- a/include/dsp/samplerate.hpp +++ b/include/dsp/samplerate.hpp @@ -34,6 +34,7 @@ struct SampleRateConverter { refreshState(); } + /** From 0 (worst, fastest) to 10 (best, slowest) */ void setQuality(int quality) { if (quality == this->quality) return; diff --git a/include/util/math.hpp b/include/util/math.hpp index 8312541e..3f14cfb1 100644 --- a/include/util/math.hpp +++ b/include/util/math.hpp @@ -18,6 +18,16 @@ namespace rack { // basic integer functions //////////////////// +/** Returns true if x is odd */ +inline bool isOdd(int x) { + return x % 2 != 0; +} + +/** Returns true if x is odd */ +inline bool isEven(int x) { + return x % 2 == 0; +} + /** Returns the minimum of `a` and `b` */ inline int min(int a, int b) { return (a < b) ? a : b;