-
Notifications
You must be signed in to change notification settings - Fork 757
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
Topic/rate fallthrough #1835
Topic/rate fallthrough #1835
Conversation
When determining the rate of a collection of objects, the maximal rate is returned. Now if the rate happens to be nil, we just assume scalar. This allows the error to be thrown a bit later, in the UGen that takes the object as an input. This fixes supercollider#1771
… as not to give rise to confusions and assume the function as the receiver of minItem.
discussion on: #1829 |
i don't agree that this is a good solution for #1771. i agree that the error message is bad, but anything which behaves like a ugen should return a rate of i'd vote for improving the error message instead of accepting the code in #1771. playing back nil sounds like a user bug to me. |
This change won't play back nil sounds. It only lets the error appear at the best understood point, namely where nil becomes the input of an Out UGen. As usual, the receiver should be the one to decide what to do with a value. |
… but giving it a second thought, what really needs to be correct is that single method that answers the question what is the maximum rate of an array of objects?. Now if one of the objects returns This question may be asked before the objects are converted into a UGen input. |
the question should not be: what happens if the object's rate is anything, which cannot be compared to |
This is what happens (and I think is correct):
returns
|
... but note that this doesn't fail:
Independently of whether this is right or not, in the current design, it is up to the receiver to decide. The current PR's fix is intended to leave the decision to the receiver, which was previously blocked and not passed on. It is a trade off. Maybe the method should be written explicitly as:
|
if |
I see what you mean. As it currently is, I think that |
Or, even better perhaps, implement |
Normally, this kind of error is caught in `checkValidInputs`. But as the args are appended, and nil just appends itself as nothing, we never see this as an input - it simply is missing. This commit explicitly checks the input size.
Ok, this should be it. |
ping |
OK, I try to give a summary here. The proposed change in the current PR directly concerns the way the rate of an array of objects is calculated.
What should happen if there is an object that returns
This currently fails with a slightly obscure error message, which just points the reader to the implementation of The PR changes this by assuming that the above should return @timblechmann argues that:
Currently, everything can be compared to these, because the implementation (ab)uses the coincidence that
|
When determining the rate of a collection of objects, the maximal rate
is returned. Now if the rate happens to be nil, we just assume scalar.
This allows the error to be thrown a bit later, in the UGen that takes
the object as an input. This fixes #1771