Mercurial > hg > nnls-chroma
comparison chromamethods.cpp @ 146:2cd99c0810f2 mirex2013
Fix compiler warnings
author | Chris Cannam |
---|---|
date | Thu, 13 Jun 2013 10:22:53 +0100 |
parents | 0d70058c2bce |
children | 59b26f52550d |
comparison
equal
deleted
inserted
replaced
145:296ffb24571f | 146:2cd99c0810f2 |
---|---|
140 float cosp = cospuls(oversampled_f[iOS],fft_f[1],fft_width); | 140 float cosp = cospuls(oversampled_f[iOS],fft_f[1],fft_width); |
141 fft_activation.push_back(cosp); | 141 fft_activation.push_back(cosp); |
142 // cerr << cosp << endl; | 142 // cerr << cosp << endl; |
143 } | 143 } |
144 | 144 |
145 for (int i = 0; i < nFFT * cq_f.size(); ++i) { | 145 for (int i = 0; i < nFFT * (int)cq_f.size(); ++i) { |
146 outmatrix[i] = 0.f; | 146 outmatrix[i] = 0.f; |
147 } | 147 } |
148 | 148 |
149 float cq_activation; | 149 float cq_activation; |
150 for (int iFFT = 1; iFFT < nFFT; ++iFFT) { | 150 for (int iFFT = 1; iFFT < nFFT; ++iFFT) { |
181 cq_f.push_back(440 * pow(2.0,0.083333333333 * (i+oob*k-69))); | 181 cq_f.push_back(440 * pow(2.0,0.083333333333 * (i+oob*k-69))); |
182 } | 182 } |
183 } | 183 } |
184 cq_f.push_back(440 * pow(2.0,0.083333 * (maxMIDI-69))); | 184 cq_f.push_back(440 * pow(2.0,0.083333 * (maxMIDI-69))); |
185 | 185 |
186 float curr_f; | 186 // float curr_f; |
187 float floatbin; | 187 float floatbin; |
188 float curr_amp; | 188 float curr_amp; |
189 // now for every combination calculate the matrix element | 189 // now for every combination calculate the matrix element |
190 for (int iOut = 0; iOut < 12 * (maxoctave - minoctave); ++iOut) { | 190 for (int iOut = 0; iOut < 12 * (maxoctave - minoctave); ++iOut) { |
191 // cerr << iOut << endl; | 191 // cerr << iOut << endl; |
192 for (int iHarm = 1; iHarm <= 20; ++iHarm) { | 192 for (int iHarm = 1; iHarm <= 20; ++iHarm) { |
193 curr_f = 440 * pow(2,(minMIDI-69+iOut)*1.0/12) * iHarm; | 193 // curr_f = 440 * pow(2,(minMIDI-69+iOut)*1.0/12) * iHarm; |
194 // if (curr_f > cq_f[nNote-1]) break; | 194 // if (curr_f > cq_f[nNote-1]) break; |
195 floatbin = ((iOut + 1) * binspersemitone + 1) + binspersemitone * 12 * log2(iHarm); | 195 floatbin = ((iOut + 1) * binspersemitone + 1) + binspersemitone * 12 * log2(iHarm); |
196 // cerr << floatbin << endl; | 196 // cerr << floatbin << endl; |
197 curr_amp = pow(s_param,float(iHarm-1)); | 197 curr_amp = pow(s_param,float(iHarm-1)); |
198 // cerr << "curramp" << curr_amp << endl; | 198 // cerr << "curramp" << curr_amp << endl; |