-
Notifications
You must be signed in to change notification settings - Fork 31
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
[Breaking] Introducing conditional patterns and other parser fixes #145
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Previously, the euclidian rhythm function for use in the mininotation was completely bugged. It required that the input pattern length was at least as large as the number of steps in the pattern. This is no longer the case. The initial pattern will be extended to fit the number of steps we want to map the euclidian rhythm over. I've also included a new alias for the euclid() idiom: eu().
These functions are directly taken from TidalCycles. The "sometimes" family is a family of probability functions called "always", "almostAlways", etc... up to "never" determining the probability for an event to hit.
The 'r' token is now simply 'rand'. This is longer, but it was interfering with people using one letter samples!
This is a mockup of a new functionality allowing function calls in the pattern language with support for keyword arguments. There is also a special cond= argument allowing to apply the function only if a certain condition is met!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request is focusing on the addition of new features to the basic parser. This PR will break previous polyphonic user code and might as well break other things. Updating code should however be fairly trivial just by substituting the polyphonic symbols.
do=
keyword argument, valid on any function, can be tested with a boolean condition to determine if the function will be applied or not. Booleans are denoted with either1
or0
and any parsed expression yielding1
or0
is valid.{}
syntax.>
and<
are now used for testing numbers (greater or lower) as well as<=
and>=
.beat(x, ...)
: give a beat or list of beats and return True if we are currently on that beat.every(x, ...)
: variant using measure number (similar to TidalCycles).if(condition, patternA, patternB)
: if the condition is True, play pattern A. Otherwise, play pattern B.while(condition, patternA)
: while the condition is True, do something. Otherwise, do nothing!not(condition, pattern)
: do something only when the condition is not True.10000~5000
crashing the parser.mask
function.euclid()
algorithm not working on patterns of length < steps.All of this is rather experimental. Users can ignore it for the most part if they don't play much with functions. However, it can be particularly helpful to add interesting mutations in surfboards patterns. I hope that this will be further refined to be really stable and usable!