From 1348de3cdf49282db115493e5f2a1ba72af6fd6d Mon Sep 17 00:00:00 2001 From: Pierre Alexandre Tremblay Date: Mon, 7 Apr 2025 17:03:32 +0200 Subject: [PATCH 1/3] fixes 269 --- include/flucoma/clients/nrt/BufComposeClient.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/flucoma/clients/nrt/BufComposeClient.hpp b/include/flucoma/clients/nrt/BufComposeClient.hpp index 9546aee89..6c798c6b3 100644 --- a/include/flucoma/clients/nrt/BufComposeClient.hpp +++ b/include/flucoma/clients/nrt/BufComposeClient.hpp @@ -199,7 +199,7 @@ class BufComposeClient : public FluidBaseClient, OfflineIn, OfflineOut { Result resizeResult = destination.resize(destinationOrig.cols(), destinationOrig.rows(), - destination.sampleRate()); + source.sampleRate()); if (!resizeResult.ok()) return resizeResult; for (index i = 0; i < destination.numChans(); ++i) destination.samps(i) <<= destinationOrig.row(i); From af3324a63a459af0d605022ca7ed3c3ccbdfcbed Mon Sep 17 00:00:00 2001 From: Pierre Alexandre Tremblay Date: Mon, 7 Apr 2025 20:10:58 +0200 Subject: [PATCH 2/3] scope! --- include/flucoma/clients/nrt/BufComposeClient.hpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/include/flucoma/clients/nrt/BufComposeClient.hpp b/include/flucoma/clients/nrt/BufComposeClient.hpp index 6c798c6b3..406108c6a 100644 --- a/include/flucoma/clients/nrt/BufComposeClient.hpp +++ b/include/flucoma/clients/nrt/BufComposeClient.hpp @@ -81,6 +81,8 @@ class BufComposeClient : public FluidBaseClient, OfflineIn, OfflineOut index nChannels{0}; index nFrames{0}; + float sourceSR; + { BufferAdaptor::ReadAccess source(get().get()); @@ -106,6 +108,8 @@ class BufComposeClient : public FluidBaseClient, OfflineIn, OfflineOut if (get() >= source.numChans()) return {Result::Status::kError, "Start channel ", get(), " out of range."}; + + sourceSR = source.sampleRate(); } index dstStart = get(); @@ -161,7 +165,7 @@ class BufComposeClient : public FluidBaseClient, OfflineIn, OfflineOut // Access sources inside own scope block, so they'll be unlocked before // we need to (possibly) resize the desintation buffer which could - // (possibly) also be one of the sources + // (possibly) also be one of the sources { BufferAdaptor::ReadAccess source(get().get()); auto gain = get(); @@ -199,7 +203,7 @@ class BufComposeClient : public FluidBaseClient, OfflineIn, OfflineOut { Result resizeResult = destination.resize(destinationOrig.cols(), destinationOrig.rows(), - source.sampleRate()); + sourceSR); if (!resizeResult.ok()) return resizeResult; for (index i = 0; i < destination.numChans(); ++i) destination.samps(i) <<= destinationOrig.row(i); From 1728dfea1af1e1f2dba2f932e525099c4d2cb20b Mon Sep 17 00:00:00 2001 From: Pierre Alexandre Tremblay Date: Fri, 13 Jun 2025 09:39:06 +0200 Subject: [PATCH 3/3] amended the resolution of the sourceSR variable --- include/flucoma/clients/nrt/BufComposeClient.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/flucoma/clients/nrt/BufComposeClient.hpp b/include/flucoma/clients/nrt/BufComposeClient.hpp index 406108c6a..2b2c15619 100644 --- a/include/flucoma/clients/nrt/BufComposeClient.hpp +++ b/include/flucoma/clients/nrt/BufComposeClient.hpp @@ -81,7 +81,7 @@ class BufComposeClient : public FluidBaseClient, OfflineIn, OfflineOut index nChannels{0}; index nFrames{0}; - float sourceSR; + double sourceSR; { BufferAdaptor::ReadAccess source(get().get());