Skip to content

Commit b2f77af

Browse files
committed
add epsilon to audio pass-through to disable VST3 auto-suspend
1 parent 0c08748 commit b2f77af

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

Source/PluginProcessor.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,18 @@ processBlock
256256
(AudioBuffer<float>& buffer,
257257
MidiBuffer& midiMessages)
258258
{
259+
auto mainInputOutput = getBusBuffer (buffer, true, 0);
260+
261+
// add a hopefully inaudible float epsilon here to circumvent VST3
262+
// plugin auto-suspend (tested in Bitwig). This is ugly, let's
263+
// hope we can switch to CLAP soon or find a saner solution by
264+
// flagging the host that we don't want to get suspended via the
265+
// JUCE API.
266+
for (auto j = 0; j < buffer.getNumSamples(); ++j)
267+
for (auto i = 0; i < mainInputOutput.getNumChannels(); ++i)
268+
*mainInputOutput.getWritePointer (i, j) =
269+
*mainInputOutput.getReadPointer (i, j) +
270+
std::numeric_limits<float>::epsilon();
259271
}
260272

261273
bool

0 commit comments

Comments
 (0)