Radio Jamming - Supercollider






















Il jamming è l'atto di disturbare volutamente le comunicazioni radio (wireless) facendo in modo che ne diminuisca il rapporto segnale/rumore, indice di chiarezza del segnale;

(
SynthDef(\bass, { arg out=0, amp=0.5, gate=1, pan=0, spread=0.8, freq=200, doneAction=2;
        var sig, sig1, sig2, sig3;
        freq = SinOsc.ar(freq*\fmfreq.kr(1).lag(0.3)) * \fmrange.kr(0.5).lag(0.3) * LFNoise1.kr(1/7).range(0.9,1.1) + 1 * freq;
        sig = SinOsc.ar(freq.lag(0.1) * [1,8,2,4,1.002]);
        sig1 = LFPulse.ar(freq * [1,4,1.001,2 * LFNoise1.kr(1/10).range(0.999,1.001),1/2], mul:1.00);
        sig = sig + sig1;
        sig = sig.fold2(SinOsc.kr(1/13).range(0.9,1));
        sig = sig.wrap2(SinOsc.kr(1/14).range(0.9,1));
        sig = RLPF.ar(sig, \lpf.kr(500).lag(0.4) * LFNoise1.kr(1/9).range(0.9,1.1), \rq.kr(0.5));
        sig = HPF.ar(sig, \hpf.kr(40));
        sig = sig * EnvGen.ar(\iadsr.kr(Env.adsr(0.01,0.1,0.8,0.1)),\igate.kr(1),doneAction:0);
        sig = sig * EnvGen.ar(\adsr.kr(Env.adsr(0.01,0.1,0.8,0.1)),gate,doneAction:doneAction);
        sig = Splay.ar(sig, spread, amp, pan);
        Out.ar(out, sig);
}).play;
)

sulla prima parte, che definisce il primo suono che si sente, tornerò quando sarò più bravo; qui sotto definisco una simple_saw con dei parametri variabili; la freq viene calcolata sulla base di uno di questi parametri freq attraverso un LFNoise2, la UGen del quadratic noise; la env è un inviluppo percussivo che viene moltiplicato per la Saw a frequenza freq con il cutoff del filtro RLPF che segue un andamento lineare decrescente; la synth viene definita e aggiunta sul server, poi fatta suonare attravero la Routine, che looppa all'infinito la sequenza Pseq del valore midi 20, che viene utilizzato come freq per il Saw che viene suonato ogni 1.7 secondi;

(
SynthDef(\simple_saw, {|outbus, freq = 30, amp = 1, decay = 10|
  var sig, env;
  freq = ({ LFNoise2.kr(1) } ! 2).exprange(freq * 0.9, freq * 1.1);
  env = EnvGen.kr(Env.perc(0.001, decay), 1, amp, doneAction: 2);
  sig = RLPF.ar(Saw.ar(freq), freq * XLine.kr(30, 5), 0.5) * env;
  Out.ar(outbus, sig);
}).add
)


(
a = Pseq(#[20, 20, 20, 20, 20], inf).asStream;
Routine({
    loop({
    Synth(\simple_saw, [\freq, a.next.midicps]);
    1.7.wait;
    })
}).play;
)

LFNoise2 quadratic noise

LFNoise2.ar(freq, mul, add)

Generates quadratically interpolated random values at a rate given by the
nearest  integer division of the sample rate by the freq argument.

freq - approximate rate at which to generate random values.


Pseq                sequentially embed values in a list

superclass: ListPattern

cycles over a list of values. The repeats variable gives
the number of times to repeat the entire list.

Pseq(list, repeats, offset)


Routine 

Superclass: Thread

Routines are functions that can return in the middle and then resume where
they left off when called again. Routines can be used to implement co-routines
as found in Scheme and some other languages.
Routines are useful for writing things that behave like Streams.
Routines inherit behaviour for math operations and filtering from Stream.

*new(func, stackSize, seed)
     
Creates a Routine instance with the given function.
The stackSize and random seed may be overridden if desired.


loop / repeat


create an object that behaves like a stream that returns values for a limited (or infinite) number of times.


LFPulse     pulse oscillator

LFPulse.ar(freq, iphase, width, mul, add)
LFPulse.kr(freq, iphase, width, mul, add)

A non-band-limited pulse oscillator. Outputs a high value of one and a low value of zero.


fold2           bilateral folding

BinaryOperator

fold2(a, b)
a fold2: b
a.fold2(b)

folds input wave a to +/- b


wrap2           bilateral wrapping

BinaryOperator

wrap2(a, b)
a wrap2: b
a.wrap2(b)

wraps input wave to +/- b


RLPF                resonant low pass filter

Inherits from: Object : AbstractFunction : UGen : Filter

A resonant low pass filter.

RLPF.ar(in, freq, rq, mul, add)
RLPF.kr(in, freq, rq, mul, add)

in - input signal to be processed
freq - cutoff frequency.
rq - the reciprocal of Q. bandwidth / cutoffFreq.


HPF             2nd order Butterworth highpass filter

Inherits from: Object : AbstractFunction : UGen : Filter : LPF


HPF.ar(in, freq, mul, add)
HPF.kr(in, freq, mul, add)

A second order high pass filter.
in - input signal to be processed
freq - cutoff frequency.


Splay 

*ar(inArray, spread,level, center,
levelComp)

*arFill(n, function, spread,level,
center, levelComp)
     
Splay spreads an array of channels across
the stereo field.
     
Optional spread and center controls, and
levelComp(ensation) (equal power).

Categories: Share

Leave a Reply