Skip to content

Commit

Permalink
More Teensy fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jatinchowdhury18 committed Dec 12, 2023
1 parent bed29ae commit 9b4c480
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ class FIRPolyphaseInterpolator

std::vector<float> oneFilterCoeffs (coeffsPerFilter);

#if JUCE_TEENSY
bufferPtrs.resize ((size_t) interpolationFactor);
#endif

buffers.clear();
buffers.reserve ((size_t) interpolationFactor);
filters.clear();
Expand Down Expand Up @@ -53,7 +57,9 @@ class FIRPolyphaseInterpolator
const auto interpolationFactor = (int) filters.size();

// set up sub-buffer pointers
#if ! JUCE_TEENSY
auto* bufferPtrs = static_cast<T**> (alloca (sizeof (T*) * (size_t) interpolationFactor));
#endif
for (size_t filterIndex = 0; filterIndex < (size_t) interpolationFactor; ++filterIndex)
bufferPtrs[filterIndex] = buffers[filterIndex].getWritePointer (channel);

Expand Down Expand Up @@ -86,5 +92,9 @@ class FIRPolyphaseInterpolator
std::vector<FIRFilter<T>> filters {};

std::vector<Buffer<T>> buffers {};

#if JUCE_TEENSY
std::vector<T*> bufferPtrs {};
#endif
};
} // namespace chowdsp

0 comments on commit 9b4c480

Please sign in to comment.