Classes (extension) | UGens > Filters > Nonlinear

WaveLoss : Filter : PureUGen : UGen : AbstractFunction : Object
ExtensionExtension

Lose bits of your waves

Description

Divide an audio stream into tiny segments, using the signal's zero-crossings as segment boundaries, and discard a fraction of them (i.e. replace them with silence of the same length). The technique was described by Trevor Wishart in a lecture.

Parameters: the filter drops drop out of outof chunks. mode can be 1 to drop chunks in a simple deterministic fashion (e.g. always dropping the first 30 out of a set of 40 segments), or 2 to drop chunks randomly but in an appropriate proportion.

Class Methods

WaveLoss.ar(in: 0, drop: 20, outof: 40, mode: 1, mul: 1, add: 0)

WaveLoss.kr(in: 0, drop: 20, outof: 40, mode: 1, mul: 1, add: 0)

Arguments:

in
drop

number of waves to drop within each region of outof waves

outof

number of waves within which drop numbers are silenced

mode
  • 1 drops chunks in a simple deterministic fashion (i.e. always drop the first n out of m segments)
  • 2 drops waves randomly in determined proportion.

mul
add

Inherited class methods

Instance Methods

Inherited instance methods

Examples

s.boot;
// Move the mouse left/right to see the gradation of the effect.
// Move up or down to choose mode. The modes sound very different.
(
x = {
    var sig, mode;
    sig = [SinOsc.ar, PinkNoise.ar].mean;
    mode = MouseY.kr(1,2).round;
    WaveLoss.ar(sig, MouseX.kr(0, 40), 40, mode: mode, mul: 0.1);
}.play;
)
x.free;

// Plotting shows quite clearly what's going on:
(
{
    var sig;
    sig = [SinOsc.ar, PinkNoise.ar].mean;
    [sig, WaveLoss.ar(sig, 20, 40, mode: 2)];
}.plot(0.15);
)

// A stereo example, evolves over a couple of minutes - specify a breakbeat loop sample below, sounds good
b = Buffer.read(s,"sounds/amenfast.wav"); // remember to free the buffer later.
(
x = {
    var sig, mode, woo;
    sig = PlayBuf.ar(1, b.bufnum, BufRateScale.kr(b.bufnum) * 0.75, startPos: 92898, loop: 1);
    woo = {
        WaveLoss.ar(sig,
            EnvGen.kr(Env.new([199, 199, 150, 150, 199, 250], [20, 40, 60, 60, 100]), doneAction:2)
            + (FSinOsc.kr(0.2 + XLine.kr(0.001, [1.3, 1.7], 90), 0, 50) * XLine.kr(0.00000001, 1, 60))
            ,
            200, mode: 2, mul: 0.4);
    }.dup;
    woo = (woo * 0.9) + (woo.reverse * 0.1);
}.play;
)
x.free;
b.free;