Skip to content

Commit

Permalink
Bugfix/dont realloc active kit rows (#3275)
Browse files Browse the repository at this point in the history
* only reallocate if were saving a reasonable amount of space

* dont free the active row memory when drums stop playing, limit note ons a bit more at high direness
  • Loading branch information
m-m-adams authored Jan 13, 2025
1 parent c52f81b commit 4f43b9f
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/deluge/dsp/delay/delay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ void Delay::process(std::span<StereoSample> buffer, const State& delayWorkingSta

// If spinning below native rate, the quality's going to be suffering, so make a new buffer whose native
// rate is half our current rate (double the quality)
else if (delayWorkingState.userDelayRate < primaryBuffer.nativeRate()) {
else if (delayWorkingState.userDelayRate < primaryBuffer.nativeRate() >> 1) {
initializeSecondaryBuffer(delayWorkingState.userDelayRate >> 1, false);
}
}
Expand Down
1 change: 1 addition & 0 deletions src/deluge/model/instrument/kit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ namespace params = deluge::modulation::params;
Kit::Kit() : Instrument(OutputType::KIT), drumsWithRenderingActive(sizeof(Drum*)) {
firstDrum = nullptr;
selectedDrum = nullptr;
drumsWithRenderingActive.emptyingShouldFreeMemory = false;
}

Kit::~Kit() {
Expand Down
4 changes: 3 additions & 1 deletion src/deluge/processing/engines/audio_engine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1062,7 +1062,9 @@ void routine() {
audioRoutineLocked = true;

numRoutines = 0;
voicesStartedThisRender = 0;
voicesStartedThisRender = std::max<int>(
cpuDireness - 12,
0); // if we're at high direness then we pretend a couple have already been started to limit note ons
if (!stemExport.processStarted || (stemExport.processStarted && !stemExport.renderOffline)) {
while (doSomeOutputting() && numRoutines < 2) {

Expand Down
2 changes: 0 additions & 2 deletions src/deluge/storage/audio/audio_file.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -230,8 +230,6 @@ Error AudioFile::loadFile(AudioFileReader* reader, bool isAiff, bool makeWaveTab
D_PRINTLN("play count: %d", loopData[5]);
}
}

D_PRINTLN("");
}
break;
}
Expand Down

0 comments on commit 4f43b9f

Please sign in to comment.