From 16fe199cb2aae8862a82d5f68fc99ec5edb4b643 Mon Sep 17 00:00:00 2001 From: tildearrow Date: Mon, 21 Mar 2022 23:54:01 -0500 Subject: [PATCH] scale loop when resampling --- src/engine/sample.cpp | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/src/engine/sample.cpp b/src/engine/sample.cpp index 55982e59..66e54d85 100644 --- a/src/engine/sample.cpp +++ b/src/engine/sample.cpp @@ -278,8 +278,9 @@ bool DivSample::trim(unsigned int begin, unsigned int end) { } #define RESAMPLE_END \ - samples=finalCount; \ if (loopStart>=0) loopStart=(double)loopStart*(r/(double)rate); \ + rate=r; \ + samples=finalCount; \ if (depth==16) { \ delete[] oldData16; \ } else if (depth==8) { \ @@ -309,8 +310,6 @@ bool DivSample::resampleNone(double r) { } } - rate=r; - RESAMPLE_END; return true; } @@ -350,8 +349,6 @@ bool DivSample::resampleLinear(double r) { } } - rate=r; - RESAMPLE_END; return true; } @@ -406,8 +403,6 @@ bool DivSample::resampleCubic(double r) { } } - rate=r; - RESAMPLE_END; return true; } @@ -497,8 +492,6 @@ bool DivSample::resampleBlep(double r) { } } - rate=r; - RESAMPLE_END; return true; } @@ -566,8 +559,6 @@ bool DivSample::resampleSinc(double r) { } } - rate=r; - RESAMPLE_END; return true; }