comparison src/Silvet.cpp @ 179:825193ef09d2

Fix incorrect use of int for non-integer shift weights
author Chris Cannam
date Thu, 22 May 2014 15:06:37 +0100
parents a53c713b2a4a
children 2931089cda46 59e3cca75b8d 9b9cdfccbd14
comparison
equal deleted inserted replaced
178:a53c713b2a4a 179:825193ef09d2
490 for (int j = 0; j < pack.templateNoteCount; ++j) { 490 for (int j = 0; j < pack.templateNoteCount; ++j) {
491 491
492 localPitches[i][j] = pitchDist[j] * sum; 492 localPitches[i][j] = pitchDist[j] * sum;
493 493
494 int bestShift = 0; 494 int bestShift = 0;
495 int bestShiftValue = 0.0; 495 float bestShiftValue = 0.0;
496 if (wantShifts) { 496 if (wantShifts) {
497 for (int k = 0; k < shiftCount; ++k) { 497 for (int k = 0; k < shiftCount; ++k) {
498 if (k == 0 || shiftDist[k][j] > bestShiftValue) { 498 float value = shiftDist[k][j];
499 bestShiftValue = shiftDist[k][j]; 499 if (k == 0 || value > bestShiftValue) {
500 bestShiftValue = value;
500 bestShift = k; 501 bestShift = k;
501 } 502 }
502 } 503 }
503 localBestShifts[i][j] = bestShift; 504 localBestShifts[i][j] = bestShift;
504 } 505 }