SuperCollider

LNX_Out

Multi purpose output for LNX_Studio

Performs many common functions on a signal or an array of signals and sends them to an outbus and effects bus. It can filter bad numbers (infinities, NaN's and denormals), remove DC offset, clip the signal to the range (-2..2), mix down multi channel expansion to a stereo pair and pan the final result. OffsetOut is used to Output the signal to a bus with accurate timing.

LNX_Out.new(signal, out, amp, pan, sendOut, sendAmp, protect, mix, scaleVolume, leak)

By default protect, mix and scaleVolume are true and leak is false.

See the Bus helpfile for more information on buses and how they are used.

This is how LNX_Out is used in the default SynthDef template.

SynthDef("LNX_Saw1", {|out, amp, vel, freq, midi, pan, gate=1, sendOut, sendAmp, in, inAmp,
                    bpm, clock, i_clock, poll, filtFreq=1800, q=0.5, dur=1 |
    var signal;
    
    signal = Pulse.ar(midi.midicps, 0.5, 0.1);
    signal = DFM1.ar(signal, filtFreq * vel, q);
    signal = signal * EnvGen.ar(Env.new([1,1,0], [0,2], [-4,-4], 1), gate, vel, 0, dur, 2);
    
    LNX_Out(signal, out, amp, pan, sendOut, sendAmp); // output the signal
    
}, metadata: ( specs: ( filtFreq: \freq, q: \unipolar )))