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
class library: improving Pstep input handling and documentation #2511
Conversation
allow durs to also take raw lists as input
PstepDur is an extension from my ddwPatterns quark. Documentation of core classes should not refer to extensions as if every user will have them automatically. Otherwise, at a quick glance, it looks ok. |
Ah, didn't realize that. I thought it was odd that a subclass would be better documented than its super. Went back and removed those references. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
otherwise fine, thank you!
@@ -4,7 +4,10 @@ Pstep : Pattern { | |||
*new { arg levels, durs = 1, repeats = 1; | |||
^super.newCopyArgs(levels, durs, repeats).init | |||
} | |||
init { if (list.isKindOf(Collection)) { list = Pseq(list); } } | |||
init { | |||
if (list.isKindOf(Collection)) { list = Pseq(list); }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instead of list.isKindOf(Collection)
it should be list.isSequenceableCollection
. A Set
, e.g. won't work as an argument to Pseq
.
changes made, thanks for catching that—I was naively duplicating what was already there. Out of curiosity I searched the repo to see if this was a recurring pattern; luckily it seems to be unique. |
it could be that, in the future, we might want to implement multichannel expansion for patterns, then this whole conversion might be in the way. But it is there already, so let's go with it. Thank you for making it more uniform, this is exactly the kind of changes we need! |
Glad to help! |
This is a fix for issue #2489. I pulled most of the description from PstepDur. While testing out the class I also noticed that it handles
levels
being a list but notdurs
, and I couldn't see a reason why not, so I added a single line toPstep.init
to take care of that.