chordata-1.0.0/0000755014157701161570000000000011344231244015452 5ustar david.garciaLNX_david.garciachordata-1.0.0/src/0000755014157701161570000000000011344231240016235 5ustar david.garciaLNX_david.garciachordata-1.0.0/src/FloatVectorStorage.hxx0000644014157701161570000000207511052335303022550 0ustar david.garciaLNX_david.garcia#ifndef __FloatVectorStorage_hxx__ #define __FloatVectorStorage_hxx__ #include #include #include class FloatVectorStorageConfig : public CLAM::ProcessingConfig { public: DYNAMIC_TYPE_USING_INTERFACE (FloatVectorStorageConfig, 2, ProcessingConfig); DYN_ATTRIBUTE (0, public, unsigned, Bins); DYN_ATTRIBUTE (1, public, unsigned long, Frames); protected: void DefaultInit(void); }; class FloatVectorStorage : public CLAM::Processing { typedef std::vector FloatVector; typedef FloatVectorStorageConfig Config; public: FloatVectorStorage(const Config& cfg = Config()); virtual const char* GetClassName() const; virtual bool Do(); virtual ~FloatVectorStorage(); FloatVector& Data(); protected: // methods virtual bool ConcreteConfigure(const CLAM::ProcessingConfig& cfgObject); virtual bool ConcreteStart(); protected: // attributes Config _config; CLAM::InPort _in; FloatVector _data; }; #endif //__FloatVectorStorage_hxx__ chordata-1.0.0/src/PoolSegmentationDataSource.hxx0000644014157701161570000000321511327157564024252 0ustar david.garciaLNX_david.garcia/* * Copyright (c) 2001-2006 MUSIC TECHNOLOGY GROUP (MTG) * UNIVERSITAT POMPEU FABRA * * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ #ifndef PoolSegmentationDataSource_hxx #define PoolSegmentationDataSource_hxx #include #include namespace CLAM { namespace VM { class PoolSegmentationDataSource : public SegmentationDataSource { public: PoolSegmentationDataSource(); void updateData(CLAM::Segmentation & data); bool setCurrentTime(double timeMiliseconds); double currentTime(); std::string getLabel(unsigned bin) const { static std::string dummyLabel; return dummyLabel; } const CLAM::Segmentation & frameData() { return _data; } void release() { } bool isEnabled() const { return true; } private: CLAM::DiscontinuousSegmentation _data; double _currentTime; }; } } #endif// PoolSegmentationDataSource_hxx chordata-1.0.0/src/images/0000755014157701161570000000000011344231240017502 5ustar david.garciaLNX_david.garciachordata-1.0.0/src/images/tonnetz.svg0000644014157701161570000002721111047354703021741 0ustar david.garciaLNX_david.garcia image/svg+xml chordata-1.0.0/src/images/help.png0000644014157701161570000000224211047354703021152 0ustar david.garciaLNX_david.garciaPNG  IHDRĴl;bKGD pHYs  #utIME 0% /IDATxڕMlTU)SH)iR@D DՄ& *1n`+bc T7&kS5A)!"R[;BiL3yxm%9=9Q9zZ|:ưϫqqQg4zH iq1]P!yRڌSfԎ|P*[ܚRg%=%jDѫGp֜i2Ǟ)j1FRwK&/pvcUyx%}`}MfL>a#+3ca "4s.![s>q_yF!,#]z\|WPvEx~oG7&'DZ%ӫÅm&{x++{*SҾ>nh%*d=j{&nDZн5O FX/e=V&gY'p3BM=rJ:l 'Bw KAӫXI/b@;+ʋy2137&~b 7h3o> @BB A?|߿Lg(:(盶{|޷?| 5 y_m_?1@kC<4Pw Q`#dV/ vPΓz\⹤IXTP7IANǏ ?.&& o<FFT $>'߀A?C=>(Eow[[+0ؘ+;޿pc#Wna}(9$\g'A\ ?͛ 1F 7ᅨGQ5@Ϡ@ @!>=%K#yCM_$x>~x4 4-@,D?sxyH˭W~ar ǧ l, ~KxZno_ H@~}ȐoM<r@CAEN~gзaP P6{ OL e o0I1dEj3| I /Nj2|q p6cNtBʇD0 eG/1k2dGk3=+lp,Xz& ܿv hx2,-ga=AA(˂gdge`x ,uu!c71`(CW >f |bbecOX^|_@>C=oO3\=r+/^2dr((GJ쵻14F)1Ug| fP%_@f2|\O_gx? ?eÏo~WwO1{_30ga`$x@D Bh~o >B "P B w>|¿`   /0H~AJ@vn?0;B@O|E ȹ'{`pH(:0?+`!? `/|ңw ^-XJ@ 7$1_O?1| /# Ç@%Ba0Ó/ ` SS023 ?`_C踗20rr10:?7zu +O | 19@_ #$ 030~3<}򙁓 )2P (/!O ,#C' u_4?8a0ky1 ?@dBA * yyC2x(@pϩODÈ F`T1[;L@&&`EQ@*ξÏ@׽Y @Ag3$a/!l!n#,e!?|cq V!]gE3p!)Sgf8x @ν r R;L"D '0?~1|HT5}c`vШ/b{`!\~Z72C Zf/0c`7$A\C񿟯o~)@eOn?RГ1ٷâvQMYJ <>sY֐mIPw^b /PxFkM%rP`^;$ݙpBJE3hAxq 4@ܷ"!&3mm#|N^LM3hq{`}3P؆00E f22qrf͇_.Q-GLeqIjtHEe !d'-h+)< u[a > ;'$2JZ]Vx泔Bt;ni1_]I!4 Ub\Im?2CIt-ԣx+~@#6ZGWXi:LUH$1uۭ=fjf\XNtG7Ʋm0sՆ9.ŦmI.߬cbY,T̕܉ќ,\ljBE0j_[TĔ)@ť:YVT*эhq?ȈRS{8Gր/0FT*4oţ +9* Q()tIU;2PՌeAnZEIENDB`chordata-1.0.0/src/images/contexthelp.png0000644014157701161570000000173211047354703022562 0ustar david.garciaLNX_david.garciaPNG  IHDRĴl;bKGD pHYs  #utIME  v3#gIDATxڵ_L[uǿ[1 ie.BHaYJ 2;"H<RjH*5[M.K2~C ~ƕ):D=ySw4K??h.}>fNJq\o.,,)˫{_>N{{Ϸhm`kܮܟd= & ~qpp*RmQAL W$ ]hi2;cU=o'IrnqqW(VsL+$ L(w:b Ec閂hʊ*A{ 011aj$gV4LIra}mll>222I(+fHa %&JqOo~ק*6s0;D" _aa5AdehAFGGR빂74,MDQ!8,bjjkD.)9}HAVTn.Swah=?+JҥNO [-=GޥTkle lhA>-?L@WAJ*^>_C}Tc<ȭH&zQ!IҍBnv3 Bgg'`?,rE"Hb!+(:[7??OP/t@|b\fiX__@0*rh4744D(rbfyiZS"͇a(t0ܓ3_ 5j|IENDB`chordata-1.0.0/src/images/exit.png0000644014157701161570000000230511044656020021165 0ustar david.garciaLNX_david.garciaPNG  IHDRĴl;sBIT|dtEXtSoftwarewww.inkscape.org<WIDAT8OTW;w`fbCC,,(X56qa⊅ѥ WKW$…[dƄQ:RT|̽3tq6&'My~%Ե]3d)eVTJ++#U+Ե+'O^.a)RJ`?ZWgObu8F.$z{?՟@!2RUωt8ΐeIi. r3юMMD 6>~dciܫWa pR*%mf6gۉ4Kǘsω T*E1 %XD,c(e2b;aK {ϞQYZ"c57}`wi,DA$}9 r {Zb1_bׯyN<4Df36hc_B(N?c7n>;Kc<:yu(L<{z̽{t9»F\J)NXh?+i,)1ZY!RlܺDyML`yCB 9v oa۷>Cñ9I$=B/>:ҝ;BJ!`ym''tj\[EMMQa6eelVBl6T.Ykb&sA 9{437zivyBa\M-._]B|0Ɣ҈6D,XUIENDB`chordata-1.0.0/src/images/piano.svg0000644014157701161570000002023211161211045021326 0ustar david.garciaLNX_david.garcia image/svg+xml Piano Mini piano keyboard Hernan Ordiales 2009-03-11 C chordata-1.0.0/src/images/mix_microphone.png0000644014157701161570000000660211134425075023244 0ustar david.garciaLNX_david.garciaPNG  IHDRĴl; pHYs )I MiCCPPhotoshop ICC profilexڝSwX>eVBl"#Ya@Ņ VHUĂ H(gAZU\8ܧ}zy&j9R<:OHɽH gyx~t?op.$P&W " R.TSd ly|B" I>ةآ(G$@`UR,@".Y2GvX@`B, 8C L0ҿ_pH˕͗K3w!lBa)f "#HL 8?flŢko">!N_puk[Vh]3 Z zy8@P< %b0>3o~@zq@qanvRB1n#Dž)4\,XP"MyRD!ɕ2 w ONl~Xv@~- g42y@+͗\LD*A aD@ $<B AT:18 \p` Aa!:b""aH4 Q"rBj]H#-r9\@ 2G1Qu@Ơst4]k=Kut}c1fa\E`X&cX5V5cX7va$^lGXLXC%#W 1'"O%zxb:XF&!!%^'_H$ɒN !%2I IkHH-S>iL&m O:ňL $RJ5e?2BQͩ:ZImvP/S4u%͛Cˤ-Кigih/t ݃EЗkw Hb(k{/LӗT02goUX**|:V~TUsU?y TU^V}FUP թU6RwRPQ__c FHTc!2eXBrV,kMb[Lvv/{LSCsfffqƱ9ٜJ! {--?-jf~7zھbrup@,:m:u 6Qu>cy Gm7046l18c̐ckihhI'&g5x>fob4ekVyVV׬I\,mWlPW :˶vm))Sn1 9a%m;t;|rtuvlp4éĩWggs5KvSmnz˕ҵܭm=}M.]=AXq㝧/^v^Y^O&0m[{`:>=e>>z"=#~~~;yN`k5/ >B Yroc3g,Z0&L~oL̶Gli})*2.QStqt,֬Yg񏩌;jrvgjlRlc웸xEt$ =sl3Ttcܢ˞w|/%ҟ3gAMA|Q cHRMz%u0`:o_FIDATxڬ1K#AYCUw*6"B.pVZ;xw K2h DĀQl6YU) g`ǏLsAOlll䞟 {{{ ۶۶dҭUnooAKb|u]0:c7333SSSawŧx@$A$AZE>$I}Ȳ%<>>`4uP  ^cpp$ `$LQ\ddY(sh4 ~4BY:c bhh`f,.&IՊ !iYEQKض J)4MC c R_l_\\0 J)FFFE image/svg+xml chordata-1.0.0/src/images/chordranking.svg0000644014157701161570000001214611047354703022712 0ustar david.garciaLNX_david.garcia image/svg+xml chordata-1.0.0/src/images/player_pause.png0000644014157701161570000000224711044656020022712 0ustar david.garciaLNX_david.garciaPNG  IHDRĴl;bKGD pHYs ?@"tIME %&KX94IDATxڝoE?3q P)TE !U(T T -= !q\zSDU"uPTi8kڻ;mIA<ћ}fOҙftc`c^{Z1#1]`F||uu_33 >Rerrd0&)saY]Yȿ_4n#tfs8#Ϧxh { KB ֌[ PTY{7 pk[_dr:/>x5scFfC lPQܮ!//Xyr"u\. p8wOoN(%FNM]M't"1}lZ?ŃAר}\811ZlVKdI!%tCOŀŀ€\4[00GյYX GW3#ܸmNO+9KJ4Z.lWw`!D^˜0p$dגumTx~&Y?b Y juXoKmtzWdo¶AX,hid/B[)wQo!@&RB7M ̶@muc 0^nhɍfn]Ͽ70Q%nbm0qU֒Tګ3tZYgULҎqѭifYW]qP{h囌囏 ^Z+/_V`jjʺjM}f><<-zf]UѰu"CJ|0oeLNZD:!H(ӓuL:|AOx\^= 47.%Ut÷yh4V dm%ql\oz8v(˿rl&'J#m#'iG/ecK`LLmmB`<{n 255% I:$(dSV ǁu&/? ,뻾 ph"Sh)Lԑ7w:|u?$B`IENDB`chordata-1.0.0/src/images/keyspace.svg0000644014157701161570000004472011047354703022050 0ustar david.garciaLNX_david.garcia image/svg+xml a A E e C F F chordata-1.0.0/src/images/spectrogram.svg0000644014157701161570000002635011056611422022563 0ustar david.garciaLNX_david.garcia image/svg+xml chordata-1.0.0/src/images/polarchromapeaks.svg0000644014157701161570000003610111047354703023571 0ustar david.garciaLNX_david.garcia image/svg+xml chordata-1.0.0/src/images/player_stop.png0000644014157701161570000000214211044656020022554 0ustar david.garciaLNX_david.garciaPNG  IHDRĴl;bKGD pHYs mtIME  yAIDATxڝۏSE?3ҞnO^,٘B$ QLi ONB|AL4&BE,ݬ-K9gƇ˂o.7CT80m^ *)ЀЪl)rAkCہ="#TBEG )Lo>7=ʮȵIF8V̥Z+ܜ5@E)Kd>r agvn}m.ЬZ?U ͈c?]%TgcpL?Mg2}xEs %R01ټb=wU(Jz ۶ ֮mIz㞢*Fk! 7e?oÝ3uX,H~婡#v*`%z90|kSѝyo3_7 '-ޓHf lbh4ЏThwb,[wWџM`55Y%%y}c?H$-q_&C+z绲 q ayH!)+RH)V4{!@&pNc1\Gktx94An{ЊKH5ĝQD2pVcdtAZei)Lӭ)˼R%ی2\7@qN˭tG*!!RQi:ɓ_}ԙhf}n S'}S4iPwcO@(J;!(oxl aͻۤ}'\j19;3 VѨrMlKb_ oܠ //#include "Project.hxx" #include #include "FrameDivision.hxx" #include "FloatVectorStorage.hxx" namespace CLAM_Annotator { class FrameDivision; } namespace CLAM { namespace VM { class PoolFloatArrayDataSource : public FloatArrayDataSource { public: PoolFloatArrayDataSource(); void setDataSource(unsigned nBins, CLAM::TData binGap, CLAM::TData firstBinOffset, std::vector binLabels); void clearData(); void setStorage(FloatVectorStorage *storage, CLAM::TData samplingRate, CLAM_Annotator::FrameDivision *frameDivision, unsigned nFrames); bool setCurrentTime(double timeMiliseconds); std::string getLabel(unsigned bin) const { if (bin < _binLabels.size()) return _binLabels[bin]; if (!_binGap) return "ERR"; std::ostringstream oss; oss << _firstBinOffset + bin * _binGap; return oss.str(); } const TData * getData() const { if (!_storage) return 0; return &_storage->Data()[0]; } const CLAM::TData * frameData() { return _frameData; } unsigned nFrames() const { return _nFrames; } unsigned nBins() const { return _nBins; } private: std::string _scope; std::string _name; std::string _parentScope; std::string _parentName; std::vector _binLabels; unsigned _nFrames; const CLAM_Annotator::FrameDivision * _frameDivision; CLAM::TData _samplingRate; const CLAM::TData *_frameData; unsigned _nBins; CLAM::TData _binGap; CLAM::TData _firstBinOffset; unsigned _currentFrame; FloatVectorStorage *_storage; }; } } #endif chordata-1.0.0/src/FloatPairVectorStorage.hxx0000644014157701161570000000242311052341522023361 0ustar david.garciaLNX_david.garcia#ifndef __FloatPairVectorStorage_hxx__ #define __FloatPairVectorStorage_hxx__ #include #include #include class FloatPairVectorStorageConfig : public CLAM::ProcessingConfig { public: DYNAMIC_TYPE_USING_INTERFACE (FloatPairVectorStorageConfig, 1, ProcessingConfig); DYN_ATTRIBUTE (0, public, unsigned long, Frames); protected: void DefaultInit(void); }; class FloatPairVectorStorage : public CLAM::Processing { typedef std::vector FloatVector; typedef std::vector > FloatPairVector; typedef std::list Storage; typedef FloatPairVectorStorageConfig Config; public: FloatPairVectorStorage(const Config& cfg = Config()); virtual const char* GetClassName() const; virtual bool Do(); virtual ~FloatPairVectorStorage(); Storage& PositionStorage(); Storage& MagnitudeStorage(); protected: // methods virtual bool ConcreteConfigure(const CLAM::ProcessingConfig& cfgObject); virtual bool ConcreteStart(); protected: // attributes Config _config; CLAM::InPort _in; Storage _positionStorage; Storage _magnitudeStorage; }; #endif //__FloatPairVectorStorage_hxx__ chordata-1.0.0/src/FrameDivision.hxx0000644014157701161570000000274111120455173021536 0ustar david.garciaLNX_david.garcia/* * Copyright (c) 2001-2006 MUSIC TECHNOLOGY GROUP (MTG) * UNIVERSITAT POMPEU FABRA * * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ #ifndef FrameDivision_hxx #define FrameDivision_hxx #include namespace CLAM_Annotator { class FrameDivision : public CLAM::DynamicType { DYNAMIC_TYPE(FrameDivision,2); DYN_ATTRIBUTE(0, public, CLAM::TData, FirstCenter); DYN_ATTRIBUTE(1, public, CLAM::TData, InterCenterGap); void DefaultInit() { AddAll(); UpdateData(); } public: CLAM::TData GetCenter(unsigned element) const { return GetFirstCenter() + element* GetInterCenterGap(); } unsigned GetItem(CLAM::TData position) const { if (position < GetFirstCenter()) return 0; return (position-GetFirstCenter())/GetInterCenterGap(); } }; } #endif//FrameDivision_hxx chordata-1.0.0/src/PoolFloatArrayDataSource.cxx0000644014157701161570000000456311052525522023647 0ustar david.garciaLNX_david.garcia/* * Copyright (c) 2001-2006 MUSIC TECHNOLOGY GROUP (MTG) * UNIVERSITAT POMPEU FABRA * * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ #include #include #include #include "PoolFloatArrayDataSource.hxx" CLAM::VM::PoolFloatArrayDataSource::PoolFloatArrayDataSource() : _nFrames(0) , _frameDivision(0) , _samplingRate(44100) , _frameData(0) , _nBins(0) , _binGap(0) , _firstBinOffset(0) , _currentFrame(0) { } void CLAM::VM::PoolFloatArrayDataSource::clearData() { _nFrames=0; _frameDivision=0; _frameData=0; _currentFrame=0; _nBins = 0; _firstBinOffset = 0; _binGap = 0; _storage = 0; } void CLAM::VM::PoolFloatArrayDataSource::setDataSource(unsigned nBins, CLAM::TData binGap, CLAM::TData firstBinOffset, std::vector binLabels) { _nBins = nBins; _binGap = binGap; _firstBinOffset = firstBinOffset; _binLabels.assign(binLabels.begin(), binLabels.end()); } void CLAM::VM::PoolFloatArrayDataSource::setStorage(FloatVectorStorage *storage, CLAM::TData samplingRate, CLAM_Annotator::FrameDivision *frameDivision, unsigned nFrames) { _storage = storage; _frameData = &_storage->Data()[0]; _samplingRate = samplingRate; _nFrames = nFrames; _frameDivision = frameDivision; } bool CLAM::VM::PoolFloatArrayDataSource::setCurrentTime(double timeMiliseconds) { unsigned newFrame = _frameDivision ? _frameDivision->GetItem(timeMiliseconds*_samplingRate): 0; if (_nFrames==0) newFrame = 0; else if (newFrame>=_nFrames) newFrame=_nFrames-1; _frameData = getData() ? getData() + (_nBins + unsigned(_binGap)) * newFrame + unsigned(_firstBinOffset) : 0; if (newFrame == _currentFrame) return false; _currentFrame = newFrame; return true; } chordata-1.0.0/src/FloatPairVectorStorage.cxx0000644014157701161570000000271111052341522023354 0ustar david.garciaLNX_david.garcia#include "FloatPairVectorStorage.hxx" #include // debug void FloatPairVectorStorageConfig::DefaultInit(void) { AddAll(); UpdateData(); SetFrames(0); } FloatPairVectorStorage::FloatPairVectorStorage(const Config& cfg) : _in("Data Input", this) { Configure(cfg); } FloatPairVectorStorage::~FloatPairVectorStorage() { } // TODO: move it to the header const char* FloatPairVectorStorage::GetClassName() const { return "FloatPairVectorStorage"; } bool FloatPairVectorStorage::ConcreteConfigure(const CLAM::ProcessingConfig& cfgObject) { CopyAsConcreteConfig(_config, cfgObject); return true; } bool FloatPairVectorStorage::ConcreteStart() { _positionStorage.clear(); _magnitudeStorage.clear(); return true; } bool FloatPairVectorStorage::Do() { const FloatPairVector & input = _in.GetData(); _positionStorage.push_back(std::vector ()); _magnitudeStorage.push_back(std::vector ()); std::vector & positions = _positionStorage.back(); std::vector & magnitudes = _magnitudeStorage.back(); for (FloatPairVector::const_iterator i = input.begin(); i != input.end(); i++) { positions.push_back(i->first); magnitudes.push_back(i->second); } _in.Consume(); return true; } std::list >& FloatPairVectorStorage::PositionStorage() { return _positionStorage; } std::list >& FloatPairVectorStorage::MagnitudeStorage() { return _magnitudeStorage; } chordata-1.0.0/src/About.ui0000644014157701161570000003111111137125210017642 0ustar david.garciaLNX_david.garcia About 0 0 517 399 About true 6 9 9 9 9 6 0 0 0 0 0 0 true 0 0 <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } </style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;"> <p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">Chordata v%1</span> </p> <p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Based on CLAM v%2</p></body></html> 0 0 0 0 0 About 6 9 9 9 9 0 0 Chordata is a tool for tonal analysis of audio files. It can analyse a song and show the chords played. Qt::AlignTop true 6 0 0 0 0 Qt::Horizontal 40 20 QFrame::StyledPanel QFrame::Sunken Authors 6 9 9 9 9 0 0 <p>The CLAM Team &lt;clam@iua.upf.edu&gt;:</p> <ul> <li>Xavier Amatriain &lt;xavier@create.ucsb.edu&gt;</li> <li>David Garcia &lt;dgarcia@iua.upf.edu&gt; </li> <li>Pau Arumí &lt;parumi@iua.upf.edu&gt;</li> </ul> <p>Past developers:</p> <ul> <li>Xavier Rubio &lt;xrubio@iua.upf.edu&gt; </li> <li>Ismael Mosquera &lt;imosquera@iua.upf.edu&gt;</li> </ul> <p>Contributors:</p> <ul> <li>Christopher Harte &lt;harte@elec.qmul.ac.uk&gt; ("Tonnetz" view, Chord extraction algorithm)</li> <li>Emilia Gómez &lt;egomez@iua.upf.edu&gt; ("Key Space" view)</li> <li>Jordi Bonada &lt;jbonada@iua.upf.edu&gt; ("Key Space" view)</li> </ul> Qt::AlignTop Acknoledgements 6 9 9 9 9 0 0 <p>This software is partially founded by:</p> <ul> <li>Google - Chordata was originally a Google Summer of Code project</li> </ul> Qt::AlignTop 6 0 0 0 0 Qt::Horizontal 40 20 Qt::AlignHCenter|Qt::AlignTop License 6 0 0 0 0 <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } </style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;"> <p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.</p> <p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.</p> <p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc.,</p> <p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">59 Temple Place - Suite 330, Boston, MA 02111-1307, USAa </p></body></html> chordata-1.0.0/src/PoolPeakDataSource.hxx0000644014157701161570000000436411327157564022503 0ustar david.garciaLNX_david.garcia /* * Copyright (c) 2001-2006 MUSIC TECHNOLOGY GROUP (MTG) * UNIVERSITAT POMPEU FABRA * * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ #ifndef PoolPeakDataSource_hxx #define PoolPeakDataSource_hxx #include #include #include #include "FrameDivision.hxx" #include "FloatPairVectorStorage.hxx" namespace CLAM_Annotator { class FrameDivision; } namespace CLAM { namespace VM { class PoolPeakDataSource : public PeakDataSource { typedef std::vector Buffer; typedef std::list Storage; typedef std::vector > Index; public: PoolPeakDataSource(); void setDataSource(unsigned nBins); void clearData(); void setStorage(FloatPairVectorStorage *storage, CLAM::TData samplingRate, CLAM_Annotator::FrameDivision * frameDivision); bool setCurrentTime(double timeMiliseconds); const TData * positionData() { return _positionFrameData; } const TData * magnitudeData() { return _magnitudeFrameData; } unsigned nFrames() const { return _nFrames; } unsigned nBins() const { return _nBins; } bool isEnabled() const { return true; // ? } private: std::vector _binLabels; unsigned _nFrames; const CLAM_Annotator::FrameDivision * _frameDivision; CLAM::TData _samplingRate; const CLAM::TData *_positionFrameData; const CLAM::TData *_magnitudeFrameData; unsigned _nBins; unsigned _currentFrame; Index _frameDataIndex; FloatPairVectorStorage *_storage; }; } } #endif chordata-1.0.0/src/MainWindow.hxx0000644014157701161570000000565011327157564021071 0ustar david.garciaLNX_david.garcia/* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef TURNAROUND_HXX #define TURNAROUND_HXX #include "ui_MainWindow.hxx" #include #include #include #include "PoolFloatArrayDataSource.hxx" #include "PoolPeakDataSource.hxx" #include "PoolSegmentationDataSource.hxx" #include #include "FrameDivision.hxx" namespace CLAM { class NetworkPlayer; class TonalAnalysis; class MIDIPianoWidget; namespace VM { class Spectrogram; class Tonnetz; class KeySpace; class ChordRanking; } } class PolarChromaPeaks; class SegmentationView; class MainWindow : public QMainWindow { Q_OBJECT public: MainWindow(); virtual ~MainWindow(); void setBackend(QString &backend); public slots: void fileOpen(); void recentFileOpen(); void play(); void pause(); void stop(); void about(); void onlineTutorial(); protected: void timerEvent(QTimerEvent *event); private: std::vector initBinLabelVector() const; void loadAudioFile(const std::string & fileName); void updateRecentMenu(); void appendRecentFile(const QString & recentFile); CLAM::Network _network; CLAM::NetworkPlayer *_networkPlayer; CLAM::MonoAudioFileReaderConfig _fileReaderConfig; std::string _fileReader; std::string _progressControl; std::string _controlPiano; CLAM::TonalAnalysis *_tonalAnalysis; ProgressControlWidget *_progressControlWidget; CLAM::VM::Spectrogram *_spectrogram; CLAM::VM::Tonnetz *_tonnetz; CLAM::VM::KeySpace *_keySpace; CLAM::VM::ChordRanking *_chordRanking; PolarChromaPeaks *_polarChromaPeaks; SegmentationView *_segmentationView; CLAM::MIDIPianoWidget *_pianoView; FloatVectorStorage *_pcpStorage; FloatVectorStorage *_chordCorrelationStorage; FloatPairVectorStorage *_chromaPeaksStorage; CLAM::VM::PoolFloatArrayDataSource _pcpSource; CLAM::VM::PoolFloatArrayDataSource _keySpaceSource; CLAM::VM::PoolFloatArrayDataSource _chordCorrelationSource; CLAM::VM::PoolPeakDataSource _chromaPeaksSource; CLAM::VM::PoolSegmentationDataSource _segmentationSource; CLAM_Annotator::FrameDivision _frameDivision; CLAM::TData _length; CLAM::TControlData _pausedProgress; QStringList _recentFiles; int _timerID; QDialog *_aboutDialog; Ui::MainWindow _ui; }; #endif chordata-1.0.0/src/FloatVectorStorage.cxx0000644014157701161570000000222611052335303022541 0ustar david.garciaLNX_david.garcia#include "FloatVectorStorage.hxx" #include // debug void FloatVectorStorageConfig::DefaultInit(void) { AddAll(); UpdateData(); SetBins(12); SetFrames(0); } FloatVectorStorage::FloatVectorStorage(const Config& cfg) : _in("Data Input", this) { Configure(cfg); } FloatVectorStorage::~FloatVectorStorage() { } // TODO: move it to the header const char* FloatVectorStorage::GetClassName() const { return "FloatVectorStorage"; } bool FloatVectorStorage::ConcreteConfigure(const CLAM::ProcessingConfig& cfgObject) { CopyAsConcreteConfig(_config, cfgObject); return true; } bool FloatVectorStorage::ConcreteStart() { _data.clear(); _data.reserve(_config.GetBins() * _config.GetFrames()); std::cout << "reserve " << _config.GetBins() << " bins, " << _config.GetFrames() << " frames, " << _data.capacity() << " capacity, " << _data.size() << " size " << std::endl; return true; } bool FloatVectorStorage::Do() { const std::vector & input = _in.GetData(); _data.insert(_data.end(), input.begin(), input.begin()+_config.GetBins()); _in.Consume(); return true; } std::vector& FloatVectorStorage::Data() { return _data; } chordata-1.0.0/src/MainWindow.cxx0000644014157701161570000004221311327452146021052 0ustar david.garciaLNX_david.garcia/* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "MainWindow.hxx" #include "ChordataVersion.hxx" #include "ui_About.hxx" #include #include #include #include #include #include #include #include #include #include #include #include #ifdef USE_JACK #include #endif #ifdef USE_PORTAUDIO #include #endif #include #include #include #include #include #include #include #include #include "FloatVectorStorage.hxx" #include "FloatPairVectorStorage.hxx" #include #include #include MainWindow::MainWindow() : QMainWindow(0) , _networkPlayer(0) , _tonalAnalysis(0) , _pcpStorage(0) , _timerID(0) { _ui.setupUi(this); connect(_ui.fileOpenAction, SIGNAL(triggered()), this, SLOT(fileOpen())); connect(_ui.fileExitAction, SIGNAL(triggered()), this, SLOT(close())); connect(_ui.playbackPlayAction, SIGNAL(triggered()), this, SLOT(play())); connect(_ui.playbackPauseAction, SIGNAL(triggered()), this, SLOT(pause())); connect(_ui.playbackStopAction, SIGNAL(triggered()), this, SLOT(stop())); connect(_ui.helpAboutAction, SIGNAL(triggered()), this, SLOT(about())); connect(_ui.helpOnlineTutorialAction, SIGNAL(triggered()), this, SLOT(onlineTutorial())); QVBoxLayout * vboxLayout = new QVBoxLayout(_ui.centralwidget); _progressControlWidget = new ProgressControlWidget(0,_ui.centralwidget); vboxLayout->addWidget(_progressControlWidget); _fileReader = _network.AddProcessing("MonoAudioFileReader"); CLAM::ProgressControl * progress = new CLAM::ProgressControl; _progressControl = _network.GetUnusedName("ProgressControl"); _network.AddProcessing(_progressControl, progress); _network.ConnectControls(_fileReader+".Progress", _progressControl+".Progress Update"); _network.ConnectControls(_progressControl+".Progress Jump", _fileReader+".Seek"); _progressControlWidget->SetProcessing(progress); std::string audioSink = _network.AddProcessing("AudioSink"); _network.ConnectPorts(_fileReader+".Samples Read", audioSink+".1"); _spectrogram = new CLAM::VM::Spectrogram(_ui.centralwidget); vboxLayout->addWidget(_spectrogram); _tonnetz = new CLAM::VM::Tonnetz(_ui.centralwidget); vboxLayout->addWidget(_tonnetz); _keySpace = new CLAM::VM::KeySpace(_ui.centralwidget); vboxLayout->addWidget(_keySpace); QHBoxLayout * hboxLayout = new QHBoxLayout; vboxLayout->addLayout(hboxLayout); _polarChromaPeaks = new PolarChromaPeaks(_ui.centralwidget); hboxLayout->addWidget(_polarChromaPeaks); _chordRanking = new CLAM::VM::ChordRanking(_ui.centralwidget); hboxLayout->addWidget(_chordRanking); _segmentationView = new SegmentationView(_ui.centralwidget); _segmentationView->beCentred(true); vboxLayout->addWidget(_segmentationView); CLAM::ControlPiano * control = new CLAM::ControlPiano; _controlPiano = _network.GetUnusedName("ControlPiano"); _network.AddProcessing(_controlPiano, control); _pianoView = new CLAM::MIDIPianoWidget(control, _ui.centralwidget); _pianoView->setClickEnabled(false); vboxLayout->addWidget(_pianoView); _tonalAnalysis = new CLAM::TonalAnalysis; _aboutDialog = new QDialog(this); Ui::About aboutUi; aboutUi.setupUi(_aboutDialog); aboutUi.versionInfo->setText(tr( "

