From 78cd1c68a175dc14873b43a9185a29faf0bfe5cb Mon Sep 17 00:00:00 2001 From: satabol Date: Sun, 20 Nov 2022 13:03:47 +0300 Subject: [PATCH] Number->Oscillator mode triangle issue. Some corner values reset to minimum. --- nodes/number/oscillator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nodes/number/oscillator.py b/nodes/number/oscillator.py index 48510fb4ff..8a367e4b4c 100644 --- a/nodes/number/oscillator.py +++ b/nodes/number/oscillator.py @@ -58,7 +58,7 @@ def oscillator(params, constant, matching_f): res = amplitude - amplitude * (((val / period + phase) * 2) % 2) + offset elif mode == 'Triangular': - mask = ((val / period + phase) * 2) % 2 > 1 + mask = ((val / period + phase) * 2) % 2 >= 1 res = 2 * amplitude * (((val / period + phase)*2) % 1) - amplitude res[mask] *= -1 res += offset