Skip to content
This repository was archived by the owner on Jun 13, 2025. It is now read-only.

if first argument of euclid is negative, apply euclidInv#916

Merged
yaxu merged 2 commits intotidalcycles:mainfrom
polymorphicengine:main
May 29, 2022
Merged

if first argument of euclid is negative, apply euclidInv#916
yaxu merged 2 commits intotidalcycles:mainfrom
polymorphicengine:main

Conversation

@polymorphicengine
Copy link
Copy Markdown
Collaborator

this is also patternable.

Copy link
Copy Markdown
Contributor

@ndr-brt ndr-brt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, thank you

_euclid :: Int -> Int -> Pattern a -> Pattern a
_euclid n k a | n >= 0 = fastcat $ fmap (bool silence a) $ bjorklund (n,k)
| otherwise = _euclidInv (-n) k a
| otherwise = fastcat $ fmap (bool a silence) $ bjorklund (-n,k)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this correct? bjorklund should be called with (n,k)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is correct, this is the case of n < 0, so -n > 0 (otherwise bjorklund wouldn't produce anything). Note the reversed order of a and silence

Copy link
Copy Markdown
Contributor

@ndr-brt ndr-brt May 28, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, right, I did a wrong assumption! So ok for me 👍

@yaxu yaxu merged commit a6bbd63 into tidalcycles:main May 29, 2022
@yaxu
Copy link
Copy Markdown
Member

yaxu commented May 29, 2022

Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Mini-notation for euclidInv

3 participants