shithub: ft²

Download patch

ref: cf174b4c8c75858b067f2072ffac8336c6ede9c1
parent: 9db2239ebdf25daabe6282be36c802d56d5ab8fc
author: Olav Sørensen <olav.sorensen@live.no>
date: Sat Nov 22 08:32:32 EST 2025

Update ft2_scopedraw.c

--- a/src/scopes/ft2_scopedraw.c
+++ b/src/scopes/ft2_scopedraw.c
@@ -31,7 +31,7 @@
 	int16_t *ptr16 = scopeIntrpLUT;
 	for (int32_t i = 0; i < SCOPE_INTRP_PHASES; i++)
 	{
-		const float x1 = i * (1.0f / SCOPE_INTRP_PHASES);
+		const float x1 = (float)i * (1.0f / SCOPE_INTRP_PHASES);
 		const float x2 = x1 * x1; // x^2
 		const float x3 = x2 * x1; // x^3
 
@@ -40,7 +40,7 @@
 		const float t3 = (x1 *  (1.0f/2.0f)) + (x2 * (1.0f/2.0f)) + (x3 * -(1.0f/2.0f)) + (1.0f/6.0f);
 		const float t4 =                                             x3 *  (1.0f/6.0f);
 
-		// truncate, do not round!
+		// note: truncate, do not round!
 		*ptr16++ = (int16_t)(t1 * SCOPE_INTRP_SCALE); // tap #1 at sample offset -1
 		*ptr16++ = (int16_t)(t2 * SCOPE_INTRP_SCALE); // tap #2 at sample offset  0 (center)
 		*ptr16++ = (int16_t)(t3 * SCOPE_INTRP_SCALE); // tap #3 at sample offset  1
--