closes #5 - rounding vs truncation error

This commit is contained in:
michalcourson
2025-12-03 18:25:13 -05:00
parent f637509dbc
commit 34f565a96c

View File

@ -101,7 +101,7 @@ public:
}
float update(float Pdet, int Ptarget) {
// Detect large jump (new note)
float diff = Pdet - (int)Pdet;
float diff = Pdet - (int)(Pdet+.5);
if (Ptarget != PtargPrev) {
// Immediately reset to new note