Skip to content

Commit 31c5429

Browse files
committed
If a source is powered down zero its outputs
Since otherwise you get remnants when you toggle power
1 parent 25df770 commit 31c5429

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

src/dsp/op_source.h

+2
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,8 @@ struct alignas(16) OpSource : public EnvelopeSupport<Patch::SourceNode>,
123123
rmAssigned = false;
124124
}
125125

126+
void clearOutputs() { memset(output, 0, sizeof(output)); }
127+
126128
void snapActive() { active = activeV > 0.5; }
127129

128130
float baseFrequency{0};

src/synth/voice.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ void Voice::renderBlock()
8787
{
8888
if (!src[i].active)
8989
{
90+
src[i].clearOutputs();
9091
continue;
9192
}
9293
src[i].zeroInputs();

0 commit comments

Comments
 (0)