From b4d6cb1cdb7b3b77a8c8a0eff926461ee5b67d64 Mon Sep 17 00:00:00 2001 From: Weird Constructor Date: Thu, 5 Aug 2021 05:48:27 +0200 Subject: [PATCH] jiggled code around... --- src/dsp/node_vosc.rs | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/dsp/node_vosc.rs b/src/dsp/node_vosc.rs index da3476f..4d0347e 100644 --- a/src/dsp/node_vosc.rs +++ b/src/dsp/node_vosc.rs @@ -131,14 +131,13 @@ impl DspNode for VOsc { if oversample { for frame in 0..ctx.nframes() { + let freq = denorm_offs::VOsc::freq(freq, det.read(frame), frame); + let v = denorm::VOsc::v(v, frame).clamp(0.0, 1.0); + let d = denorm::VOsc::d(d, frame).clamp(0.0, 1.0); + let vs = denorm::VOsc::vs(vs, frame).clamp(0.0, 20.0); + let overbuf = self.oversampling.resample_buffer(); - for i in 0..4 { - let freq = denorm_offs::VOsc::freq(freq, det.read(frame), frame); - let v = denorm::VOsc::v(v, frame).clamp(0.0, 1.0); - let d = denorm::VOsc::d(d, frame).clamp(0.0, 1.0); - let vs = denorm::VOsc::vs(vs, frame).clamp(0.0, 20.0); - let s = s(phi_vps(self.phase, v + vs, d)); overbuf[i] = s; @@ -152,9 +151,9 @@ impl DspNode for VOsc { } else { for frame in 0..ctx.nframes() { let freq = denorm_offs::VOsc::freq(freq, det.read(frame), frame); - let v = denorm::VOsc::v(v, frame).clamp(0.0, 1.0); - let d = denorm::VOsc::d(d, frame).clamp(0.0, 1.0); - let vs = denorm::VOsc::vs(vs, frame).clamp(0.0, 20.0); + let v = denorm::VOsc::v(v, frame).clamp(0.0, 1.0); + let d = denorm::VOsc::d(d, frame).clamp(0.0, 1.0); + let vs = denorm::VOsc::vs(vs, frame).clamp(0.0, 20.0); let s = s(phi_vps(self.phase, v + vs, d));