shithub: aubio

Download patch

ref: d0f0d553204e182152261cfbd4d8ff625739bf6d
parent: b799241bdde98885bb18b0f2e2cc06b063eb2d13
author: Paul Brossier <[email protected]>
date: Fri Mar 10 15:17:36 EST 2017

examples/aubioonset.c: avoid saturation in when using --mix-input

--- a/examples/aubioonset.c
+++ b/examples/aubioonset.c
@@ -43,10 +43,12 @@
   } else {
     aubio_wavetable_stop ( wavetable );
   }
-  if (mix_input)
+  if (mix_input) {
     aubio_wavetable_do (wavetable, ibuf, obuf);
-  else
+    fvec_clamp(obuf, 1.);
+  } else {
     aubio_wavetable_do (wavetable, obuf, obuf);
+  }
 }
 
 void process_print (void)