Index: CLAM/test/UnitTests/TonalAnalysis/InstantTunningEstimatorTest.cxx
===================================================================
--- CLAM/test/UnitTests/TonalAnalysis/InstantTunningEstimatorTest.cxx	(revision 10376)
+++ CLAM/test/UnitTests/TonalAnalysis/InstantTunningEstimatorTest.cxx	(working copy)
@@ -64,12 +64,12 @@
 	void assertFoundCenterIs(double expectedCenter, double expectedStrength,
 			unsigned nPeaks, double * peakPositions, double * peakValues)
 	{
-		InstantTunningEstimator tunningEstimator(0.0,1);
+		InstantTunningEstimator tunningEstimator;
 		
 		std::vector< std::pair<double,double> > peaks;
 		for(unsigned i=0; i<nPeaks; ++i) 
 		{
-			peaks.push_back( std::pair<double,double>(peakPositions[i],peakValues[i]));
+			peaks.push_back( std::make_pair(peakPositions[i],peakValues[i]));
 		}
 		
 		tunningEstimator.doIt(peaks);
@@ -79,7 +79,34 @@
 		CPPUNIT_ASSERT_DOUBLES_EQUAL(expectedCenter, centerAndStrength.first,1e-14);
 		CPPUNIT_ASSERT_DOUBLES_EQUAL(expectedStrength, centerAndStrength.second,1e-14);
 	}
+	void assertFoundCenterIsWithInertia(double expectedCenter, double expectedStrength,
+			unsigned nPeaks1, double * peakPositions1, double * peakValues1,
+			unsigned nPeaks2, double * peakPositions2, double * peakValues2,
+			double inertia)
+	{
+		InstantTunningEstimator tunningEstimator;
+		tunningEstimator.setInertia(inertia);
+		
+		std::vector< std::pair<double,double> > peaks1;
+		for(unsigned i=0; i<nPeaks1; ++i) 
+		{
+			peaks1.push_back( std::make_pair(peakPositions1[i],peakValues1[i]));
+		}
+		std::vector< std::pair<double,double> > peaks2;
+		for(unsigned i=0; i<nPeaks2; ++i) 
+		{
+			peaks2.push_back( std::make_pair(peakPositions2[i],peakValues2[i]));
+		}
+		
+		tunningEstimator.doIt(peaks1);
+		tunningEstimator.doIt(peaks2);
 
+		std::pair<double,double> centerAndStrength = tunningEstimator.output();
+
+		CPPUNIT_ASSERT_DOUBLES_EQUAL(expectedCenter, centerAndStrength.first,1e-14);
+		CPPUNIT_ASSERT_DOUBLES_EQUAL(expectedStrength, centerAndStrength.second,1e-14);
+	}
+			
 	void testSilence()
 	{
 		unsigned nPeaks=0;
@@ -146,42 +173,27 @@
 	}
 	void testSeveralFrames_withoutInertia()
 	{
-		std::vector< std::pair<double,double> > peaks1;
-		peaks1.push_back( std::pair<double,double>(0.0, 8.0) );
-		peaks1.push_back( std::pair<double,double>(1.0, 8.0) );
+		const unsigned nPeaks1=2;
+		double positions1[]={0.0, 1.0};
+		double values1   []={8.0, 8.0};
 		
-		std::vector< std::pair<double,double> > peaks2;
-		peaks2.push_back( std::pair<double,double>(0.5, 8.0) );
-		peaks2.push_back( std::pair<double,double>(1.5, 8.0) );
+		const unsigned nPeaks2=2;
+		double positions2[]={0.5, 1.5};
+		double values2   []={8.0, 8.0};
 		
-		InstantTunningEstimator tunningEstimator(0.0,1);
-		tunningEstimator.doIt(peaks1);
-		tunningEstimator.doIt(peaks2);
-
-		std::pair<double,double> centerAndStrength = tunningEstimator.output();
-
-		CPPUNIT_ASSERT_DOUBLES_EQUAL(0.5, centerAndStrength.first, 1e-14);
-		CPPUNIT_ASSERT_DOUBLES_EQUAL(16.0, centerAndStrength.second, 1e-14);
+		assertFoundCenterIsWithInertia(.5, 16.0, nPeaks1, positions1, values1, nPeaks2, positions2, values2, 0.0);
 	}
 	void testSeveralFrames_withInertia()
 	{
-		std::vector< std::pair<double,double> > peaks1;
-		peaks1.push_back( std::pair<double,double>(0.0, 8.0) );
-		peaks1.push_back( std::pair<double,double>(1.0, 8.0) );
+		const unsigned nPeaks1=2;
+		double positions1[]={0.0, 1.0};
+		double values1   []={8.0, 8.0};
 		
-		std::vector< std::pair<double,double> > peaks2;
-		peaks2.push_back( std::pair<double,double>(0.5, 8.0) );
-		peaks2.push_back( std::pair<double,double>(1.5, 8.0) );
-
-		InstantTunningEstimator tunningEstimator(0.0,1);
-		tunningEstimator.setInertia(.4);
-		tunningEstimator.doIt(peaks1);
-		tunningEstimator.doIt(peaks2);
-
-		std::pair<double,double> centerAndStrength = tunningEstimator.output();
-
-		CPPUNIT_ASSERT_DOUBLES_EQUAL(0.5, centerAndStrength.first, 1e-14);
-		CPPUNIT_ASSERT_DOUBLES_EQUAL(9.44, centerAndStrength.second, 1e-14);
+		const unsigned nPeaks2=2;
+		double positions2[]={0.5, 1.5};
+		double values2   []={8.0, 8.0};
+		
+		assertFoundCenterIsWithInertia(.5, 9.44, nPeaks1, positions1, values1, nPeaks2, positions2, values2, 0.4);
 	}
 };
 