Chordata version %1

" "

Using CLAM version %2

") .arg(Chordata::GetFullVersion()) .arg(CLAM::GetFullVersion())); connect(_ui.viewSpectrogramAction, SIGNAL(toggled(bool)), _spectrogram, SLOT(setVisible(bool))); connect(_ui.viewTonnetzAction, SIGNAL(toggled(bool)), _tonnetz, SLOT(setVisible(bool))); connect(_ui.viewKeySpaceAction, SIGNAL(toggled(bool)), _keySpace, SLOT(setVisible(bool))); connect(_ui.viewChromaPeaksAction, SIGNAL(toggled(bool)), _polarChromaPeaks, SLOT(setVisible(bool))); connect(_ui.viewChordRankingAction, SIGNAL(toggled(bool)), _chordRanking, SLOT(setVisible(bool))); connect(_ui.viewSegmentationAction, SIGNAL(toggled(bool)), _segmentationView, SLOT(setVisible(bool))); connect(_ui.viewPianoAction, SIGNAL(toggled(bool)), _pianoView, SLOT(setVisible(bool))); QSettings settings; _recentFiles = settings.value("RecentFiles").toStringList(); updateRecentMenu(); _ui.viewSpectrogramAction->setChecked(settings.value("SpectrogramVisible", true).toBool()); _ui.viewTonnetzAction->setChecked(settings.value("TonnetzVisible", true).toBool()); _ui.viewKeySpaceAction->setChecked(settings.value("KeySpaceVisible", true).toBool()); _ui.viewChromaPeaksAction->setChecked(settings.value("ChromaPeaksVisible", true).toBool()); _ui.viewChordRankingAction->setChecked(settings.value("ChordRankingVisible", true).toBool()); _ui.viewSegmentationAction->setChecked(settings.value("SegmentationVisible", true).toBool()); _ui.viewPianoAction->setChecked(settings.value("PianoVisible", true).toBool()); //Below lines are a workaround since setChecked should raise the toggled signal and since is connected, call setVisible() but seems there is no call, with the consequent bug at startup _spectrogram->setVisible(settings.value("SpectrogramVisible", true).toBool()); _tonnetz->setVisible(settings.value("TonnetzVisible", true).toBool()); _keySpace->setVisible(settings.value("KeySpaceVisible", true).toBool()); _polarChromaPeaks->setVisible(settings.value("ChromaPeaksVisible", true).toBool()); _chordRanking->setVisible(settings.value("ChordRankingVisible", true).toBool()); _segmentationView->setVisible(settings.value("SegmentationVisible", true).toBool()); _pianoView->setVisible(settings.value("PianoVisible", true).toBool()); } MainWindow::~MainWindow() { QSettings settings; settings.setValue("RecentFiles", _recentFiles); settings.setValue("SpectrogramVisible", _ui.viewSpectrogramAction->isChecked()); settings.setValue("TonnetzVisible", _ui.viewTonnetzAction->isChecked()); settings.setValue("KeySpaceVisible", _ui.viewKeySpaceAction->isChecked()); settings.setValue("ChromaPeaksVisible", _ui.viewChromaPeaksAction->isChecked()); settings.setValue("ChordRankingVisible", _ui.viewChordRankingAction->isChecked()); settings.setValue("SegmentationVisible", _ui.viewSegmentationAction->isChecked()); settings.setValue("PianoVisible", _ui.viewPianoAction->isChecked()); stop(); delete _tonalAnalysis; if (_pcpStorage) { delete _pcpStorage; delete _chordCorrelationStorage; delete _chromaPeaksStorage; } } void MainWindow::updateRecentMenu() { _ui.menuOpenRecent->clear(); if (_recentFiles.size() == 0) { _ui.menuOpenRecent->setEnabled(false); return; } _ui.menuOpenRecent->setEnabled(true); int i=0; for (QStringList::iterator it = _recentFiles.begin(); it!=_recentFiles.end(); it++) { QString text = QString("&%1 %2").arg(++i).arg(*it); QAction * recentFileAction = new QAction(text, this); recentFileAction->setData(*it); _ui.menuOpenRecent->addAction(recentFileAction); connect(recentFileAction, SIGNAL(triggered()), this, SLOT(recentFileOpen())); } } void MainWindow::appendRecentFile(const QString & recentFile) { _recentFiles.removeAll(recentFile); _recentFiles.push_front(recentFile); while (_recentFiles.size() > 8) _recentFiles.pop_back(); QSettings settings; settings.setValue("RecentFiles", _recentFiles); updateRecentMenu(); } void MainWindow::fileOpen() { QString qFileName = QFileDialog::getOpenFileName(this, tr("Choose an audio file"), QString::null, tr("Audio files (*.wav *.ogg *.mp3)")); if(qFileName == QString::null) return; appendRecentFile(qFileName); loadAudioFile(qFileName.toLocal8Bit().constData()); } void MainWindow::recentFileOpen() { QAction *action = qobject_cast(sender()); if (!action) return; QString file = action->data().toString(); if (file == QString::null) return; appendRecentFile(file); loadAudioFile(file.toLocal8Bit().constData()); } std::vector MainWindow::initBinLabelVector() const { static const char * roots[] = { "G", "G#", "A", "A#", "B", "C", "C#", "D", "D#", "E", "F", "F#", }; static struct Modes { const char * name; unsigned nRoots; } modes[] = { {"None", 1}, {"Major", 12}, {"Minor", 12}, {"Major7", 12}, // Cmaj7 {"Dominant7", 12}, // C7 {"MinorMajor7", 12}, // Cm/maj7 {"Minor7", 12}, // Cm7 // {"Suspended2", 12}, // Csus2 // {"Suspended4", 12}, // Csus4 // {"Major6", 12}, // C6 // {"Minor6", 12}, // Cm6 // {"6/9", 12}, // C6/9 {"Augmented", 4}, // Caug {"Diminished", 12}, // Cdim {"Diminished7", 12}, // Cdim7 // {"Fifth", 12}, // C5 {0, 0} }; std::vector chordNames; for (unsigned i = 0; modes[i].name; i++) { std::string mode=modes[i].name; if (modes[i].nRoots == 1) { chordNames.push_back(mode); continue; } for (unsigned root=0; rootnoDataSource(); _tonnetz->noDataSource(); _keySpace->noDataSource(); _chordRanking->noDataSource(); _segmentationView->noDataSource(); _pianoView->noDataSource(); // Point the data sources to no storage and delete old storages _pcpSource.clearData(); _keySpaceSource.clearData(); _chordCorrelationSource.clearData(); _chromaPeaksSource.clearData(); if (_pcpStorage) { delete _pcpStorage; delete _chordCorrelationStorage; delete _chromaPeaksStorage; } QProgressDialog progress(tr("Analyzing chords..."), tr("Abort"), 0, 2, this); progress.setWindowModality(Qt::WindowModal); progress.setValue(1); QApplication::processEvents(); _fileReaderConfig.SetSourceFile(fileName); if (!_network.ConfigureProcessing(_fileReader, _fileReaderConfig)) { progress.close(); QMessageBox::critical(this, tr("Loading error"), tr("Error loading the media\n%1") .arg(_network.GetProcessing(_fileReader).GetConfigErrorMessage().c_str()) ); return; } // Begin analysis CLAM::MonoAudioFileReader fileReader(_fileReaderConfig); CLAM::AudioInPort &analysisInput = (CLAM::AudioInPort&)(_tonalAnalysis->GetInPort("Audio Input")); std::string title = "Chordata: "; const CLAM::AudioTextDescriptors &textDescriptors = fileReader.GetTextDescriptors(); title += textDescriptors.HasArtist() ? textDescriptors.GetArtist() : "Unknown Artist"; title += " - "; title += textDescriptors.HasTitle() ? textDescriptors.GetTitle() : "Unknown Title"; setWindowTitle(title.c_str()); const unsigned hop = analysisInput.GetHop(); const unsigned frameSize = analysisInput.GetSize(); const unsigned nSamples = fileReader.GetHeader().GetSamples(); const unsigned long nFrames = (unsigned long)(floor((float)(nSamples-frameSize+hop)/(float)hop)); const CLAM::TData sampleRate = fileReader.GetHeader().GetSampleRate(); _length = CLAM::TData(nSamples) / sampleRate; const unsigned nBins = 12; const unsigned maxBins = 101; std::cout << "Number of frames: " << nFrames << std::endl; progress.setMaximum(nFrames); FloatVectorStorageConfig storageConfig; storageConfig.SetBins(nBins); storageConfig.SetFrames(nFrames); _pcpStorage = new FloatVectorStorage(storageConfig); storageConfig.SetBins(maxBins); storageConfig.SetFrames(nFrames); _chordCorrelationStorage = new FloatVectorStorage(storageConfig); FloatPairVectorStorageConfig pairStorageConfig; pairStorageConfig.SetFrames(nFrames); _chromaPeaksStorage = new FloatPairVectorStorage(pairStorageConfig); CLAM::ConnectPorts(fileReader, "Samples Read", *_tonalAnalysis, "Audio Input"); CLAM::ConnectPorts(*_tonalAnalysis, "Pitch Profile", *_pcpStorage, "Data Input"); CLAM::ConnectPorts(*_tonalAnalysis, "Chord Correlation", *_chordCorrelationStorage, "Data Input"); CLAM::ConnectPorts(*_tonalAnalysis, "Chroma Peaks", *_chromaPeaksStorage, "Data Input"); fileReader.Start(); _tonalAnalysis->Start(); _pcpStorage->Start(); _chordCorrelationStorage->Start(); _chromaPeaksStorage->Start(); unsigned long i = 0; while (fileReader.Do()) { if (! analysisInput.CanConsume()) continue; progress.setValue(i++); _tonalAnalysis->Do(); _pcpStorage->Do(); _chordCorrelationStorage->Do(); _chromaPeaksStorage->Do(); } fileReader.Stop(); _tonalAnalysis->Stop(); _pcpStorage->Stop(); _chordCorrelationStorage->Stop(); _chromaPeaksStorage->Stop(); _frameDivision.SetFirstCenter(frameSize / 2); _frameDivision.SetInterCenterGap(hop); const char * notes[] = { "G", "G#", "A", "A#", "B", "C", "C#", "D", "D#", "E", "F", "F#" }; std::vector binLabels(notes, notes+nBins); _pcpSource.setDataSource(nBins, 0, 0, binLabels); _pcpSource.setStorage(_pcpStorage, sampleRate, &_frameDivision, nFrames); _spectrogram->setDataSource(_pcpSource); _tonnetz->setDataSource(_pcpSource); _pianoView->setDataSource(_pcpSource); const char * minorChords[] = { "g", "g#", "a", "a#", "b", "c", "c#", "d", "d#", "e", "f", "f#" }; binLabels.insert(binLabels.end(), minorChords, minorChords+nBins); _keySpaceSource.setDataSource(nBins*2, maxBins - nBins*2, 1, binLabels); _keySpaceSource.setStorage(_chordCorrelationStorage, sampleRate, &_frameDivision, nFrames); _keySpace->setDataSource(_keySpaceSource); _chordCorrelationSource.setDataSource(maxBins, 0, 0, initBinLabelVector()); _chordCorrelationSource.setStorage(_chordCorrelationStorage, sampleRate, &_frameDivision, nFrames); _chordRanking->setDataSource(_chordCorrelationSource); _chromaPeaksSource.setDataSource(1); _chromaPeaksSource.setStorage(_chromaPeaksStorage, sampleRate, &_frameDivision); _polarChromaPeaks->setDataSource(_chromaPeaksSource); CLAM::OutPort &segmentationOutput = (CLAM::OutPort&)(_tonalAnalysis->GetOutPort("Chord Segmentation")); _segmentationSource.updateData(segmentationOutput.GetData()); _segmentationView->setDataSource(_segmentationSource); // End analysis play(); } void MainWindow::play() { if (_network.HasMisconfiguredProcessings()) { QMessageBox::critical(this, tr("Unable to play"), _network.GetConfigurationErrors().c_str() ); return; } if (_network.HasUnconnectedInPorts() ) { QMessageBox::critical(this, tr("Unable to play the network"), tr( "

