Marsyas
0.6.0-alpha
|
00001 /* 00002 ** Copyright (C) 1998-2010 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_BEATHISTOFEATURES_H 00020 #define MARSYAS_BEATHISTOFEATURES_H 00021 00022 #include <marsyas/system/MarSystem.h> 00023 #include "MaxArgMax.h" 00024 #include "Peaker.h" 00025 00026 namespace Marsyas 00027 { 00039 class BeatHistoFeatures: public MarSystem 00040 { 00041 private: 00042 MarSystem* mxr_; 00043 MarSystem* pkr_; 00044 MarSystem* pkr1_; 00045 00046 MarControlPtr ctrl_mode_; 00047 00048 realvec mxres_; 00049 realvec pkres_; 00050 realvec pkres1_; 00051 00052 realvec flag_; 00053 00054 void harm_prob(mrs_real& pmax, mrs_real factor, 00055 mrs_real& s1, mrs_natural& t1, 00056 mrs_real& s2, mrs_natural& t2, 00057 mrs_natural tmx, 00058 mrs_natural size, 00059 const realvec& in); 00060 00061 // helper function used by harm_prob 00062 mrs_real sum_nearby(mrs_natural index, mrs_natural radius, 00063 mrs_natural size, const realvec& in); 00064 00065 void myUpdate(MarControlPtr sender); 00066 void beatHistoFeatures(realvec& in, realvec& out); 00067 00068 mrs_real NumMax (mrs_realvec& in); 00069 00070 void addControls(); 00071 public: 00072 BeatHistoFeatures(std::string name); 00073 BeatHistoFeatures(const BeatHistoFeatures& a); 00074 00075 ~BeatHistoFeatures(); 00076 MarSystem* clone() const; 00077 00078 void myProcess(realvec& in, realvec& out); 00079 }; 00080 00081 }//namespace Marsyas 00082 00083 #endif 00084 00085