Supercollider: UGens: make new UGens for muxing/demuxing signals

Created on 20 Oct 2016  Â·  4Comments  Â·  Source: supercollider/supercollider

It would be tremendously helpful to have a matching pair of UGens (and corresponding methods) which distribute a signal over several channels (fan out) and join together signals from several channels (fan in), respectively.

I know that we have UGens which do this, PanAz and SelectXFocus in particular. But the parameters don't match.

Here is an older sketch:

(
~branch = { |numChannels, input, index = 0, spread = 1|
    numChannels.collect { |i|
        var dist = moddif(index, i, numChannels);
        var mul = dist.linlin(0, spread, 1, 0);
        input * mul
    }
};

~pick = { |array, index, spread = 1|
    var numChannels = array.size;
    array.collect { |input, i|
        var dist = moddif(index, i, numChannels);
        var mul = dist.linlin(0, spread, 1, 0);
        input * mul
    }.sum
};

)

These could become methods / pseudo ugens, (and ~branch may for efficiency be implemented as PanAz). Extra parameters could be interpolation type.

I chose pick and branch, but perhaps there are other names that are better. Ideas?

class library scsynth enhancement

Most helpful comment

mux and demux are not bad at all, because they are precise technical terms with a clear symmetry.

… and they are short.

All 4 comments

I'm fond of mux and demux... probably getting too cute though

mux and demux are not bad at all, because they are precise technical terms with a clear symmetry.

… and they are short.

while at it, one could also consider the multichannel versions of that idea, i.e. fanning few chans to many, and many to few. SplayAz does that (with somewhat different parameters again).

@adcxyz Yes, of course they should expand as expected.

Was this page helpful?
0 / 5 - 0 ratings