From 3302efc33883070479a940f12659e8bc63571c50 Mon Sep 17 00:00:00 2001 From: David Huss <dh@atoav.com> Date: Sun, 5 Sep 2021 12:25:01 +0200 Subject: [PATCH] Use mul_add for slight precision gain --- src/main.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main.rs b/src/main.rs index bf59c9d..da9e38b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -16,9 +16,9 @@ TODO: - [ ] Document dependecies - [ ] Performance improvements: - [ ] implement performance monitoring - - [ ] f32.mul_add() or f32.to_bits() / f32.from_bits() - - [x] only calculate connected ports https://docs.rs/jack/0.7.1/jack/struct.Port.html#method.connected_count - [ ] Flag volume modulations as dirty + - [x] f32.mul_add() or f32.to_bits() / f32.from_bits() + - [x] only calculate connected ports https://docs.rs/jack/0.7.1/jack/struct.Port.html#method.connected_count - [x] Support other Buffers than 1024 - [ ] Features: - [ ] Flags to control printing (--quiet etc) @@ -188,7 +188,7 @@ fn main() { // Multiply each input sample at position `sample_index` with the // volume and sum it with the corresponding (existing) output sample // at the same position - *sample += input_samples[sample_index] * volume; + *sample = input_samples[sample_index].mul_add(volume, *sample); } }); }); -- GitLab