Marsyas
0.6.0-alpha
|
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 <marsyas/system/MarSystem.h> 00023 #include <vector> 00024 00025 namespace Marsyas 00026 { 00057 class marsyas_EXPORT Spectrum2ACMChroma: public MarSystem 00058 { 00059 public: 00060 Spectrum2ACMChroma(mrs_string inName); 00061 Spectrum2ACMChroma(const Spectrum2ACMChroma& inToCopy); 00062 00063 ~Spectrum2ACMChroma(); 00064 00065 MarSystem* clone() const; 00066 00067 void addControls(); 00068 void myUpdate(MarControlPtr inSender); 00069 void myProcess(realvec& inSpectrum, realvec& outChroma); 00070 00071 private: 00072 MarSystem* Spectrum2ACMChromaNet_; 00073 00074 // Pointers to MarControllers: contain MOST RECENT values 00075 MarControlPtr ctrl_NrOfHarmonics_; 00076 MarControlPtr ctrl_F0Weight_; 00077 MarControlPtr ctrl_LowestF0_; 00078 00079 // Member variables: values SINCE LAST UPDATE 00080 mrs_natural NrOfHarmonics_; // Number of harmonics in harmonic sum 00081 mrs_real F0Weight_; // Relative weight of F0 in pitch evidence 00082 mrs_real LowestF0_; // Lowest candidate F0 (in Hz) 00083 00084 // Static member variables 00085 static const mrs_natural MedianLength_ = 80; // Length of median filter (in bins) 00086 static const mrs_natural NotesPerOctave_ = 12; // Number of notes per octave 00087 00088 // static const mrs_real RaiseFactor_; // Factor to raise background spectrum with 00089 // static const mrs_real Hysteresis_; // Hysteresis in peak detection function 00090 // static const mrs_real Tolerance_; // Relative tolerance for harmonic analysis 00091 // static const mrs_real Attenuation_; // Attenuation of higher order harmonics 00092 // static const mrs_real PowerOfAmplitude_; // Power of amplitude (0.5 for loudness) 00093 // static const mrs_real Diapason_; // Frequency of middle A (NN69) (in Hz) 00094 }; 00095 00096 } // End namespace 00097 00098 #endif