Some inports in the network are not connected.

" "

To play the network you should connect the following inports.

" "
%1 0)
	{
		killTimer(_timerID);
		_timerID = 0;
	}
}

void MainWindow::timerEvent(QTimerEvent *event)
{
	if (not _timerID) 
	{
		std::cout << "Warning: serving timer events after stoping." << std::endl;
		return;
	}
	CLAM::FloatInControl & inControl =
		(CLAM::FloatInControl&) _network.GetInControlByCompleteName(_progressControl+".Progress Update");
	double time = inControl.GetLastValue() * _length;
	_pcpSource.setCurrentTime(time);
	_keySpaceSource.setCurrentTime(time);
	_chordCorrelationSource.setCurrentTime(time);
	_chromaPeaksSource.setCurrentTime(time);
	_segmentationSource.setCurrentTime(time);
}

void MainWindow::about()
{
	_aboutDialog->show();
}

void MainWindow::onlineTutorial()
{
	QString helpUrl = "http://clam-project.org/wiki/Chordata_tutorial";
	QDesktopServices::openUrl(helpUrl);
}

void MainWindow::setBackend(QString &backend)
{
	if (_networkPlayer) delete _networkPlayer;
	_networkPlayer = 0;

	#ifdef USE_JACK
	if (backend=="JACK" || backend=="Auto")
	{
		CLAM::JACKNetworkPlayer *jackPlayer = new CLAM::JACKNetworkPlayer();
		if ( jackPlayer->IsWorking() )
		{
			backend = "JACK";
			_networkPlayer = jackPlayer;
		}
		else
			delete jackPlayer;
	}
	#endif

	#ifdef USE_PORTAUDIO
	if (backend=="PortAudio" || backend=="Auto")
	{
		if (! _networkPlayer)
		{
			backend = "PortAudio";
			_networkPlayer = new CLAM::PANetworkPlayer();
		}
	}
	#endif

	CLAM_ASSERT(_networkPlayer!=0, "Problem setting the backend.");
	if (_networkPlayer==0) backend = "None";
	_network.SetPlayer( _networkPlayer );
	std::cout << "Audio backend: " << backend.toStdString() << std::endl;
}
chordata-1.0.0/src/MainWindow.ui0000644014157701161570000002230511161212171020651 0ustar  david.garciaLNX_david.garcia
 MainWindow
 
  
   
    0
    0
    640
    480
   
  
  
   
    0
    0
   
  
  
   Chordata
  
  
   
    :/icons/images/segmentation.svg:/icons/images/segmentation.svg
  
  
  
   
    
     0
     0
     640
     31
    
   
   
    
     &File
    
    
     
      Open &recent
     
    
    
    
    
    
   
   
    
     &Playback
    
    
    
    
   
   
    
     &View
    
    
    
    
    
    
    
    
   
   
    
     &Help
    
    
    
    
   
   
   
   
   
  
  
  
   
    toolBar
   
   
    TopToolBarArea
   
   
    false
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
  
  
   
    
     :/icons/images/fileopen.png:/icons/images/fileopen.png
   
   
    &Open
   
   
    Open a song
   
   
    Ctrl+O
   
  
  
   
    
     :/icons/images/exit.png:/icons/images/exit.png
   
   
    E&xit
   
   
    Ctrl+Q
   
  
  
   
    
     :/icons/images/player_play.png:/icons/images/player_play.png
   
   
    Play
   
   
    Space
   
  
  
   
    
     :/icons/images/player_stop.png:/icons/images/player_stop.png
   
   
    Stop
   
   
    Esc
   
  
  
   
    
     :/icons/images/player_pause.png:/icons/images/player_pause.png
   
   
    Pause
   
  
  
   
    
     :/icons/images/help.png:/icons/images/help.png
   
   
    Online &tutorial
   
   
    F1
   
  
  
   
    
     :/icons/images/contexthelp.png:/icons/images/contexthelp.png
   
   
    &What's this
   
   
    Shift+F1
   
  
  
   
    &About
   
  
  
   
    true
   
   
    
     :/icons/images/polarchromapeaks.svg:/icons/images/polarchromapeaks.svg
   
   
    Chroma &Peaks
   
  
  
   
    true
   
   
    
     :/icons/images/tonnetz.svg:/icons/images/tonnetz.svg
   
   
    &Tonnetz
   
  
  
   
    true
   
   
    
     :/icons/images/keyspace.svg:/icons/images/keyspace.svg
   
   
    &Key Space
   
  
  
   
    true
   
   
    
     :/icons/images/chordranking.svg:/icons/images/chordranking.svg
   
   
    Chord &Ranking
   
  
  
   
    true
   
   
    
     :/icons/images/segmentation.svg:/icons/images/segmentation.svg
   
   
    &Segmentation
   
  
  
   
    true
   
   
    
     :/icons/images/spectrogram.svg:/icons/images/spectrogram.svg
   
   
    Spectrogram
   
  
  
   
    true
   
   
    false
   
   
    
     :/icons/images/mix_microphone.png:/icons/images/mix_microphone.png
   
   
    Real time capture
   
  
  
   
    true
   
   
    
     :/icons/images/piano.svg:/icons/images/piano.svg
   
   
    &Piano
   
  
 
 
  
 
 

