Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


SequenceableCollection resamp0/1 broken (e.g. SplayAz) #727

Sciss opened this Issue · 1 comment

3 participants


The following shows the problem:

SynthDef(\test1, {,});

which boils down to


Since I don't see any change in the resamp methods, perhaps somehow 0/0 was giving inf in an older SC version (3.5). Now it (correctly) gives nan, so there needs to be a protection against division by zero.

I suggest to change the following two lines:


var factor = this.size - 1 / (newSize - 1).max(1);

I think that SuperCollider isn't able to get a valid value from the operation "a/0".
We could just return "^this" for newSize=1, just not to create errors. The problem is that we have an interval, and resamp1(1) should return a number, which is ok in case our Collection is just one number. But in case our Collection was an Array, what would be the right number to represent that Array? Could we maybe return the average between the first and last values?

resamp1 { arg newSize;
if ( newSize==1, { ^this } , {
var factor = this.size - 1 / (newSize - 1);
^this.species.fill(newSize, { |i| this.blendAt(i * factor) })

@telephon telephon closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.