Skip to content

Commit

Permalink
Fix sawtooth generator crackling when changing the frequency
Browse files Browse the repository at this point in the history
  • Loading branch information
Nytra committed Jan 1, 2025
1 parent 57a55b2 commit 22321a1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ProjectObsidian/ProtoFlux/Audio/SawtoothGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public void Read<S>(Span<S> buffer) where S : unmanaged, IAudioSample<S>

tempBuffer = tempBuffer.EnsureSize(buffer.Length);
var temptime = time;
temptime %= (float)base.Engine.AudioSystem.SampleRate;
temptime %= (1f / Frequency);
var clampedAmplitude = MathX.Clamp01(Amplitude);
float advance = (1f / (float)base.Engine.AudioSystem.SampleRate);
for (int i = 0; i < buffer.Length; i++)
Expand Down

0 comments on commit 22321a1

Please sign in to comment.