chordata-1.0.0/src/widgets/0000755014157701161570000000000011344231240017703 5ustar  david.garciaLNX_david.garciachordata-1.0.0/src/monitors/0000755014157701161570000000000011344231240020107 5ustar  david.garciaLNX_david.garciachordata-1.0.0/src/PoolPeakDataSource.cxx0000644014157701161570000000507511052341522022456 0ustar  david.garciaLNX_david.garcia/*
 * Copyright (c) 2001-2006 MUSIC TECHNOLOGY GROUP (MTG)
 *                         UNIVERSITAT POMPEU FABRA
 *
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 */

#include 
#include 
#include 
#include "PoolPeakDataSource.hxx"

#include  // debug

CLAM::VM::PoolPeakDataSource::PoolPeakDataSource()
	: _nFrames(0)
	, _frameDivision(0)
	, _samplingRate(44100)
	, _positionFrameData(0)
	, _magnitudeFrameData(0)
	, _nBins(0)
	, _currentFrame(0)
{
}

void CLAM::VM::PoolPeakDataSource::clearData()
{
	_frameDataIndex.clear();
	_nFrames=0;
	_frameDivision=0;
	_positionFrameData=0;
	_magnitudeFrameData=0;
	_currentFrame=0;
	_nBins = 0;
	_storage = 0;
}

