00001 /* 00002 ** Copyright (C) 1998-2006 George Tzanetakis <gtzan@cs.uvic.ca> 00003 ** 00004 ** This program is free software; you can redistribute it and/or modify 00005 ** it under the terms of the GNU General Public License as published by 00006 ** the Free Software Foundation; either version 2 of the License, or 00007 ** (at your option) any later version. 00008 ** 00009 ** This program is distributed in the hope that it will be useful, 00010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 ** GNU General Public License for more details. 00013 ** 00014 ** You should have received a copy of the GNU General Public License 00015 ** along with this program; if not, write to the Free Software 00016 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00017 */ 00018 00019 #ifndef MARSYAS_SPECTRUM2ACMCHROMA_H 00020 #define MARSYAS_SPECTRUM2ACMCHROMA_H 00021 00022 #include "MarSystem.h" 00023 #include <vector> 00024 00025 namespace Marsyas 00026 { 00056 class marsyas_EXPORT Spectrum2ACMChroma: public MarSystem 00057 { 00058 public: 00059 Spectrum2ACMChroma(mrs_string inName); 00060 Spectrum2ACMChroma(const Spectrum2ACMChroma& inToCopy); 00061 00062 ~Spectrum2ACMChroma(); 00063 00064 MarSystem* clone() const; 00065 00066 void addControls(); 00067 void myUpdate(MarControlPtr inSender); 00068 void myProcess(realvec& inSpectrum, realvec& outChroma); 00069 00070 private: 00071 MarSystem* Spectrum2ACMChromaNet_; 00072 00073 // Pointers to MarControllers: contain MOST RECENT values 00074 MarControlPtr ctrl_NrOfHarmonics_; 00075 MarControlPtr ctrl_F0Weight_; 00076 MarControlPtr ctrl_LowestF0_; 00077 00078 // Member variables: values SINCE LAST UPDATE 00079 mrs_natural NrOfHarmonics_; // Number of harmonics in harmonic sum 00080 mrs_real F0Weight_; // Relative weight of F0 in pitch evidence 00081 mrs_real LowestF0_; // Lowest candidate F0 (in Hz) 00082 00083 // Static member variables 00084 static const mrs_natural MedianLength_ = 80; // Length of median filter (in bins) 00085 static const mrs_natural NotesPerOctave_ = 12; // Number of notes per octave 00086 00087 // static const mrs_real RaiseFactor_; // Factor to raise background spectrum with 00088 // static const mrs_real Hysteresis_; // Hysteresis in peak detection function 00089 // static const mrs_real Tolerance_; // Relative tolerance for harmonic analysis 00090 // static const mrs_real Attenuation_; // Attenuation of higher order harmonics 00091 // static const mrs_real PowerOfAmplitude_; // Power of amplitude (0.5 for loudness) 00092 // static const mrs_real Diapason_; // Frequency of middle A (NN69) (in Hz) 00093 }; 00094 00095 } // End namespace 00096 00097 #endif
1.5.6