diff --git a/libs/ardour/ardour/panner.h b/libs/ardour/ardour/panner.h index 9d6a248de0..b07167862e 100644 --- a/libs/ardour/ardour/panner.h +++ b/libs/ardour/ardour/panner.h @@ -140,13 +140,23 @@ class BaseStereoPanner : public StreamPanner static double azimuth_to_lr_fract (double azi) { /* 180.0 degrees=> left => 0.0 */ /* 0.0 degrees => right => 1.0 */ - return 1.0 - (azi/180.0); + + /* humans can only distinguish 1 degree of arc between two positions, + so force azi back to an integral value before computing + */ + + return 1.0 - (rint(azi)/180.0); } static double lr_fract_to_azimuth (double fract) { /* fract = 0.0 => degrees = 180.0 => left */ /* fract = 1.0 => degrees = 0.0 => right */ - return 180.0 - (fract * 180.0); + + /* humans can only distinguish 1 degree of arc between two positions, + so force azi back to an integral value after computing + */ + + return rint (180.0 - (fract * 180.0)); } /* old school automation loading */