You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
780 B
Python
38 lines
780 B
Python
FluidStats : MultiOutUGen {
|
|
|
|
var <channels;
|
|
|
|
*kr { arg in, size;
|
|
^this.multiNew('control',*(in.asArray++size));
|
|
}
|
|
|
|
init {arg ...theInputs;
|
|
inputs = theInputs;
|
|
this.specialIndex = (inputs.size - 2).max(0);
|
|
// this.specialIndex.postln;
|
|
^this.initOutputs(inputs.size - 1,rate);
|
|
}
|
|
|
|
checkInputs {
|
|
/* if(inputs.any.rate != 'control') {
|
|
^"input array input is not control rate";
|
|
};*/
|
|
|
|
^this.checkValidInputs;
|
|
}
|
|
|
|
initOutputs{|numChans,rate|
|
|
if(numChans.isNil or: {numChans < 1})
|
|
{
|
|
Error("No input channels").throw
|
|
};
|
|
|
|
channels = Array.fill(numChans * 2, { |i|
|
|
OutputProxy('control',this,i);
|
|
});
|
|
^channels.reshape(2,numChans);
|
|
}
|
|
|
|
numOutputs { ^(channels.size); }
|
|
}
|