diff --git a/src/configuration.h b/src/configuration.h index 8610a89..be087aa 100644 --- a/src/configuration.h +++ b/src/configuration.h @@ -50,7 +50,9 @@ enum ResamplerEngine SRC_FAST, SRC_MEDIUM, SRC_BEST, - LANCZOS + LANCZOS, + LINTERP, + ZOH }; } // namespace baconpaul::six_sines diff --git a/src/synth/patch.h b/src/synth/patch.h index fbc64da..7bd5d56 100644 --- a/src/synth/patch.h +++ b/src/synth/patch.h @@ -1146,13 +1146,15 @@ struct Patch : pats::PatchBase .withName(name() + " Resampler Engine") .withGroupName(name()) .withDefault(ResamplerEngine::SRC_FAST) - .withRange(ResamplerEngine::SRC_FAST, ResamplerEngine::LANCZOS) + .withRange(ResamplerEngine::SRC_FAST, ResamplerEngine::ZOH) .withID(id(41)) .withUnorderedMapFormatting({ {ResamplerEngine::SRC_FAST, "SRC Fast (rec)"}, {ResamplerEngine::SRC_MEDIUM, "SRC Medium"}, {ResamplerEngine::SRC_BEST, "SRC Expensive"}, {ResamplerEngine::LANCZOS, "Lanczos A=4"}, + {ResamplerEngine::LINTERP, "Linear Interp"}, + {ResamplerEngine::ZOH, "ZOH"}, })), ModulationMixin(name(), id(120)), modtarget(scpu::make_array_lambda( diff --git a/src/synth/synth.cpp b/src/synth/synth.cpp index 8140ccc..7cdb898 100644 --- a/src/synth/synth.cpp +++ b/src/synth/synth.cpp @@ -122,11 +122,21 @@ void Synth::setSampleRate(double sampleRate) SXSNLOG("Setting SRC Resampler - SRC_SINC_MEDIUM_QUALITY"); mode = SRC_SINC_MEDIUM_QUALITY; } - if (resamplerEngine == SRC_BEST) + else if (resamplerEngine == SRC_BEST) { SXSNLOG("Setting SRC Resampler - SRC_SINC_BEST_QUALITY"); mode = SRC_SINC_BEST_QUALITY; } + else if (resamplerEngine == LINTERP) + { + SXSNLOG("Setting SRC Resampler - SRC_LINEAR"); + mode = SRC_LINEAR; + } + else if (resamplerEngine == ZOH) + { + SXSNLOG("Setting SRC Resampler - SRC_ZERO_ORDER_HOLD"); + mode = SRC_ZERO_ORDER_HOLD; + } else { SXSNLOG("Setting SRC Resampler - SRC_SINC_FASTEST");