# HG changeset patch # User cannam # Date 1243936381 0 # Node ID c3cdb404f807cb7a24f97f56e3927413f98692ab # Parent 6afa0e011f7420625bd6322270f1e7b8279c4db8 * build fixes for win32-x-g++ diff -r 6afa0e011f74 -r c3cdb404f807 dsp/tempotracking/DownBeat.cpp --- a/dsp/tempotracking/DownBeat.cpp Thu May 21 16:39:35 2009 +0000 +++ b/dsp/tempotracking/DownBeat.cpp Tue Jun 02 09:53:01 2009 +0000 @@ -217,7 +217,7 @@ // We now have all spectral difference measures in specdiff - uint timesig = m_bpb; + unsigned int timesig = m_bpb; if (timesig == 0) timesig = 4; d_vec_t dbcand(timesig); // downbeat candidates @@ -253,7 +253,7 @@ { // JENSEN-SHANNON DIVERGENCE BETWEEN SPECTRAL FRAMES - uint SPECSIZE = 512; // ONLY LOOK AT FIRST 512 SAMPLES OF SPECTRUM. + unsigned int SPECSIZE = 512; // ONLY LOOK AT FIRST 512 SAMPLES OF SPECTRUM. if (SPECSIZE > oldspec.size()/4) { SPECSIZE = oldspec.size()/4; } @@ -263,7 +263,7 @@ double sumnew = 0.; double sumold = 0.; - for (uint i = 0;i < SPECSIZE;i++) + for (unsigned int i = 0;i < SPECSIZE;i++) { newspec[i] +=EPS; oldspec[i] +=EPS; @@ -272,7 +272,7 @@ sumold+=oldspec[i]; } - for (uint i = 0;i < SPECSIZE;i++) + for (unsigned int i = 0;i < SPECSIZE;i++) { newspec[i] /= (sumnew); oldspec[i] /= (sumold); diff -r 6afa0e011f74 -r c3cdb404f807 dsp/tempotracking/TempoTrackV2.cpp --- a/dsp/tempotracking/TempoTrackV2.cpp Thu May 21 16:39:35 2009 +0000 +++ b/dsp/tempotracking/TempoTrackV2.cpp Tue Jun 02 09:53:01 2009 +0000 @@ -44,7 +44,7 @@ // forwards filtering - for (uint i = 0;i < df.size();i++) + for (unsigned int i = 0;i < df.size();i++) { lp_df[i] = b[0]*df[i] + b[1]*inp1 + b[2]*inp2 - a[1]*out1 - a[2]*out2; inp2 = inp1; @@ -55,12 +55,12 @@ // copy forwards filtering to df... // but, time-reversed, ready for backwards filtering - for (uint i = 0;i < df.size();i++) + for (unsigned int i = 0;i < df.size();i++) { df[i] = lp_df[df.size()-i-1]; } - for (uint i = 0;i < df.size();i++) + for (unsigned int i = 0;i < df.size();i++) { lp_df[i] = 0.; } @@ -69,7 +69,7 @@ out1 = 0.; out2 = 0.; // backwards filetering on time-reversed df - for (uint i = 0;i < df.size();i++) + for (unsigned int i = 0;i < df.size();i++) { lp_df[i] = b[0]*df[i] + b[1]*inp1 + b[2]*inp2 - a[1]*out1 - a[2]*out2; inp2 = inp1; @@ -79,7 +79,7 @@ } // write the re-reversed (i.e. forward) version back to df - for (uint i = 0;i < df.size();i++) + for (unsigned int i = 0;i < df.size();i++) { df[i] = lp_df[df.size()-i-1]; } @@ -96,30 +96,30 @@ // then call viterbi decoding with weight vector and transition matrix // and get best path - uint wv_len = 128; + unsigned int wv_len = 128; double rayparam = 43.; // make rayleigh weighting curve d_vec_t wv(wv_len); - for (uint i=0; i (i) / pow(rayparam,2.)) * exp((-1.*pow(-static_cast (i),2.)) / (2.*pow(rayparam,2.))); } // beat tracking frame size (roughly 6 seconds) and hop (1.5 seconds) - uint winlen = 512; - uint step = 128; + unsigned int winlen = 512; + unsigned int step = 128; // matrix to store output of comb filter bank, increment column of matrix at each frame d_mat_t rcfmat; int col_counter = -1; // main loop for beat period calculation - for (uint i=0; i+winlen(i); tmat[i][j] = exp( (-1.*pow((j-mu),2.)) / (2.*pow(sigma,2.)) ); @@ -235,11 +235,11 @@ d_mat_t delta; i_mat_t psi; - for (uint i=0;i 0 ;t--) + for (unsigned int t=T-2; t>0 ;t--) { bestpath[t] = psi[t+1][bestpath[t+1]]; } @@ -320,11 +320,11 @@ // weird but necessary hack -- couldn't get above loop to terminate at t >= 0 bestpath[0] = psi[1][bestpath[1]]; - uint lastind = 0; - for (uint i=0; i (beat_period[i]); txwt[j] = exp( -0.5*pow(tightness * log((round(2*mu)-j)/mu),2)); @@ -447,7 +447,7 @@ // STARTING POINT, I.E. LAST BEAT.. PICK A STRONG POINT IN cumscore VECTOR d_vec_t tmp_vec; - for (uint i=cumscore.size() - beat_period[beat_period.size()-1] ; i(ibeats[ibeats.size()-i-1]) ); } diff -r 6afa0e011f74 -r c3cdb404f807 qm-dsp.pro --- a/qm-dsp.pro Thu May 21 16:39:35 2009 +0000 +++ b/qm-dsp.pro Tue Jun 02 09:53:01 2009 +0000 @@ -4,14 +4,26 @@ OBJECTS_DIR = tmp_obj MOC_DIR = tmp_moc -linux-g++*:QMAKE_CXXFLAGS_RELEASE += -DNDEBUG -O3 -fno-exceptions -fPIC -ffast-math -msse -msse2 -ftree-vectorize -fomit-frame-pointer +linux-g++* { + QMAKE_CXXFLAGS_RELEASE += -DNDEBUG -O3 -fno-exceptions -fPIC -ffast-math -msse -msse2 -ftree-vectorize -fomit-frame-pointer + DEFINES += USE_PTHREADS + INCLUDEPATH += ../vamp-plugin-sdk ../qm-dsp + LIBPATH += ../vamp-plugin-sdk/vamp-sdk ../qm-dsp +} -linux-g++*:DEFINES += USE_PTHREADS -macx-g++*:DEFINES += USE_PTHREADS +linux-g++-64 { + INCLUDEPATH += ../qm-vamp-plugins/build/linux/amd64 +} -linux-g++-64:INCLUDEPATH += ../qm-vamp-plugins/build/linux/amd64 +win32-x-g++ { + QMAKE_CXXFLAGS_RELEASE += -DNDEBUG -O2 -march=pentium3 -msse + INCLUDEPATH += ../include +} -macx-g++:QMAKE_CXXFLAGS_RELEASE += -fvisibility=hidden +macx-g++* { + DEFINES += USE_PTHREADS + QMAKE_CXXFLAGS_RELEASE += -fvisibility=hidden +} #DEPENDPATH += base \ # dsp/chromagram \