I’m trying to understand what SelectXFocus
is supposed to do for focus
> 1, but it doesn’t seem to make much sense to me. Below I’ve extracted the formula from the pseudo-ugen.
a = [1, 1, 1, 1];
~sxf = {|which, focus| a.collect({ arg in, i; (1 - (absdif(which, i) * focus)).max(0) * in}) }
~sxf.(1.2, 1); // -> [ 0.0, 0.8, 0.2, 0.0 ]
~sxf.(1.2, 2); // -> [ 0.0, 0.6, 0.0, 0.0 ]
~sxf.(1.2, 3); // -> [ 0.0, 0.4, 0.0, 0.0 ]
~sxf.(1.5, 1); // -> [ 0.0, 0.5, 0.5, 0.0 ]
~sxf.(1.5, 2); // -> [ 0.0, 0.0, 0.0, 0.0 ]
Basically for focus
> 1 (on which I’m guessing it’s supposed to mix more than 2 channels/inputs, it basically does nothing but attenuate on channel… ok or maybe attenuate both nearby channels a bit
~sxf.(1.5, 1.1); -> [ 0.0, 0.45, 0.45, 0.0 ]
~sxf.(1.5, 0.9); -> [ 0.0, 0.55, 0.55, 0.0 ]
Does it ever manage to actually mix more than 2 channels/inputs with that formula, for some suitable parameterization? Or am I misreading its intended purpose? The help says:
The output is mixed from an array of inputs, linearly interpolating from a number of adjacent channels. A focus argument allows to control how many adjacent sources are mixed.