void CLAM::VM::PoolPeakDataSource::setDataSource(unsigned nBins)
{
	_nBins = nBins;
}

void CLAM::VM::PoolPeakDataSource::setStorage(
	FloatPairVectorStorage *storage,
	TData samplingRate,
	CLAM_Annotator::FrameDivision * frameDivision)
{
	_storage = storage;
	_positionFrameData = 0;
	_magnitudeFrameData = 0;
	_nFrames = _storage->PositionStorage().size();
	_frameDivision = frameDivision;

	_frameDataIndex.resize(_nFrames);
	Storage::iterator positionIt = _storage->PositionStorage().begin();
	Storage::iterator magnitudeIt = _storage->MagnitudeStorage().begin();
	for (unsigned i=0; i<_nFrames; i++)
		_frameDataIndex[i]=std::make_pair(&*positionIt++, &*magnitudeIt++);
}

bool CLAM::VM::PoolPeakDataSource::setCurrentTime(double timeMiliseconds)
{
	unsigned newFrame = _frameDivision ? _frameDivision->GetItem(timeMiliseconds*_samplingRate): 0;
	if (_nFrames==0) newFrame = 0;
	else if (newFrame>=_nFrames) newFrame=_nFrames-1;

	_nBins =  _nFrames ? _frameDataIndex[newFrame].first->size() : 0;
	_positionFrameData = _nBins ? &(*_frameDataIndex[newFrame].first)[0] : 0;
	_magnitudeFrameData = _nBins ? &(*_frameDataIndex[newFrame].second)[0] : 0;

	if (newFrame == _currentFrame) return false;
	_currentFrame = newFrame;
	return true;
}
chordata-1.0.0/src/main.cxx0000644014157701161570000000456111161026403017713 0ustar  david.garciaLNX_david.garcia/*
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

#include 
#include 
#include 

#include "MainWindow.hxx"

#ifdef _MSVC_VER
#include 
#include 
#endif

#ifndef I18N_PATH
#define I18N_PATH "../"
#endif

void usage(const std::string & program)
{
	std::cout 
		<< " Usage: " << program
		<< " [-b ] [--help]\n"
		<< "Options:\n"
		<< " -b    The backend can be JACK, PortAudio or Auto.\n"
		<< " --help         This help.\n"
		<< std::endl;
}

int main( int argc, char ** argv )
{

#ifdef _MSVC_VER
	CLAM::ProcessingModule::init();
	CLAM::AudioIOModule::init();
#endif
	
	QApplication app( argc, argv );

	QString backendName = "Auto";
	enum { none, backend } optionArgument = none;
	for (int i=1; i
  
    images/mix_microphone.png
    images/chordranking.svg
    images/contexthelp.png
    images/exit.png
    images/fileopen.png
    images/help.png
    images/keyspace.svg
    images/player_pause.png
    images/player_play.png
    images/player_stop.png
    images/polarchromapeaks.svg
    images/segmentation.svg
    images/spectrogram.svg
    images/tonnetz.svg
    images/piano.svg
  
  

chordata-1.0.0/src/PoolSegmentationDataSource.cxx0000644014157701161570000000247511050112244024227 0ustar  david.garciaLNX_david.garcia/*
 * Copyright (c) 2001-2006 MUSIC TECHNOLOGY GROUP (MTG)
 *                         UNIVERSITAT POMPEU FABRA
 *
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 */

