comparison host/vamp-simple-host.cpp @ 52:d3995d2b5e08

* Fix from Craig Sapp for incorrect mixdown code
author cannam
date Mon, 12 Mar 2007 11:00:11 +0000
parents b907557b2fb9
children 4ab6224110ef 9d3272c7db60
comparison
equal deleted inserted replaced
51:2403ae53b8a5 52:d3995d2b5e08
320 for (int j = 0; j < blockSize; ++j) { 320 for (int j = 0; j < blockSize; ++j) {
321 plugbuf[c][j] = 0.0f; 321 plugbuf[c][j] = 0.0f;
322 } 322 }
323 } 323 }
324 324
325 for (int c = 0; c < sfinfo.channels; ++c) { 325 for (int j = 0; j < blockSize && j < count; ++j) {
326 int tc = c; 326 int tc = 0;
327 if (mix) tc = 0; 327 for (int c = 0; c < sfinfo.channels; ++c) {
328 for (int j = 0; j < blockSize && j < count; ++j) { 328 tc = c;
329 plugbuf[tc][j] += filebuf[j * channels + c]; 329 if (mix) tc = 0;
330 plugbuf[tc][j] += filebuf[j * sfinfo.channels + c];
330 } 331 }
331 332 if (mix) {
332 if (plugin->getInputDomain() == Vamp::Plugin::FrequencyDomain) { 333 plugbuf[0][j] /= sfinfo.channels;
333 transformInput(plugbuf[tc], blockSize); 334 }
335 }
336
337 if (plugin->getInputDomain() == Vamp::Plugin::FrequencyDomain) {
338 for (int c = 0; c < sfinfo.channels; ++c) {
339 transformInput(plugbuf[c], blockSize);
340 if (mix) break;
334 } 341 }
335 } 342 }
336 343
337 printFeatures 344 printFeatures
338 (i, sfinfo.samplerate, output, plugin->process 345 (i, sfinfo.samplerate, output, plugin->process