Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix beat function for "step sequencer" style notation (error on last fractional notes) #1126

Closed
wants to merge 17 commits into from

Conversation

geikha
Copy link
Contributor

@geikha geikha commented Jan 27, 2025

this was just pushed on #1109

but there was a loose edge case, that is, fractional notes on the upper bound of the divisor. compress can't work on ends bigger than 1, so I added a min operator which would squeeze them to fit

see:

__beat :: (Pattern (Pattern a) -> Pattern a) -> Time -> Time -> Pattern a -> Pattern a
__beat join t d p = join $ (compress (s,e) . pure) <$> p
                      where s = t' / d
                            e  = min 1 $ (t'+1) / d
                            t' = t `mod'` d

this error is also present in strudel

yaxu and others added 2 commits January 24, 2025 19:41
@yaxu yaxu force-pushed the dev branch 2 times, most recently from 05123c5 to eab7f2d Compare January 28, 2025 07:34
@yaxu
Copy link
Member

yaxu commented Jan 31, 2025

Sorry I seem to have really messed this up with the formatting etc. Do you mind redoing the PR please?

@geikha
Copy link
Contributor Author

geikha commented Jan 31, 2025

sure!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants