-
-
Notifications
You must be signed in to change notification settings - Fork 134
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
tidal style d1 ... d9 functions + more #805
Conversation
+ add the ability to evaluate without clearing
Looks great! So 'd' is for dough? In practice it's nice to be able to disable a pattern quickly, and maybe the quickest way would be to remove the 'd' target. I suppose this wouldn't work if it was the last and only pattern in the file. Maybe that'd be a bit confusing, but probably not too bad. |
I moved from
I think having |
I guess so, as d in tidal is for dirt ? We could also add p1 .. p9 to be more close to p(1) ... p(9) edit: just read @jarmitage 's answer, and yes I also think pX makes more sense.
For that reason (and for later code modification reasons) I added q1 .. q9 as well as q(x) which just return silence. so to make a pattern silent, just change the edit: q still has a parameter to remember which output is was supposed to use, so while it makes no sense functionally, it still makes sense as "state in code" |
for d vs p, we could also add both, and use the p variants in all examples and let the d variants be there as compatibility / variant for tidal people who prefer it |
Yes I think it shouldn't be a big change from d to p, as that's just a 180 degree turn. Changing from p to q in a performance is easy as well, you can just flip it over. |
``
hihi, maybe q will one day be used to send the pattern to the cue output... |
This is the cue output: |
Yes that would send to both headphones, |
q-_-p is now in.. so i guess I'll just add it like it is and block eval / codemod is an experiment for the future based on this |
this is an attempt in adding tidal style d1 ... d9 functions + the p function and an additional q function, while still being backwards compatible with the old strudel style of not using any of these functions:
pPatterns
maps identifiers to patternspPatterns
is cleared.p(id)
sets the calling pattern onpPatterns
using the givenid
as keypPatterns
, the pattern used for playback is a stack of allpPatterns
pPatterns
is empty, the old behavior is used, so the last expression is expected to be a pattern.d1
....d9
are just shortcuts for.p(1)
....p(9)
so for example:
will play both patterns stacked, as
pPatterns
will be{1: s("bd"), 2: s("hh*2") }
.Here,
s("hh*2")
will win.Also, This still works:
There is now also the
all
function:.. which just takes in a function that is applied to the evaluated pattern at the end.
shouldHush
flag that can be set on theevaluate
function.If it is true, the evaluation will not clear the
pPatterns
, meaning you could do block based evaluation (with hidden state).breaking changes:
There is now also a new top level hush function that will clear pPatterns and return silence (actually the hush function did exist before but it was just the non chained variant of
.hush()
which is not useful at all i think).To support .d1 to .d9, i had to remove the transpiler feature that turns note variables into note strings, as it interfered with it. I don't think anyone really uses this feature, as mini notation is just more practical + it can also be confusing when you cannot name your variable after a note name..