#include "PoolSegmentationDataSource.hxx"

CLAM::VM::PoolSegmentationDataSource::PoolSegmentationDataSource()
	: _data(0)
	, _currentTime(0.0)
{
}

void CLAM::VM::PoolSegmentationDataSource::updateData(CLAM::Segmentation & data)
{
	_data = (CLAM::DiscontinuousSegmentation&)data;
}

bool CLAM::VM::PoolSegmentationDataSource::setCurrentTime(double timeMiliseconds)
{
	_currentTime = timeMiliseconds;
	return true;
}

double CLAM::VM::PoolSegmentationDataSource::currentTime()
{
	return _currentTime;	
}
chordata-1.0.0/CHANGES0000644014157701161570000000065511344230371016453 0ustar  david.garciaLNX_david.garcia2010-03-05 chordata 1.0.0
'3D molluscs in the space release'
 * SVN $Revision: 11172$
 * Using CLAM 1.4.0
 * Jack support as audio backend
 * Command line options
 * First working version
 * Loading song in mp3, ogg, wavs...
 * Offline chord analysis
 * Many displays: KeySpace, Tonnetz, Chroma Peak, PCPgram, Chord ranking, Segment view
 * Displays can be activated or deactivated at will
 * Jump to whatever part of the song


chordata-1.0.0/resources/0000755014157701161570000000000011344231240017460 5ustar  david.garciaLNX_david.garciachordata-1.0.0/resources/Chordata.desktop0000644014157701161570000000062011333366024022605 0ustar  david.garciaLNX_david.garcia[Desktop Entry]
Name=CLAM Chordata
GenericName=Chord detector
Comment=MP3/OGG/Wav songs chord analyser
Icon=/usr/share/pixmaps/clam-chordata.xpm
Type=Application
Categories=Application;AudioVideo;Audio;Music;Qt
Exec=chordata
Terminal=false
MimeType=application/ogg;audio/basic;audio/mpeg;audio/x-aiff;audio/x-mp3;audio/x-wav;

[Desktop Action Edit]
Exec=chordata %f
Name=Analize chords (Chordata)



chordata-1.0.0/resources/man/0000755014157701161570000000000011344231240020233 5ustar  david.garciaLNX_david.garciachordata-1.0.0/resources/man/man1/0000755014157701161570000000000011344231240021067 5ustar  david.garciaLNX_david.garciachordata-1.0.0/resources/man/man1/chordata.10000644014157701161570000000173011333374450022750 0ustar  david.garciaLNX_david.garcia.TH chordata 1 "August 24, 2005" "version 0.3.0" "MISCELLANEOUS"
.SH NAME
chordata \- Analyzes chords on audio files
.SH SYNOPSIS
.B chordata
.RB [\| \-b
.IR backend \|] \ .\|.\|.
.RB [\| \-\-help \|]
.SH DESCRIPTION
.PP
CLAM Chordata is a chord detection tool that can be used to
browse the chords of your favourite mp3/ogg/wav music.
You can freely move arround the song, listening and 
getting insight of its tonal features by using several
available views: Chord segments, Chord ranking, Tonnetz,
Keyspace, Chromatic peaks, PCPgram...

This is an example application of the CLAM framework.

.SH OPTIONS
.TP
.BI \-b\   backend
Try the specified backend if available.
The program will choose the first specified backend that works.
If none of the specified backends is available,
the default sequence of backends will be tried.
The default sequence is 
.I jack
and 
.I portaudio
.TP
.BI \-\-help
Show the usage information.

.SH AUTHOR
CLAM development team (clam (at) iua.upf.es)

chordata-1.0.0/resources/installer.nsi0000644014157701161570000001315711344224707022211 0ustar  david.garciaLNX_david.garcia; Script generated by the HM NIS Edit Script Wizard.

; HM NIS Edit Wizard helper defines
!define PRODUCT_NAME "CLAM-Chordata"
!define PRODUCT_VERSION "${VERSION}"
!define PRODUCT_PUBLISHER "CLAM devel"
!define PRODUCT_WEB_SITE "http://clam-project.org"
!define PRODUCT_HELP "http://clam-project.org/wiki/Chordata_tutorial"
!define PRODUCT_DIR_REGKEY "Software\Microsoft\Windows\CurrentVersion\App Paths\chordata.exe"
!define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"

!define ALL_USERS

; MUI 1.67 compatible ------
!include "MUI.nsh"

; MUI Settings
!define MUI_ABORTWARNING
!define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\modern-install.ico"
!define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\modern-uninstall.ico"

; Language Selection Dialog Settings
!define MUI_LANGDLL_REGISTRY_ROOT "HKLM"
!define MUI_LANGDLL_REGISTRY_KEY "${PRODUCT_UNINST_KEY}"
!define MUI_LANGDLL_REGISTRY_VALUENAME "NSIS:Language"

; Welcome page
!insertmacro MUI_PAGE_WELCOME
; License page
!insertmacro MUI_PAGE_LICENSE "../COPYING"
; Directory page
!insertmacro MUI_PAGE_DIRECTORY
; Instfiles page
!insertmacro MUI_PAGE_INSTFILES
; Finish page
!insertmacro MUI_PAGE_FINISH

; Uninstaller pages
!insertmacro MUI_UNPAGE_INSTFILES

; Language files
!insertmacro MUI_LANGUAGE "Catalan"
!insertmacro MUI_LANGUAGE "English"
!insertmacro MUI_LANGUAGE "Spanish"

; MUI end ------

Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
OutFile "..\${PRODUCT_NAME}-${PRODUCT_VERSION}_setup.exe"
InstallDirRegKey HKLM "${PRODUCT_DIR_REGKEY}" ""
ShowInstDetails show
ShowUnInstDetails show

XPStyle "On"


Function .onInit
  !insertmacro MUI_LANGDLL_DISPLAY
   StrCpy $INSTDIR "$PROGRAMFILES\CLAM\Chordata"
FunctionEnd

