Mix

digraph InheritanceGraph { graph [bgcolor=transparent, color=lightsteelblue2, fontname=Arial, fontsize=10, outputorder=edgesfirst, overlap=prism, penwidth=2, rankdir=LR, splines=spline, style="dashed, rounded", truecolor=true]; node [colorscheme=pastel19, fontname=Arial, fontsize=10, height=0, penwidth=2, shape=box, style="filled, rounded", width=0]; edge [color=lightslategrey, penwidth=1]; subgraph cluster_builtins { graph [label=builtins]; node [color=1]; "builtins.object" [URL="https://docs.python.org/3.6/library/functions.html#object", label=object, target=_top]; } subgraph "cluster_supriya.system" { graph [label="supriya.system"]; node [color=2]; "supriya.system.SupriyaObject.SupriyaObject" [URL="../api/supriya/ugens/../system/SupriyaObject.html#supriya.system.SupriyaObject.SupriyaObject", label="Supriya\nObject", target=_top]; } subgraph "cluster_supriya.ugens" { graph [label="supriya.ugens"]; node [color=3]; "supriya.ugens.Mix.Mix" [URL="../api/supriya/ugens/Mix.html#supriya.ugens.Mix.Mix", color=black, fontcolor=white, label=Mix, shape=oval, style="bold, filled", target=_top]; "supriya.ugens.PseudoUGen.PseudoUGen" [URL="../api/supriya/ugens/PseudoUGen.html#supriya.ugens.PseudoUGen.PseudoUGen", label="Pseudo\nUGen", shape=oval, style=bold, target=_top]; "supriya.ugens.PseudoUGen.PseudoUGen" -> "supriya.ugens.Mix.Mix"; } "builtins.object" -> "supriya.system.SupriyaObject.SupriyaObject"; "supriya.system.SupriyaObject.SupriyaObject" -> "supriya.ugens.PseudoUGen.PseudoUGen"; }

abstract class supriya.ugens.Mix.Mix[source]

A down-to-mono signal mixer.

>>> with supriya.synthdefs.SynthDefBuilder() as builder:
...     oscillators = [supriya.ugens.DC.ar(1) for _ in range(5)]
...     mix = supriya.ugens.Mix.new(oscillators)
...
>>> synthdef = builder.build(name='mix1', optimize=False)
>>> graph(synthdef)  
>>> print(synthdef)
synthdef:
    name: mix1
    ugens:
    -   DC.ar/0:
            source: 1.0
    -   DC.ar/1:
            source: 1.0
    -   DC.ar/2:
            source: 1.0
    -   DC.ar/3:
            source: 1.0
    -   Sum4.ar:
            input_four: DC.ar/3[0]
            input_one: DC.ar/0[0]
            input_three: DC.ar/2[0]
            input_two: DC.ar/1[0]
    -   DC.ar/4:
            source: 1.0
    -   BinaryOpUGen(ADDITION).ar:
            left: Sum4.ar[0]
            right: DC.ar/4[0]
>>> with supriya.synthdefs.SynthDefBuilder() as builder:
...     oscillators = [supriya.ugens.DC.ar(1) for _ in range(15)]
...     mix = supriya.ugens.Mix.new(oscillators)
...
>>> synthdef = builder.build('mix2')
>>> graph(synthdef)  
>>> print(synthdef)
synthdef:
    name: mix2
    ugens:
    -   DC.ar/0:
            source: 1.0
    -   DC.ar/1:
            source: 1.0
    -   DC.ar/2:
            source: 1.0
    -   DC.ar/3:
            source: 1.0
    -   Sum4.ar/0:
            input_four: DC.ar/3[0]
            input_one: DC.ar/0[0]
            input_three: DC.ar/2[0]
            input_two: DC.ar/1[0]
    -   DC.ar/4:
            source: 1.0
    -   DC.ar/5:
            source: 1.0
    -   DC.ar/6:
            source: 1.0
    -   DC.ar/7:
            source: 1.0
    -   Sum4.ar/1:
            input_four: DC.ar/7[0]
            input_one: DC.ar/4[0]
            input_three: DC.ar/6[0]
            input_two: DC.ar/5[0]
    -   DC.ar/8:
            source: 1.0
    -   DC.ar/9:
            source: 1.0
    -   DC.ar/10:
            source: 1.0
    -   DC.ar/11:
            source: 1.0
    -   Sum4.ar/2:
            input_four: DC.ar/11[0]
            input_one: DC.ar/8[0]
            input_three: DC.ar/10[0]
            input_two: DC.ar/9[0]
    -   DC.ar/12:
            source: 1.0
    -   DC.ar/13:
            source: 1.0
    -   DC.ar/14:
            source: 1.0
    -   Sum3.ar:
            input_one: DC.ar/12[0]
            input_three: DC.ar/14[0]
            input_two: DC.ar/13[0]
    -   Sum4.ar/3:
            input_four: Sum3.ar[0]
            input_one: Sum4.ar/0[0]
            input_three: Sum4.ar/2[0]
            input_two: Sum4.ar/1[0]

