Skip to content

Commit

Permalink
Do a checked span truncation
Browse files Browse the repository at this point in the history
  • Loading branch information
kcat committed Jun 21, 2024
1 parent 510a0c3 commit f91c044
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions alc/effects/distortion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ void DistortionState::process(const size_t samplesToDo, const al::span<const Flo
* (which is fortunately first step of distortion). So combine three
* operations into the one.
*/
mLowpass.process({mBuffer[0].data(), todo}, mBuffer[1]);
mLowpass.process(al::span{mBuffer[0]}.first(todo), mBuffer[1]);

/* Second step, do distortion using waveshaper function to emulate
* signal processing during tube overdriving. Three steps of
Expand All @@ -142,7 +142,7 @@ void DistortionState::process(const size_t samplesToDo, const al::span<const Flo
proc_sample);

/* Third step, do bandpass filtering of distorted signal. */
mBandpass.process({mBuffer[0].data(), todo}, mBuffer[1]);
mBandpass.process(al::span{mBuffer[0]}.first(todo), mBuffer[1]);

todo >>= 2;
auto outgains = mGain.cbegin();
Expand Down

0 comments on commit f91c044

Please sign in to comment.