Skip to content

Commit 574186f

Browse files
committed
Fix dry latency
1 parent fa50357 commit 574186f

File tree

1 file changed

+18
-8
lines changed

1 file changed

+18
-8
lines changed

src/Robotone/Effect.cpp

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -65,14 +65,24 @@ void Effect::update(int note, double velocity)
6565

6666
void Effect::dry(const std::span<const float> input, const std::span<float> output)
6767
{
68-
std::transform(
69-
input.begin(),
70-
input.end(),
71-
output.begin(),
72-
[&](const float x)
73-
{
74-
return x; // TODO: latency
75-
});
68+
src->resample(input, output, [&](const std::span<const float> input,
69+
const std::span<float> output)
70+
{
71+
std::transform(
72+
input.begin(),
73+
input.end(),
74+
output.begin(),
75+
[&](float x)
76+
{
77+
float y = sdft->transform(x, [&](const std::span<const std::complex<double>> dftanal,
78+
const std::span<std::complex<double>> dftsynth)
79+
{
80+
std::copy(dftanal.begin(), dftanal.end(), dftsynth.begin());
81+
});
82+
83+
return y;
84+
});
85+
});
7686
}
7787

7888
void Effect::wet(const std::span<const float> input, const std::span<float> output)

0 commit comments

Comments
 (0)