Section "Principal" SEC01
  SetOutPath "$INSTDIR\bin"
  SetOverwrite ifnewer
  File "..\chordata.exe"
  File '${QTDIR}\bin\QtCore4.dll'
  File '${QTDIR}\bin\QtGui4.dll'
  File '${QTDIR}\bin\QtOpenGL4.dll'
  File '${QTDIR}\bin\QtXml4.dll'
  File '${QTDIR}\bin\QtSvg4.dll'
;  File '${QTDIR}\bin\QtNetwork4.dll'
;  File '${QTDIR}\bin\QtDesigner4.dll'
;  File '${QTDIR}\bin\QtDesignerComponents4.dll'
;  File '${QTDIR}\bin\QtAssistantClient4.dll'
  File '${CLAMINSTALLDIR}\bin\mingwm10.dll'
  File 'z:\usr\lib\wine\fakedlls\msvcrt.dll'
  File '${CLAMINSTALLDIR}\lib\clam_audioio.dll'
  File '${CLAMINSTALLDIR}\lib\clam_core.dll'
  File '${CLAMINSTALLDIR}\lib\clam_processing.dll'
  File '${CLAMINSTALLDIR}\bin\clam_qtmonitors.dll'
  File '${EXTERNALDLLDIR}\libogg-0.dll'
  File '${EXTERNALDLLDIR}\libsndfile-1.dll'
  File '${EXTERNALDLLDIR}\libvorbis-0.dll'
;  File '${EXTERNALDLLDIR}\libvorbisenc-2.dll'
;  File '${EXTERNALDLLDIR}\libvorbisfile-3.dll'
  File '${EXTERNALDLLDIR}\portaudio.dll'
  File '${EXTERNALDLLDIR}\pthreadGC2.dll'
  File '${CLAMINSTALLDIR}\lib\libxerces-c2_8_0.dll'
  ; GTK libs
  File '${EXTERNALDLLDIR}\libxml++-2.6-2.dll'
  File '${EXTERNALDLLDIR}\libxml2.dll'
  File '${EXTERNALDLLDIR}\libglibmm-2.4-1.dll'
  File '${EXTERNALDLLDIR}\libsigc-2.0-0.dll'
  File '${EXTERNALDLLDIR}\libgobject-2.0-0.dll'
  File '${EXTERNALDLLDIR}\libglib-2.0-0.dll'
  File '${EXTERNALDLLDIR}\iconv.dll'
  File '${EXTERNALDLLDIR}\intl.dll'
  File '${EXTERNALDLLDIR}\zlib1.dll'
  File '${EXTERNALDLLDIR}\libgmodule-2.0-0.dll'
  SetOutPath "$INSTDIR\bin\iconengines"
  File '${QTDIR}\plugins\iconengines\qsvgicon4.dll'
  SetOutPath "$INSTDIR\share\chordata\i18n"
;  File "..\src\i18n\Chordata_ca.qm"
;  File "..\src\i18n\Chordata_es.qm"

  CreateDirectory "$SMPROGRAMS\CLAM\Chordata"
  CreateShortCut "$SMPROGRAMS\CLAM\Chordata\Chordata.lnk" "$INSTDIR\bin\chordata.exe"
  CreateShortCut "$DESKTOP\Chordata.lnk" "$INSTDIR\bin\chordata.exe"


SectionEnd

Section -AdditionalIcons
  SetOutPath $INSTDIR
  WriteIniStr "$INSTDIR\${PRODUCT_NAME}.url" "InternetShortcut" "URL" "${PRODUCT_WEB_SITE}"
  CreateShortCut "$SMPROGRAMS\CLAM\Chordata\Website.lnk" "$INSTDIR\${PRODUCT_NAME}.url"
  CreateShortCut "$SMPROGRAMS\CLAM\Chordata\Uninstall.lnk" "$INSTDIR\uninst.exe"
SectionEnd

Section -Post
  WriteUninstaller "$INSTDIR\uninst.exe"
  WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "" "$INSTDIR\bin\chordata.exe"
  WriteRegStr HKLM "${PRODUCT_UNINST_KEY}" "DisplayName" "$(^Name)"
  WriteRegStr HKLM "${PRODUCT_UNINST_KEY}" "UninstallString" "$INSTDIR\uninst.exe"
  WriteRegStr HKLM "${PRODUCT_UNINST_KEY}" "DisplayIcon" "$INSTDIR\bin\chordata.exe"
  WriteRegStr HKLM "${PRODUCT_UNINST_KEY}" "DisplayVersion" "${PRODUCT_VERSION}"
  WriteRegStr HKLM "${PRODUCT_UNINST_KEY}" "URLInfoAbout" "${PRODUCT_WEB_SITE}"
  WriteRegStr HKLM "${PRODUCT_UNINST_KEY}" "Publisher" "${PRODUCT_PUBLISHER}"
SectionEnd


Function un.onUninstSuccess
  HideWindow
  MessageBox MB_ICONINFORMATION|MB_OK "La desinstalacin de $(^Name) finaliz satisfactoriamente."
FunctionEnd

Function un.onInit
!insertmacro MUI_UNGETLANGUAGE
  MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "Est completamente seguro que desea desinstalar $(^Name) junto con todos sus componentes?" IDYES +2
  Abort
FunctionEnd

Section Uninstall
  Delete "$DESKTOP\Chordata.lnk"
  Delete "$SMPROGRAMS\CLAM\Chordata\Uninstall.lnk"
  Delete "$SMPROGRAMS\CLAM\Chordata\Website.lnk"
  Delete "$SMPROGRAMS\CLAM\Chordata\Chordata.lnk"
  RMDir  "$SMPROGRAMS\CLAM\Chordata"
  RMDir  "$SMPROGRAMS\CLAM"

  Delete "$INSTDIR\${PRODUCT_NAME}.url"
  Delete "$INSTDIR\uninst.exe"

  Delete "$INSTDIR\share\chordata\i18n\*"
  RMDir  "$INSTDIR\share\chordata\i18n"
  RMDir  "$INSTDIR\share\chordata"
  RMDir  "$INSTDIR\share"
  Delete "$INSTDIR\bin\iconengines\*"
  RMDir  "$INSTDIR\bin\iconengines"
  Delete "$INSTDIR\bin\*"
  RMDir  "$INSTDIR\bin"
  RMDir  "$INSTDIR"

  DeleteRegKey HKLM "${PRODUCT_UNINST_KEY}"
  DeleteRegKey HKLM "${PRODUCT_DIR_REGKEY}"
  SetAutoClose true
SectionEnd
chordata-1.0.0/resources/Info.plist0000644014157701161570000000074111137125210021431 0ustar  david.garciaLNX_david.garcia



	CFBundleExecutable
	chordata
	CFBundleIconFile
	CLAM-Chordata.icns
	CFBundleName
	Chordata
	CFBundlePackageType
	APPL
	CFBundleSignature
	????


