src/synth/wavetable.c: always clamp wavetable
authorPaul Brossier <piem@piem.org>
Sun, 26 Mar 2017 13:39:27 +0000 (15:39 +0200)
committerPaul Brossier <piem@piem.org>
Sun, 26 Mar 2017 13:39:27 +0000 (15:39 +0200)
examples/aubioonset.c
examples/aubiotrack.c
src/synth/wavetable.c

index 680471c..d88fe04 100644 (file)
@@ -45,7 +45,6 @@ void process_block(fvec_t *ibuf, fvec_t *obuf)
   }
   if (mix_input) {
     aubio_wavetable_do (wavetable, ibuf, obuf);
-    fvec_clamp(obuf, 1.);
   } else {
     aubio_wavetable_do (wavetable, obuf, obuf);
   }
index ba047d3..d4a1de7 100644 (file)
@@ -48,7 +48,6 @@ void process_block(fvec_t * ibuf, fvec_t *obuf) {
   }
   if (mix_input) {
     aubio_wavetable_do (wavetable, ibuf, obuf);
-    fvec_clamp(obuf, 1.);
   } else {
     aubio_wavetable_do (wavetable, obuf, obuf);
   }
index 8dacde3..ea08568 100644 (file)
@@ -103,6 +103,7 @@ void aubio_wavetable_do ( aubio_wavetable_t * s, const fvec_t * input, fvec_t *
     for (i = 0; i < output->length; i++) {
       output->data[i] += input->data[i];
     }
+    fvec_clamp(obuf, 1.);
   }
 }