Attributes Summary

multichannel Segment by channel count and mix down in parallel.
new

Special methods

(SupriyaObject).__repr__()

Return repr(self).


Class & static methods

classmethod multichannel(sources, channel_count)[source]

Segment by channel count and mix down in parallel.

Combine panner outputs, first with first, second with second, etc.

>>> source = supriya.ugens.SinOsc.ar(frequency=[440, 660, 880])
>>> panner = supriya.ugens.PanAz.ar(
...     channel_count=4,
...     source=source,
...     position=supriya.ugens.LFNoise2.kr(),
...     )
>>> mix = supriya.ugens.Mix.multichannel(panner, channel_count=4)
>>> out = supriya.ugens.Out.ar(bus=0, source=mix)
>>> graph(out)  
>>> print(out)
synthdef:
    name: ...
    ugens:
    -   SinOsc.ar/0:
            frequency: 440.0
            phase: 0.0
    -   LFNoise2.kr:
            frequency: 500.0
    -   PanAz.ar/0:
            amplitude: 1.0
            orientation: 0.5
            position: LFNoise2.kr[0]
            source: SinOsc.ar/0[0]
            width: 2.0
    -   SinOsc.ar/1:
            frequency: 660.0
            phase: 0.0
    -   PanAz.ar/1:
            amplitude: 1.0
            orientation: 0.5
            position: LFNoise2.kr[0]
            source: SinOsc.ar/1[0]
            width: 2.0
    -   SinOsc.ar/2:
            frequency: 880.0
            phase: 0.0
    -   PanAz.ar/2:
            amplitude: 1.0
            orientation: 0.5
            position: LFNoise2.kr[0]
            source: SinOsc.ar/2[0]
            width: 2.0
    -   Sum3.ar/0:
            input_one: PanAz.ar/0[0]
            input_three: PanAz.ar/2[0]
            input_two: PanAz.ar/1[0]
    -   Sum3.ar/1:
            input_one: PanAz.ar/0[1]
            input_three: PanAz.ar/2[1]
            input_two: PanAz.ar/1[1]
    -   Sum3.ar/2:
            input_one: PanAz.ar/0[2]
            input_three: PanAz.ar/2[2]
            input_two: PanAz.ar/1[2]
    -   Sum3.ar/3:
            input_one: PanAz.ar/0[3]
            input_three: PanAz.ar/2[3]
            input_two: PanAz.ar/1[3]
    -   Out.ar:
            bus: 0.0
            source[0]: Sum3.ar/0[0]
            source[1]: Sum3.ar/1[0]
            source[2]: Sum3.ar/2[0]
            source[3]: Sum3.ar/3[0]

Compare with a non-multichannel mixdown:

>>> mix = supriya.ugens.Mix.new(panner)
>>> out = supriya.ugens.Out.ar(bus=0, source=mix)
>>> graph(out)  
>>> print(out)
synthdef:
    name: ...
    ugens:
    -   SinOsc.ar/0:
            frequency: 440.0
            phase: 0.0
    -   LFNoise2.kr:
            frequency: 500.0
    -   PanAz.ar/0:
            amplitude: 1.0
            orientation: 0.5
            position: LFNoise2.kr[0]
            source: SinOsc.ar/0[0]
            width: 2.0
    -   Sum4.ar/0:
            input_four: PanAz.ar/0[3]
            input_one: PanAz.ar/0[0]
            input_three: PanAz.ar/0[2]
            input_two: PanAz.ar/0[1]
    -   SinOsc.ar/1:
            frequency: 660.0
            phase: 0.0
    -   PanAz.ar/1:
            amplitude: 1.0
            orientation: 0.5
            position: LFNoise2.kr[0]
            source: SinOsc.ar/1[0]
            width: 2.0
    -   Sum4.ar/1:
            input_four: PanAz.ar/1[3]
            input_one: PanAz.ar/1[0]
            input_three: PanAz.ar/1[2]
            input_two: PanAz.ar/1[1]
    -   SinOsc.ar/2:
            frequency: 880.0
            phase: 0.0
    -   PanAz.ar/2:
            amplitude: 1.0
            orientation: 0.5
            position: LFNoise2.kr[0]
            source: SinOsc.ar/2[0]
            width: 2.0
    -   Sum4.ar/2:
            input_four: PanAz.ar/2[3]
            input_one: PanAz.ar/2[0]
            input_three: PanAz.ar/2[2]
            input_two: PanAz.ar/2[1]
    -   Sum3.ar:
            input_one: Sum4.ar/0[0]
            input_three: Sum4.ar/2[0]
            input_two: Sum4.ar/1[0]
    -   Out.ar:
            bus: 0.0
            source[0]: Sum3.ar[0]
classmethod new(sources)[source]