chordata-1.0.0/resources/Chordata.ico0000644014157701161570000000427611137125210021711 0ustar  david.garciaLNX_david.garcia  ( @LfN8\LMe3uW{YG#5G`nt~.u~
	

















												
				

								
				


				
				
				
								





chordata-1.0.0/resources/Chordata.rc0000644014157701161570000000005311137125210021530 0ustar  david.garciaLNX_david.garciaIDI_ICON1	ICON	DISCARDABLE	"Chordata.ico"

chordata-1.0.0/SVN_REVISION0000644014157701161570000000000611344231244017355 0ustar  david.garciaLNX_david.garcia14032
chordata-1.0.0/SConstruct0000644014157701161570000002106011333365635017515 0ustar  david.garciaLNX_david.garcia#!/usr/bin/python
import os
import glob
import sys

options = Variables('options.cache', ARGUMENTS)
options.Add(PathVariable('prefix', 'The prefix where the application will be installed', ''))
options.Add(PathVariable('clam_prefix', 'The prefix where CLAM was installed', ''))
options.Add(BoolVariable('release', 'Enabling compiler optimizations', 'no') )
options.Add(BoolVariable('verbose', 'Display the full command line instead a short command description', 'no') )
options.Add(PathVariable('external_dll_path', '(Windows only) The place where the NSIS packager takes the installed DLL from', '.'))
if sys.platform=="linux2" :
	options.Add(BoolVariable('crossmingw', 'Using MinGW crosscompiler mode', 'no') )

def scanFiles(pattern, paths) :
	files = []
	for path in paths :
		files+=glob.glob(os.path.join(path,pattern))
	return files

def recursiveDirs(root) :
	return filter( (lambda a : a.rfind( ".svn")==-1 ),  [ a[0] for a in os.walk(root)]  )

def unique(list) :
	return dict.fromkeys(list).keys()

toolchain='default'
if sys.platform == 'win32': toolchain = 'mingw'
env = Environment(ENV=os.environ, tools=[toolchain], options=options)
options.Save('options.cache', env)
Help(options.GenerateHelpText(env))

env.SConsignFile() # Single signature file

crosscompiling = env.has_key("crossmingw") and env["crossmingw"]
isWindowsPlatform = sys.platform=='win32' or crosscompiling
isLinuxPlatform = sys.platform=='linux2' and not crosscompiling
isDarwinPlatform = sys.platform=='darwin'

CLAMInstallDir = env['clam_prefix']
clam_sconstoolspath = os.path.join(CLAMInstallDir,'share','clam','sconstools')
CLAMVmQtPath = 'vmqt'

env.Tool('qt4', toolpath=[clam_sconstoolspath])
env.Tool('clam', toolpath=[clam_sconstoolspath])
env.Tool('nsis', toolpath=[clam_sconstoolspath])
if sys.platform=='darwin' : env.Tool('bundle', toolpath=[clam_sconstoolspath])
env.Tool('dmg', toolpath=[clam_sconstoolspath])
if crosscompiling :
	env.Tool('crossmingw', toolpath=[clam_sconstoolspath])
sys.path.append(clam_sconstoolspath)
import versionInfo
version, fullVersion = versionInfo.versionFromLocalInfo("chordata")
print "Version: ", version
print "Package version: ", fullVersion
versionInfo.generateVersionSources(os.path.join('src','ChordataVersion'), "Chordata", version, fullVersion)


env['CXXFILESUFFIX'] = '.cxx'
env['QT4_UICDECLSUFFIX'] = '.hxx'
env.moveIntermediateInto('generated')
if not env['verbose']: env.ClamQuietCompilation()
env.activateColorCommandLine()

env.EnableClamModules([
	'clam_core',
	'clam_audioio',
	'clam_processing',
	'clam_qtmonitors',
	], CLAMInstallDir)

env.EnableQt4Modules([
	'QtCore',
	'QtGui',
#	'QtOpenGL',
	'QtSvg',
	],
	debug=False,
	crosscompiling=crosscompiling,
	)

mainSources = {
	'chordata' : os.path.join('src','main.cxx'),
}

sourcePaths = [
	os.path.join('src'),
	os.path.join('src','generated'),
]
extraPaths = []
extraPaths += recursiveDirs(CLAMVmQtPath+"/plot")
extraPaths += recursiveDirs(CLAMVmQtPath+"/render")
extraPaths += recursiveDirs(CLAMVmQtPath+"/data")
extraPaths += recursiveDirs(CLAMVmQtPath+"/util")
extraPaths += recursiveDirs(CLAMVmQtPath+"/player")
extraPaths += recursiveDirs(CLAMVmQtPath+"/misc")
extraPaths += recursiveDirs(CLAMVmQtPath+"/widget")
extraPaths += [
	CLAMInstallDir+'/include',
	CLAMInstallDir+'/include/CLAM', # KLUDGE to keep old style includes
]
includePaths = sourcePaths + extraPaths

sources = scanFiles('*.cxx', sourcePaths)
sources = filter( (lambda a : a.rfind( "moc_")==-1 ),  sources )
sources = filter( (lambda a : a.rfind( "qrc_")==-1 ),  sources )
sources = unique(sources)
for mainSource in mainSources.values() :
	sources.remove(mainSource)

qrcfiles = scanFiles("*.qrc", sourcePaths)
if qrcfiles : sources += env.Qrc(source=qrcfiles)

uifiles = scanFiles("*.ui", sourcePaths)
if uifiles: uiheaders = env.Uic4(source=uifiles)

if isWindowsPlatform :
	sources += env.RES(source=["resources/Chordata.rc"])

env.Append(CPPPATH=includePaths)
env.Append(LIBPATH=[CLAMVmQtPath])
#env.Prepend(LIBS="clam_vmqt4")
if sys.platform=='darwin' :
	env.Append(CPPFLAGS='-DRESOURCES_BASE="\\"Chordata.app/Contents/Resources\\""')
else :
	env.Append(CPPFLAGS='-DRESOURCES_BASE="\\"' + env['prefix'] + '/share/chordata\\""')
if sys.platform!='win32' :
	# TODO: This should not be hardcoded neither prefix (because package intall)
	env.Append(CPPFLAGS='-DDATA_EXAMPLES_PATH="\\"%s\\""'%env['prefix'] + '/share/chordata/example-data')

if sys.platform=='linux2' :
	if env['release'] :
		env.Append( CCFLAGS=['-g','-O3','-fomit-frame-pointer','-Wall'] )
	else :
		env.Append( CCFLAGS=['-g','-O3','-Wall'] )

#commonObjects = env.StaticLibrary(target="chordata", source=sources)
programs = [ env.Program(target=program, source = [main] + sources)
	for program, main in mainSources.items()]

example_data = [
	#'example-data/Chords.pro'
	]

pluginDefines=['-DQT_PLUGIN','-DQT_NO_DEBUG','-DQDESIGNER_EXPORT_WIDGETS','-D_REENTRANT']
env.AppendUnique(CPPFLAGS=pluginDefines)

manpages = [
	'resources/man/man1/chordata.1',
	]

tsfiles = scanFiles("*.ts", ["src/i18n/"])
translatableSources = scanFiles('*.cxx', sourcePaths);
translatableSources+= scanFiles('*.hxx', sourcePaths);
translatableSources+= scanFiles('*.ui', sourcePaths);
translatableSources = filter( (lambda a : a.rfind( "generated/")==-1 ),  translatableSources )
translations = []
if len(tsfiles) :
	# Manual step: lupdate-qt4 *xx *ui -ts Chordata_ca.ts
	#tsNodes = env.Ts(target=tsfiles, source = translatableSources)
	# TODO: move those settings to the qt4 tool
	#env.Precious(tsNodes) # Do not remove it until really regenerated
	#env.NoClean(tsNodes) # They are not just generated but also user edited
	translations = env.Qm(source = tsfiles)

examples = []
for ext in ['pro', 'sc']:
	examples += scanFiles('*.%s'%ext, ['example-data'])

song_examples = []
for ext in ['pool', 'chords', 'mp3', 'wav', 'ogg']:
	song_examples += scanFiles('*.%s'%ext, ['example-data/SongsTest'])

menuEntries = glob.glob('resources/*.desktop')

installation = {
	'/bin' : programs,
	'/share/applications': menuEntries,
	'/share/man/man1' : manpages,
	'/share/annotator/i18n': translations,
	'/share/annotator/example-data': examples,
	'/share/annotator/example-data/SongsTest': song_examples,
}

installTargets = [
	env.Install( env['prefix']+path, files ) for path, files in installation.items() ]

def absolutePosixPathToWine(dir) :
	return 'z:'+'\\\\'.join(dir.split('/'))

if isWindowsPlatform :
	winqtdir=env['QTDIR']
	env.AppendUnique(LINKFLAGS=['-Wl,-subsystem,windows']) # remove the console in windows
	if crosscompiling : env['NSIS_MAKENSIS'] = 'wine ~/.wine/dosdevices/c:/Program\ Files/NSIS/makensis'
	if crosscompiling : winqtdir = absolutePosixPathToWine(winqtdir)
	externalDllPath = env['external_dll_path']
	if crosscompiling : externalDllPath = absolutePosixPathToWine(externalDllPath)
	winclampath = CLAMInstallDir
	if crosscompiling : winclampath = absolutePosixPathToWine(winclampath)
	if crosscompiling :
		env.AddPostAction(programs, env.Action(["i586-mingw32msvc-strip $TARGET"]))
	installTargets += [
		env.Install(
			env['prefix']+"/bin",
			os.path.join(env['QTDIR'],'bin',"Qt"+dll+"4.dll")
			) for dll in 'Core', 'Gui', 'OpenGL', 'Svg']
	env.Append(NSIS_OPTIONS=['/DVERSION=%s' % fullVersion ])
	env.Append(NSIS_OPTIONS=['/DQTDIR=%s'%winqtdir ])
	env.Append(NSIS_OPTIONS=['/DEXTERNALDLLDIR=%s' % externalDllPath ])
	env.Append(NSIS_OPTIONS=['/DCLAMINSTALLDIR=%s' % winclampath ])
	# Get the visual studio runtimes path
	for vcRuntimeDir in os.environ['PATH'].split(";") :
		vcRuntimeDir = os.path.normpath(vcRuntimeDir)
		if os.access(os.path.join(vcRuntimeDir,"msvcr71.dll"),os.R_OK) :
			break
	env.Append(NSIS_OPTIONS=['/DVCRUNTIMEDIR=%s' % vcRuntimeDir ])
	win_packages = [env.Nsis( source='resources/installer.nsi')]
	env.Alias('package', win_packages)

if sys.platform=='darwin' :
	# TODO: Review why those flags were added# TODO: Review why those flags were added# TODO: Review why those flags were added
	env.Append(CPPFLAGS='-DRESOURCES_BASE="\\"Chordata.app/Contents/Resources\\""')
	env.AppendUnique( LINKFLAGS=['-dynamic','-bind_at_load'])

	#TODO install resources
	installTargets = []
	
	mac_bundle = env.Bundle( 
		BUNDLE_NAME='Chordata', 
		BUNDLE_BINARIES=programs,
	#	BUNDLE_RESOURCEDIRS=['foo','bar'],
		BUNDLE_PLIST='resources/Info.plist',
		BUNDLE_ICON='resources/CLAM-Chordata.icns',
	 )
	env.Alias('bundle', mac_bundle)

	#TODO mac_bundle should be dependency of Dmga:	
	arch = os.popen("uname -p").read().strip()
	mac_packages = env.Dmg('CLAM_Chordata-%s-%s.dmg'% (fullVersion, arch), [
		env.Dir('Chordata.app/'),
		env.Dir('example-data/'),
	]+installTargets )
	env.Alias('package', mac_packages)

env.Alias('install', installTargets )

env.Default(programs, translations)

chordata-1.0.0/COPYING0000644014157701161570000000425411037100314016502 0ustar  david.garciaLNX_david.garciaLicense Notes

CLAM is offered under the GNU General Public License (GPL).

You may get a complete copy of the license by writing to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1308 USA or at http://www.gnu.org/copyleft/gpl.html.

The following, though, is a brief summary of what this license means. Nevertheless, that does not imply the Free Software Foundation agrees with the exact words that are in this website. For legal interpretations you might as well contact FSF yourself.(http://fsfeurope.org)

The GPL is the most often used license for Free Software, with over 50% of all Free Software being licensed under it. For a piece of software to classify as Free Software, it must grant the user the freedom to use, modify, study, and distribute it. "Copyleft" protects this rights by requiring that the result of using Free Software is also Free. GPL is a particular version of the Copyleft endorsed by the GNU project and FSF.

All the above means, to put it short, that you can do whatever you want with CLAM as long as the resulting software is also licensed under the GPL.(In-house or personal modifications to CLAM, though are not forced to become public).

Note: an important feature of free software is that the source code must be open so it can effectively be modified. Open Source, though, has nowadays become something different and an open source project does not necessarily imply Free Software.

The Copyleft is there to protect the user's freedom but also the author's rights. No one will be able to make a "propietary" (opposite to Free) software without his consent. (One can sell and distribute the product and make money from that activity as long as it does not violate the GPL license).

So, what if you want to build a "propietary" piece of software and you want to use CLAM? Can you just do that? The answer is no, but... But if you talk to us we can possibly come to an agreement and offer you a non-GPL license for using CLAM. Note though that this double-licensing scheme can only be used by the authors themselves and cannot be enforced by a third party.

Anyway, if you have any doubt about the license, please send a mail to clam-info@iua.upf.es.