From 2338e25d31469d5e9b08fe5026a6645dabd6ac97 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Sat, 3 Dec 2022 14:24:45 +0100 Subject: [PATCH] Fix automation thinning For consistency, samples need to be used a unit. Currently the calculated area is orders of magnitude larger than the default thinning_factor (20). --- libs/evoral/ControlList.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libs/evoral/ControlList.cc b/libs/evoral/ControlList.cc index 80e27f8912..db4e5074ab 100644 --- a/libs/evoral/ControlList.cc +++ b/libs/evoral/ControlList.cc @@ -404,9 +404,9 @@ ControlList::thin (double thinning_factor) /* compute the area of the triangle formed by 3 points */ - const double ppw = prevprev->when.val(); - const double pw = prev->when.val(); - const double cw = cur->when.val(); + const double ppw = prevprev->when.samples(); + const double pw = prev->when.samples(); + const double cw = cur->when.samples(); double area = fabs ((ppw * (prev->value - cur->value)) + (pw * (cur->value - prevprev->value)) +