-
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
SplayAz fails when input array has only one element #1045
Comments
and:
|
I think that "center" instead of "0" would be a good solution, to allow the user to move the source: var pos = if(n == 1) { center } { [ center - spread, center + spread ].resamp1(n) }; I think also that would be good to inform the user that, when spread=1, array[0] is moved to channel= (numChans/2) counterclockwise. |
Good idea, yes. |
the fix does not look good to me: especially, it introduces a possible division by zero in the resamp functions when passing a
|
This could solve also the thread "SequenceableCollection resamp0/1 It is true that: [1,6,7].resamp1(4).mean return the same values, and if we set newSize= "high number", the result Luca On 15/03/14 16:51, Tim Blechmann wrote:
|
I was thinking along the same lines. It isn't entirely clear though if you think about it, because resamp1 leaves the first element in a collection unchanged, irrespective of the new size.
Now whether that is right or not is another question, but it is a conscious decision of how to think about boundaries when you interpolate. The fix I committed sticks to the conventions so far, perhaps an argument could be added that specifies of how to deal with the boundaries in general (not only for n=1). |
|
Will never have a division by zero. |
sry ... diffed in reverse ... 3 resampling to one element will have 3 different possibilities:
for resamp0, one should probably use the first, for resamp1, i tend to prefer the third option, though no strong preference ... |
So how would that be for |
{ SplayAz.ar(2, [Dust.ar(10)]) }.play;
returns:
The reason is that
resamp1
doesn't work correctly for size=1.Both (SplayAz and resamp1) need their own respective fix.
The text was updated successfully, but these errors were encountered: