From e7e0c594826dad28d66e7f830ad456317de2c849 Mon Sep 17 00:00:00 2001 From: Renzo Torr- <56176668+geikha@users.noreply.github.com> Date: Fri, 19 Jan 2024 01:31:56 -0300 Subject: [PATCH] replicate euclid negative behaviour on bools fixes stuff like `mask "t(-5,16)"` not work --- src/Sound/Tidal/UI.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Sound/Tidal/UI.hs b/src/Sound/Tidal/UI.hs index 21b62e03d..7ff7626f3 100644 --- a/src/Sound/Tidal/UI.hs +++ b/src/Sound/Tidal/UI.hs @@ -854,7 +854,8 @@ euclidFull n k pa pb = stack [ euclid n k pa, euclidInv n k pb ] -- | Less expressive than 'euclid' due to its constrained types, but may be more efficient. _euclidBool :: Int -> Int -> Pattern Bool -- TODO: add 'euclidBool'? -_euclidBool n k = fastFromList $ bjorklund (n,k) +_euclidBool n k | n >= 0 = fastFromList $ bjorklund (n,k) + | otherwise = fastFromList $ fmap (not) $ bjorklund (-n,k) _euclid' :: Int -> Int -> Pattern a -> Pattern a _euclid' n k p = fastcat $ map (\x -> if x then p else silence) (bjorklund (n,k))