r4084 - trunk/plugins



Author: timj
Date: 2006-11-14 19:18:39 -0500 (Tue, 14 Nov 2006)
New Revision: 4084

Modified:
   trunk/plugins/ChangeLog
   trunk/plugins/bsequantizer.cc
Log:
Wed Nov 15 01:15:30 2006  Tim Janik  <timj gtk org>                                                                                                                                                                                                                                                                                 * bsequantizer.cc: use dtoi32 for quantisation effects, which gives                                                                                           round-to-nearest, i.e.                                                                                                                                
        {-1.5 -> -1 <- -0.5}, {-0.5 -> 0 <- +0.5} and {+0.5 -> +1 <- +1.5}.                                                                                   
                                                                                                                                                              



Modified: trunk/plugins/ChangeLog
===================================================================
--- trunk/plugins/ChangeLog	2006-11-15 00:05:20 UTC (rev 4083)
+++ trunk/plugins/ChangeLog	2006-11-15 00:18:39 UTC (rev 4084)
@@ -1,3 +1,9 @@
+Wed Nov 15 01:15:30 2006  Tim Janik  <timj gtk org>
+
+	* bsequantizer.cc: use dtoi32 for quantisation effects, which gives
+	round-to-nearest, i.e.
+	{-1.5 -> -1 <- -0.5}, {-0.5 -> 0 <- +0.5} and {+0.5 -> +1 <- +1.5}.
+
 Wed Nov 15 00:27:55 2006  Tim Janik  <timj gtk org>
 
 	* bsequantizer.idl, bsequantizer.cc: added bit-quantization module.

Modified: trunk/plugins/bsequantizer.cc
===================================================================
--- trunk/plugins/bsequantizer.cc	2006-11-15 00:05:20 UTC (rev 4083)
+++ trunk/plugins/bsequantizer.cc	2006-11-15 00:18:39 UTC (rev 4084)
@@ -21,6 +21,7 @@
 #include <bse/bsemathsignal.h>
 
 namespace Bse { namespace Standard {
+using namespace Birnet;
 
 class Quantizer : public QuantizerBase {
   class Module: public SynthesisModule {
@@ -46,7 +47,7 @@
               float *ovalues = ostream (OCHANNEL_AUDIO_OUT1).values;
               const float *ivalues = istream (ICHANNEL_AUDIO_IN1).values;
               for (uint i = 0; i < n_values; i++)
-                ovalues[i] = ifactor * floor (ivalues[i] * qfactor);
+                ovalues[i] = ifactor * dtoi32 (ivalues[i] * qfactor);
             }
           else
             ostream_set (OCHANNEL_AUDIO_OUT1, const_values (0));
@@ -58,7 +59,7 @@
               float *ovalues = ostream (OCHANNEL_AUDIO_OUT2).values;
               const float *ivalues = istream (ICHANNEL_AUDIO_IN2).values;
               for (uint i = 0; i < n_values; i++)
-                ovalues[i] = ifactor * floor (ivalues[i] * qfactor);
+                ovalues[i] = ifactor * dtoi32 (ivalues[i] * qfactor);
             }
           else
             ostream_set (OCHANNEL_AUDIO_OUT2, const_values (0));




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]