Skip to content

Commit 6182ad0

Browse files
committed
Don't change window size via octave shift #6
1 parent 6587133 commit 6182ad0

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/Robotone/Effect.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,13 @@ int Effect::latency() const
2222
void Effect::reset()
2323
{
2424
const double sr = config.samplerate * (config.decimate ? 0.5 : 1);
25-
const double cp = config.concertpitch;
25+
const double cp = config.concertpitch * std::pow(2.0, double(config.octave));
2626

2727
const double window = std::max(double(config.millis), 1.0) * sr * 1e-3;
28-
const double factor = std::pow(2.0, double(config.octave)) * 0.5;
29-
const size_t dftsize = static_cast<size_t>(std::max(window * factor, 1.0));
28+
const size_t dftsize = static_cast<size_t>(std::max(window * 0.5, 1.0));
3029

31-
LOG("Reset millis %d octave %d window %f factor %f dftsize %zu",
32-
config.millis, config.octave, window, factor, dftsize);
30+
LOG("Reset millis %d octave %d window %f dftsize %zu",
31+
config.millis, config.octave, window, dftsize);
3332

3433
src = std::make_unique<SRC>(config.samplerate, sr, config.blocksize);
3534
sdft = std::make_unique<SDFT>(sr, dftsize);

0 commit comments

Comments
 (0)