Skip to content

Commit

Permalink
Merge pull request #1063 from geikha/1.10-dev
Browse files Browse the repository at this point in the history
Fix negative numbers not working for boolean euclids
  • Loading branch information
matthewkaney authored Mar 30, 2024
2 parents 4f71910 + e7e0c59 commit d130059
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Sound/Tidal/UI.hs
Original file line number Diff line number Diff line change
Expand Up @@ -939,7 +939,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))
Expand Down

0 comments on commit d130059

Please sign in to comment.