Index: CLAM/src/Processing/Analysis/Tonal/InstantTunningEstimator.hxx
===================================================================
--- CLAM/src/Processing/Analysis/Tonal/InstantTunningEstimator.hxx	(revision 10376)
+++ CLAM/src/Processing/Analysis/Tonal/InstantTunningEstimator.hxx	(working copy)
@@ -35,7 +35,6 @@
  * The inertia sets how much of the previous computed
  * value it kept for the next execution.
  * The instantTunning output doesn't take into account the inertia.
- * @todo Explain how binsPerSemitone affects the input and the output.
  * @todo Explain which are the reference values the tunning is expressed relative to.
  */
 class InstantTunningEstimator
@@ -47,12 +46,10 @@
 	double _fasorY;
 	double _instantX;
 	double _instantY;
-	unsigned _binsPerSemitone;
 	double _inertia;
 public:
-	InstantTunningEstimator(double inertia=0.0, unsigned binsPerSemitone=3)
+	InstantTunningEstimator(double inertia=0.0)
 		: _inertia(inertia)
-		, _binsPerSemitone(binsPerSemitone)
 	{
 		_fasorX=1.0;
 		_fasorY=0.0;
@@ -64,17 +61,6 @@
 	{
 		_inertia=inertia;
 	}
-	void doIt(unsigned int nPeaks, const double * peakPositions, const double * peakValues)
-	{
-		_fasorX*=_inertia;
-		_fasorY*=_inertia;
-		for (unsigned int peak=0; peak<nPeaks; peak++)
-		{
-			double radiantTunning=peakPositions[peak]*2*M_PI/_binsPerSemitone;
-			_fasorX+=cos(radiantTunning)*peakValues[peak];
-			_fasorY+=sin(radiantTunning)*peakValues[peak];
-		}
-	}
 	// TODO: This function is taken by S&R of the previous one, no test!!
 	void doIt(const std::vector<std::pair<double, double> >& peaks)
 	{
@@ -84,7 +70,7 @@
 		_instantY=0;
 		for (unsigned int peak=0; peak<peaks.size(); peak++)
 		{
-			double radiantTunning=peaks[peak].first*2*M_PI/_binsPerSemitone;
+			double radiantTunning=peaks[peak].first*2*M_PI;
 			_instantX+=cos(radiantTunning)*peaks[peak].second;
 			_instantY+=sin(radiantTunning)*peaks[peak].second;
 		}
@@ -93,13 +79,13 @@
 	}
 	std::pair<double,double> output() const
 	{
-		double tunning=std::atan2(_fasorY,_fasorX)*_binsPerSemitone/2/M_PI;
+		double tunning=std::atan2(_fasorY,_fasorX)/2/M_PI;
 		double strength=std::sqrt(_fasorY*_fasorY+_fasorX*_fasorX);
 		return std::make_pair(tunning, strength);
 	}
 	std::pair<double,double> instantTunning() const
 	{
-		double tunning=std::atan2(_instantY,_instantX)*_binsPerSemitone/2/M_PI;
+		double tunning=std::atan2(_instantY,_instantX)/2/M_PI;
 		double strength=std::sqrt(_instantY*_instantY+_instantX*_instantX);
 		return std::make_pair(tunning, strength);
 	}
Index: CLAM/src/Processing/Analysis/Tonal/ChordExtractor.hxx
===================================================================
--- CLAM/src/Processing/Analysis/Tonal/ChordExtractor.hxx	(revision 10376)
+++ CLAM/src/Processing/Analysis/Tonal/ChordExtractor.hxx	(working copy)
@@ -64,7 +64,7 @@
 		, _constantQFolder(_constantQTransform.getK(), binsPerOctave)
 		, _fourierTransform(_constantQTransform.getfftlength(),1,0)
 		, _circularPeakPicking(binsPerOctave, /*scaling factor*/ 12.0/binsPerOctave)
-		, _instantTunningEstimator(/*Inertia*/ 1.0, /*bins per semitone*/  1)
+		, _instantTunningEstimator(/*Inertia*/ 1.0)
 		, _circularPeakTunner(/*reference tunning*/ 0.0)
 		, _filter(0.7)
 		, _tunningEnabled(true)
