Haiku : Ulula il lupo nel buio verso l’alto la luna guarda.
"The signal is the truth. The noise is what distracts us from the truth. Hack Noise."
- Ah, l'ho capito, l'ho già capito... ho capito che lei è una macchina difettosa ed è per questo che la fabbrica l'ha messa qui. Vuole che le dica come mai lo so? Lo so perché io ci lavoro in quella fabbrica, le faccio io le macchine.


Sound healing is an effective and proven modality that uses vibrational sound to help reduce stress, alter consciousness and create a deep sense of peace.
una condizione di errore che si verifica a runtime quando in un buffer di una data dimensione vengono scritti dati di dimensioni maggiori; viene sovrascritta parte della zona di memoria immediatamente adiacente al buffer in questione, con diversi effetti possibili a seconda di dove è situato il buffer e di come è organizzata la memoria.


I gesti ripetitivi, i ritmi disumani e spersonalizzanti della catena di montaggio minano la ragione del povero Charlot protagonista del film, nei panni di un operaio meccanico.


Il termine poltergeist deriva dal tedesco e significa spirito rumoroso (geist significa spirito, poltern bussare).


Haiku : Il fuco vola via. La regina è schiava. (Fight Club, Chuck Palahniuk)


poi un rumore basso e profondo, echi sinistri, zoccoli, cavalli in corsa... 40/50 cavalli sbucano scampanando dal sottobosco e circondano il gruppo inebriato dai fagioli e dalle patate al cartoccio cucinate da Shaka, che si mangiano con tutta la buccia; a capo del branco un Cavallo Nero imponente e potente come il cavallo di Raoul, il Re di Hokuto, si avvicina, nitrisce e poi parla... .... "Qui voi non potete stare", la sua voce è profonda e terrorizzante, "state occupando il nostro territorio e avete messo le tende sulla nostra erba migliore"... "se non andate via e non smontate il campo, scampaneremo tutta la notte con le nostre campane e non vi faremo dormire"




Entrammo in laboratorio e vidi l'odiosa macchina elettrica che brillava di una luminosità violetta e poco promettente. Era collegata ad una potente batteria chimica, ma in quel momento non riceveva corrente perché, durante i primi esperimenti ricordavo di averla sentita vibrare e ronzare quando era in funzione.

b = Buffer.read(s,"/home/bz/Desktop/radicaledward/supercollider/a11wlk01.wav");

al posto del grano sinusoidale prendo un pezzetto di wav

{ RLPF.ar(Saw.ar([50,75],0.1), XLine.kr(8000,400,25), 0.05) }.play;

(
SynthDef(\sfgrain, {arg bufnum=0, pan=0.0, startPos=0.0, amp=0.1, dur=0.04;
var grain;

grain= PlayBuf.ar(1,bufnum, BufRateScale.kr(bufnum), 1, BufFrames.ir(bufnum)*startPos, 0)*(EnvGen.kr(Env.perc(0.01,dur),doneAction:2)-0.001);

Out.ar(0,Pan2.ar(grain, pan))}).add;
)

(
{
200.do{arg i;
var timeprop = (i/199.0)**3;

        Synth(\sfgrain,[\freq,exprand(100,5000-(20*i)),\amp, exprand(0.05,0.1), \pan, 1.0.rand2]);
        rrand((timeprop*0.1).max(0.01),timeprop*0.3).wait
};
}.fork

)

+ GVerb Audacity






La sintesi granulare è spesso basata sullo stesso principio del campionamento ma include anche tecnologie di tipo analogico. L'idea è quella di creare suoni complessi a partire da una grossa quantità di suoni semplici. I grani sono di durata compresa tra 1 e 50 millisecondi e possono essere combinati e riprodotti insieme a velocità, fase e volume variabili. Il risultato non è un unico tono, ma una nuvola di suoni che viene manipolata in maniera differente da qualsiasi altro suono naturale o da qualsiasi altro metodo di sintesi.

Rielaborazione di un esempio di un tutorial;

(
SynthDef(\sinegrain, {arg pan, freq, amp; var grain;

grain= SinOsc.ar(freq, 0, amp)*(XLine.kr(1.001,0.001,0.1,doneAction:2)-0.001);

XLine genera una curva esponenziale di durata dur, in questo caso 0.1, tra il valore start e il valore end;






Out.ar(0,Pan2.ar(grain, pan))}).add;
)

Synth(\sinegrain,[\freq,rrand(100,10000),\amp, exprand(0.05,0.1), \pan, 1.0.rand2]);

exprand è valore float randomico in una distribuzione esponenziale tra hi e lo; rand2 tra -this e this.

//schedule 100 random grains over 1 second
(
{
2000.do{arg i;

        Synth(\sinegrain,[\freq,rrand(50,50+i*2),\amp, exprand(0.05,0.1), \pan, 1.0.rand2]);  
        0.01.wait
};
}.fork
)




(
var n = 8;
{ Mix.fill(n, { SinOsc.ar(500 + 500.0.rand, 0, 0.5 / n) })!2
}.play;
)

// qui abbiamo sempre 8 sinusoidi, ma la frequenza è calcolata in base all'indice index che viene incrementato di 1 per ogni sinusoide

(
var n = 8;
{
Mix.fill(n, { arg index;
var freq;
index.postln;
freq = 440 + index;
freq.postln;
SinOsc.ar(freq , 0, 0.5 / n)
})!2
}.play;
)
































LFPulse è un oscillatore di impulso, l'ampiezza varia da 1 a zero, non limitato in banda;
la frequenza del suono "son", freq, è un segnale impulsivo di controllo, un LFO con rate di default a 0.1 con smoothing esplonenziale ottenuto grazie a lagud;
il suono "son" è a sua volta un segnale impulsivo con frequenza modulata dalla variabile "freq";

il tutto viene clippato per introdurre distorsione e fatto passare in un filtro passbanda per imitare
il megafono di plastica della sirena; poi abbiamo un delay e un reverb;

In SuperCollider we can provide an almost-direct physical model: the LFPulse represents a "raw" on/off signal before smoothing by capacitors, and the "lagud" provides exponential smoothing, with the handy feature of allowing different time-periods for the "on" and "off" convergence. This one-line example will plot the curve for you:

This is essentially the same as Lag except that you can supply a different 60 dB time for when the signal goes up, from when the signal goes down. This is useful for smoothing out control signals, where "fade in" should be different from "fade out".

ar (in: 0, lagTimeU: 0.1, lagTimeD: 0.1, mul: 1, add: 0)
kr (in: 0, lagTimeU: 0.1, lagTimeD: 0.1, mul: 1, add: 0)

Arguments:
in input signal.
lagTimeU 60 dB lag time in seconds for the upgoing signal.
lagTimeD 60 dB lag time in seconds for the downgoing signal.
mul
add


{LFPulse.ar(1, 0.99, 0.4).lagud(0.3, 0.7)}.plot(2)

(
SynthDef(\dsaf_horn1, { |rate=0.1|
        var freq = LFPulse.kr(rate, 0.99, 0.4).lagud(0.4 / rate, 0.6 / rate) * 800 + 300;
        var son  = LFPulse.ar(freq, 0.99, 0.2).lagud(0.4 / freq, 0.6 / freq) * 2 - 1;

        // This filtering is a simple approximation of the plastic horn acoustics:
        son = BPF.ar(son.clip2(0.2), 1500, 1/4) * 4;

        // delay and reverb, to simulate the environment in which we hear the siren
        son = son + DelayC.ar(son, 0.1, 0.1, 0.3);
        son = son + FreeVerb.ar(son);

        Out.ar(0, Pan2.ar(son * 0.4));
}).add;
)

x = Synth(\dsaf_horn1);

s.scope

// Choose a rate
x.set(\rate, 3);
x.set(\rate, 0.1)


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.

freq - frequency in Hertz
iphase - initial phase offset in cycles ( 0..1 )
width - pulse width duty cycle from zero to one.



BPF             2nd order Butterworth bandpass filter

Inherits from: Object : AbstractFunction : UGen : Filter


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


A second order Butterworth bandpass filter.
     
in - input signal to be processed
freq - centre frequency in Hertz.
rq - the reciprocal of Q. bandwidth / cutoffFreq.


DelayC  simple delay line with cubic interpolation

DelayC.ar(in, maxdelaytime, delaytime, mul, add)
DelayC.kr(in, maxdelaytime, delaytime, mul, add)

Simple delay line with cubic interpolation. See also DelayN which uses no interpolation, and DelayL which uses linear interpolation. Cubic interpolation is more computationally expensive than linear, but more accurate.

See also BufDelayC.
     
in - the input signal.
maxdelaytime - the maximum delay time in seconds. used to initialize the delay buffer size.
delaytime - delay time in seconds.

FreeVerb    A reverb

FreeVerb.ar(in, mix, room, damp, mul, add)

coded from experiments with faust.

Valid parameter range from 0 to 1. Values outside this range are clipped by the UGen.

in - input signal.
Mix - dry/wet balance. range 0..1
room - room size. rage 0..1
damp - Reverb HF damp. range 0..1












Sintesi additiva di 12 sinusoidi; la fondamentale è a 150Hz, le altre sono multiple della fondamentale e l'ampiezza relativa decresce in maniera inversamente proporzionale a n, dove n è il numero dell'armonica;

(
{
f = 150;
[
SinOsc.ar(f*1, mul: 1), SinOsc.ar(f*2, mul: 1/2),
SinOsc.ar(f*3, mul: 1/3), SinOsc.ar(f*4, mul: 1/4),
SinOsc.ar(f*5, mul: 1/5), SinOsc.ar(f*6, mul: 1/6),
SinOsc.ar(f*7, mul: 1/7), SinOsc.ar(f*8, mul: 1/8),
SinOsc.ar(f*9, mul: 1/9), SinOsc.ar(f*10, mul: 1/10),
SinOsc.ar(f*11, mul: 1/11), SinOsc.ar(f*12, mul: 1/12)
]*0.5
}.scope(12)
)

Sintesi additiva con inviluppi indipendenti

(
{
f = 100;
t = Impulse.kr(1/3);
Pan2.ar(Mix.ar([
SinOsc.ar(f*1, mul: EnvGen.kr(Env.perc(0, 1.4), t)/1),
SinOsc.ar(f*2, mul: EnvGen.kr(Env.perc(0, 1.1), t)/2),
SinOsc.ar(f*3, mul: EnvGen.kr(Env.perc(0, 2), t)/3),
SinOsc.ar(f*4, mul: EnvGen.kr(Env.perc(0, 1), t)/4),
SinOsc.ar(f*5, mul: EnvGen.kr(Env.perc(0, 1.8), t)/5),
SinOsc.ar(f*6, mul: EnvGen.kr(Env.perc(0, 2.9), t)/6),
SinOsc.ar(f*7, mul: EnvGen.kr(Env.perc(0, 4), t)/7),
SinOsc.ar(f*8, mul: EnvGen.kr(Env.perc(0, 0.3), t)/8),
SinOsc.ar(f*9, mul: EnvGen.kr(Env.perc(0, 1), t)/9),
SinOsc.ar(f*10, mul: EnvGen.kr(Env.perc(0, 3.6), t)/10),
SinOsc.ar(f*11, mul: EnvGen.kr(Env.perc(0, 2.3), t)/11),
SinOsc.ar(f*12, mul: EnvGen.kr(Env.perc(0, 1.1), t)/12)
])*0.5,0)
}.scope(1)
)

EnvGen              envelope generator

Inherits from: Object : AbstractFunction : UGen

Plays back break point envelopes. The envelopes are instances of the Env class. See the Env for more info. The arguments for levelScale, levelBias, and timeScale are polled when the EnvGen is triggered and remain constant for the duration of the envelope.

*ar(envelope, gate, levelScale, levelBias, timeScale, doneAction)
*kr(envelope, gate, levelScale, levelBias, timeScale, doneAction)


*perc(attackTime, releaseTime, peakLevel, curve)

    Creates a new envelope specification which (usually) has a percussive shape.
    attackTime - the duration of the attack portion.
    releaseTime - the duration of the release portion.
    peakLevel - the peak level of the envelope.
    curve - the curvature of the envelope.







esempio preso da Designing Sound Supercollider

(
Ndef(\alarm, {
        var freq, out, operations;
        freq = Duty.kr(0.05, 0, Dseq([723, 932, 1012], inf));
        freq = LPF.kr(freq, 70);
        out = SinOsc.ar(freq);
        operations = [out, (out * pi).sin, (out * pi).cos, ((out+0.25) * pi).cos];
        out = Select.ar(MouseX.kr(0,4).poll, operations);
        Pan2.ar(out * 0.1)
}).play
)


(
SynthDef(\dsaf_multialarm, {
        |length=0.05, freqs=#[600,800,600,800], timbre=1, repeats=inf|
        var freq, out, operations;
        freq = Duty.ar(length, 0, Dseq(freqs, repeats), doneAction: 2);
        freq = LPF.ar(freq, 70);
        out = LeakDC.ar(SinOsc.ar(freq));
        out = Select.ar(timbre, [out, (out * pi).sin, (out * pi).cos, ((out+0.25) * pi).cos]);
        // NOTE: when writing a synthdef always remember the Out ugen!
        // (Handy shortcuts like Ndef and {}.play often add Out on your behalf)
        DutyOut.ar(0, Pan2.ar(out * 0.1))
}).store;
)


Synth(\dsaf_multialarm, [\length, 0.01, \freqs, [1000, 0, 1000, 0], \timbre, 3, \repeats, 3000]);



Duty                demand results from demand rate ugens

Inherits from: Object : AbstractFunction : UGen

Duty.ar(dur, reset, level, doneAction)
Duty.kr(dur, reset, level, doneAction)

See also: TDuty, Demand

A value is demanded each ugen in the list and output according to a stream of duration values.
The unit generators in the list should be 'demand' rate.
     
When there is a trigger at the reset input, the demand rate ugens in the list and the duration are reset.
The reset input may also be a demand ugen, providing a stream of reset times.


LeakDC      remove DC offset

Inherits from: Object : AbstractFunction : UGen : Filter


LeakDC.ar(in, coef, mul, add)
LeakDC.kr(in, coef, mul, add)

This filter removes a DC offset from a signal.
in - input signal.
coef - leak coefficient. Defaults to 0.995 for audiorate and 0.9 for controlrate.


Select              select one output from many sources


superclass: UGen

The output is selected from an array of inputs.

    Select.ar(which, array)
    Select.kr(which, array)





tratto da Designing Sound - Supercollider

(

// This data structure (like a "hashtable" or "associative array" in other languages)
// maps from a phone key to a pair of frequencies in Hz.
// We can push these frequencies to a synth.

~tbl = IdentityDictionary[
        $1 -> [[697, 1209]],
        $2 -> [[770, 1209]],
        $3 -> [[852, 1209]],
        $4 -> [[697, 1336]],
        $5 -> [[770, 1336]],
        $6 -> [[852, 1336]],
        $7 -> [[697, 1477]],
        $8 -> [[770, 1477]],
        $9 -> [[852, 1477]],
        $* -> [[697, 1633]],
        $0 -> [[770, 1633]],
        $# -> [[852, 1633]],
        $A -> [[941, 1209]],
        $B -> [[941, 1336]],
        $C -> [[941, 1477]],
        $D -> [[941, 1633]]
];

// Here we define a SynthDef which plays a single "number" at a time.
// Note that our strategy here is a bit different from the PD code in the book:
//   there, a single pair of sine-wave oscillators was re-used for each number,
//   whereas here, we create (and later free) an individual synth for each number.

SynthDef(\dtmf, {|freq=#[770, 1633], out=0, amp=0.2, gate=1|
        var son, env;
        son = SinOsc.ar(freq, 0, amp).sum;
        env = EnvGen.ar(Env.asr(0.001, 1, 0.001), gate, doneAction: 2);
        Out.ar(out, Pan2.ar(son * env * amp));
}).store;
)



// Check that it works:
x = Synth(\dtmf) // create
x.set(\gate, 0)  // free


Pbind           combine several value patterns to one event stream by binding keys to values
 
Inherits from: Object : AbstractFunction : Pattern

Pbind combines several value streams into one event stream. Each value stream is assigned to one or more keys in the resulting event stream. It specifies a stream of Events in terms of different patterns that are bound to different keys in the Event.
The patterns bound to keys are referred to as value patterns and the Pbind itself is termed an event pattern.
     
The keys used in a Pbind are usually determined by Event 's default mechanism and the controls defined for the SynthDef to be played. ( See SynthDef and Event below for a brief discussion of both in relation to Pbind.)


Pwhite      random values with uniform distribution

superclass: Pattern


Pwhite(lo, hi, length)


Prand                   embed values randomly chosen from a list

superclass: ListPattern

Embed one item from the list at random for each repeat.


(
// This pattern generates a random "phone number" and dials it
Pbind(
        \instrument, \dtmf,
        \dur, 0.2, // or for more "human" timing, try   Pwhite(0.2, 0.5, inf)
        \sustain, 0.15,
        \amp, 0.3,
        \freq, Prand(~tbl.asArray, 13)
).play;
)

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)


(
// You could even dial a specific number:
Pbind(
        \instrument, \dtmf,
        \dur, 0.2, // or for more "human" timing, try   Pwhite(0.2, 0.5, inf)
        \sustain, 0.15,
        \amp, 0.3,
        \freq, Pseq("012827743866".collectAs({|digit| ~tbl[digit] }, Array))
).play;
)




tratto da Designing Sound - Supercollider

Handset Filter

Questo è il filtro che emula la cornetta del telefono il sig segnale viene clippato bilateralmente tra -0.9 e 0.9;
questo clip introduce armoniche dispari allargando lo spettro e causa perdite nelle armoniche originali; viene imitato l'effetto band-limit del cavo con un filtro risonante centrato a 2Khz; le frequenze delle due sinusoidi sono entrambe all'interno dei 2Khz, ma noi qui siamo interessati all'effetto che il BPF ha sulle armoniche introdotte dal clip; Poi viene aggiunto l'effetto di un piccolo altoparlante con un altro BPF centrato a 400Hz e un clip tra -0.4 e 0.4 per introdurre appunto la distorsione dell'altoparlante; e poi con il doppio HPF vengono eliminate le basse frequenze;

(
Ndef(\transmed, {
        var sig = Ndef(\phonesource).ar.clip2(0.9);
        sig = BPF.ar(sig, 2000, 1/12);
        sig =
                BPF.ar(sig * 0.5, 400, 1/3)
                +
                (sig.clip2(0.4) * 0.15);
        HPF.ar(HPF.ar(sig, 90), 90) * 100;
}).play
)


CCITT standard for telephony as follows :

Ringing tone : 480Hz + 440Hz On 2s, off 4s Indicate remote ring

(
Ndef(\phonesource, {
        var onoff;
        onoff = LFPulse.ar(1/6, width: 1/3);
        SinOsc.ar([480, 440], 0, onoff).sum * 0.2
})
)


Busy

(
Ndef(\phonesource, {
        var onoff;
        onoff = LPF.ar(LFPulse.ar(2), 100);
        SinOsc.ar([480, 620], 0, onoff).sum * 0.2
})
)

Old-Style Pulse Dialer


(
Ndef(\phonesource, { |t_trig=0, number=0|
        var onoff, trigs, son;
        number = if(number < 0.5, 10, number); // zero is represented by 10 clicks!
        onoff = Trig1.ar(t_trig, number * 0.1);
        trigs = Impulse.ar(10) * onoff;
        son = Trig1.ar(trigs, 0.04);
        son;
});
)

// ...then dial some numbers by repeatedly running this line:
Ndef(\phonesource).set(\t_trig, 1, \number, 10.rand.postln)




























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).

























(
//frequency linked to decay length
//basically the same code but more compact
//low notes short, high long
{var frequency;
Mix.ar({
frequency = rrand(100, 300);
Pan2.ar(SinOsc.ar(frequency,
mul: EnvGen.kr(Env.perc(0.001, frequency/100),
Dust.kr(0.05), 0.2)), rrand(-1.0, 1.0)) }.dup(100))}.play
)


(
//frequency linked to decay length
//basically the same code but more compact
//low notes short, high long
{var frequency;
Mix.ar({
frequency = rrand(100, 300);
Pan2.ar(SinOsc.ar(frequency,
mul: EnvGen.kr(Env.perc(0.001, frequency/1000),
Dust.kr(0.05), 0.2)), rrand(-1.0, 1.0)) }.dup(100))}.play
)



Thus UGen-dup effectively returns a reference to the original and is a convenient way to copy a mono signal to multiple channels

rrand(24, 48) // linear distribution in the given range.


audacity effect

reverse
vocoder
equalization high+ , bass-

























(
{
var trigger;
trigger = Dust.kr(1);
Pan2.ar(Dust.ar(100,0.1)+HPF.ar(Dust.ar(TRand.kr(500, 700, trigger), mul:EnvGen.kr(Env.perc(0.01, 0.1),trigger)),100),0);
}.play
)


il trigger è un UGen Dust, quindi un generatore randomico di impulsi con densità a 1, quindi numero medio di impulsi al secondo = 1; abbiamo una base di 100 impulsi random al secondo con ampiezza minima + attivato dallo stesso trigger un dai 500 ai 700 impulsi random al secondo che partono con un attacco di 0.01 e un release di 0.1sec, il tutto filtrato da un HPF con cutoff 100Hz;


Dust                        random impulses

Dust.ar(density, mul, add)

Generates random impulses from 0 to +1.
density - average number of impulses per secon



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.





















(
{
var triggerSpeed, trigger;
triggerSpeed = 0.1;
trigger = Impulse.kr(triggerSpeed);
Pan2.ar(LFNoise0.ar(
TRand.kr(100, 1000, trigger),
mul: EnvGen.kr(
Env.perc(0.001, 3/triggerSpeed),
trigger
)
),0)
}.play
)


(
{
Pan2.ar(SinOsc.ar(SinOsc.ar(4/10, mul: 100, add: 1000), mul: 0.1) +
SinOsc.ar(SinOsc.ar(2/10, mul: 100, add: 1000), mul: 0.1) +
SinOsc.ar(SinOsc.ar(5/10, mul: 100, add: 1000), mul: 0.1),0)
}.play
)


2 suoni;

1) il trigger che è un Impulse.kr(0.1Hz) innesca il TRand.kr che produce una frequenza da 100 a 1000Hz randomicamente per il LFNoise0.ar, rumore la cui ampiezza ha un Envelopment percussivo con attacco istantaneo e un release di circa un secondo;

2) il secondo suono è creato dalla somma di 3 Sinusoidi modulate in frequenza da altre Sinusoidi a diverse frequenze, che da vita a interferenze costruttive e distruttive;

TRand           triggered random number generator

TRand.kr(lo, hi, trig)
TRand.ar(lo, hi, trig)

Generates a random float value in uniform distribution from lo to hi
each time the trig signal changes from nonpositive to positive values


Impulse     impulse oscillator

Impulse.ar(freq, phase, mul, add)

Outputs non band limited single sample impulses.
freq - frequency in Hertz
phase - phase offset in cycles ( 0..1 )























Ci sono due suoni in Mix :

1) l'UGen CombN crea un delay sulla linea di uscita, la UGen Pan2 crea controllata dalla LFNoise0 suoni spaziati randomicamente, impulsi a frequenza 77Hz e 7 armoniche a ampiezze randomiche modulate da un'altra LFNoise0 a frequeza 10Hz;

2) l'UGen Pan2 in questo caso serve a creare un suono stereo, perchè il parametro pos è 0; questa volta gli impulsi a banda limitata sono di frequenza 37Hz ma hanno numero di armoniche randomico controllato da una LFNoise0 a 0.7Hz e valori che variano ....

Blip            band limited impulse oscillator

Blip.ar(freq, numharm, mul, add)

Band Limited ImPulse generator. All harmonics have equal amplitude. This is the equivalent of 'buzz' in MusicN languages.

WARNING: This waveform in its raw form could be damaging to your ears at high amplitudes or for long periods.


CombN   comb delay line with no interpolation

CombN.ar(in, maxdelaytime, delaytime, decaytime, mul, add)
CombN.kr(in, maxdelaytime, delaytime, decaytime, mul, add)

Comb delay line with no interpolation. See also CombL which uses linear interpolation, and CombC which uses cubic interpolation. Cubic interpolation is more computationally expensive than linear, but more accurate.




























(
{
    Mix.fill(37,
        {
        var freq;
        freq = exprand(100, 3000);
        Pan2.ar(
            SinOsc.ar(
                        freq * LFNoise1.kr(1/6, 0.4, 1),
                        mul: EnvGen.kr(Env.perc(0, (freq**(-0.7))*100), Dust.kr(1/5))
                    ), LFNoise1.kr(1/8)
                )
        })*0.3
}.play

)




vediamo un pò, questo è un esempio che ho preso dal libro di David Cottle, la variabile freq è un valore random in una distribuzione esponenziale da 100 a 3000 hz, quindi avremo più probabilità di sentire valori bassi(?) o alti, mi sembra valori bassi; abbiamo un Mix di 37 Sinusoidi ogniuna con una freq diversa moltiplicata per un LFNoise tra 1 e 1.4 e una frequenza molto bassa 0.16~; il mul delle sinusoidi è dato da un Envelope di tipo percussivo attacco 0, release dipendente dalla frequenza; l'envelope è triggerato da un Dust.kr; il posizionamento spaziale della Sinusoide è definito da LFNoise1.kr(1/8);

per LFNoise, Ugens with a default range of 0 to 1:
-The add is the low end of the range
-The mul is the amount of deviation above the low.
-The mul + add is the high end of the range
-The mul is the range


Dust                        random impulses

Dust.ar(density, mul, add)

Generates random impulses from 0 to +1.
density - average number of impulses per second



exprand

Generates a single random float value in an exponential distributions from lo to hi.


Mix         sum an array of channels

Mix.new(array)

Mix will mix an array of channels down to a single channel or an array of arrays of channels down to a single array of channels. More information can be found under MultiChannel.


Pan2            two channel equal power pan

Pan2.ar(in, pos, level)


LFNoise1                ramp noise

LFNoise1.ar(freq, mul, add)
LFNoise1.kr(freq, mul, add


EnvGen              envelope generator

Inherits from: Object : AbstractFunction : UGen

Plays back break point envelopes. The envelopes are instances of the Env class. See the Env for more info. The arguments for levelScale, levelBias, and timeScale are polled when the EnvGen is triggered and remain constant for the duration of the envelope.
 
*ar(envelope, gate, levelScale, levelBias, timeScale, doneAction)
*kr(envelope, gate, levelScale, levelBias, timeScale, doneAction)


*perc(attackTime, releaseTime, peakLevel, curve)

    Creates a new envelope specification which (usually) has a percussive shape.
    attackTime - the duration of the attack portion.
    releaseTime - the duration of the release portion.
    peakLevel - the peak level of the envelope.
    curve - the curvature of the envelope.




























LPF             2nd order Butterworth lowpass filter

Inherits from: Object : AbstractFunction : UGen : Filter

LPF.ar(in, freq, mul, add)
LPF.kr(in, freq, mul, add)
 
 
A second order low pass filter.
in - input signal to be processed
freq - cutoff frequency.


Resonz          resonant filter

Inherits from: Object : AbstractFunction : UGen : Filter

Resonz.ar(in, freq, rq, mul, add)
Resonz.kr(in, freq, rq, mul, add)
 
A two pole resonant filter with zeroes at z = +/- 1. Based on K. Steiglitz, "A Note on Constant-Gain
Digital Resonators," Computer Music Journal, vol 18, no. 4, pp. 8-10, Winter 1994.




















PMOsc           phase modulation oscillator pair

PMOsc.ar(carfreq, modfreq, pmindex, modphase, mul, add)

Phase modulation sine oscillator pair.
carfreq - carrier frequency in cycles per second.
modfreq - modulator frequency in cycles per second.
pmindex - modulation index in radians.
modphase - a modulation input for the modulator's phase in radians


(
e = Env.linen(2, 5, 2);
Routine.run({
    loop({
        play({
            LinPan2.ar(Saw.ar(50)*EnvGen.ar(e) *
                PMOsc.ar(2000.0.rand,800.0.rand, Line.kr(0.0, 12.0.rand,9),0,0.1), 1.0.rand2)});
        2.wait;
    })
}))


LinPan2         two channel linear pan

LinPan2.ar(in, pos, level)

Two channel linear panner. This one sounds more like the Rhodes tremolo than Pan2.
in - input signal
pos - pan position, -1 is left, +1 is right
level - a control rate level input



















(
SynthDef(\test, {arg roomsize, revtime, damping, inputbw, spread = 15, drylevel, earlylevel,
        taillevel;
    var a = Resonz.ar(
        Array.fill(4, {SinOsc.ar(170)}), 1760 * [1, 2, 4, 8], 0.01).sum * 10;
   // var a = SoundIn.ar(0);
   // var a = PlayBuf.ar(1, 0);
    Out.ar(0, GVerb.ar(
        a,
        roomsize,
        revtime,
        damping,
        inputbw,
        spread,
        drylevel.dbamp,
        earlylevel.dbamp,
        taillevel.dbamp,
        roomsize, 0.3) + a)}).load(s)
)

s = Server.internal.boot;
s.scope(2);

// bathroom
a = Synth(\test, [\roomsize, 150, \revtime, 0.6, \damping, 0.62, \inputbw, 0.48, \drylevel -6, \earlylevel, -11, \taillevel, -13]);
a.free

A two-channel reverb UGen, based on the "GVerb" LADSPA effect by Juhana Sadeharju (kouhia at nic.funet.fi).
Known issues
There is a large CPU spike when the synth is instantiated while all the delay lines are zeroed out.
Quick changes in roomsize result in zipper noise.
Changing the roomsize does not work properly! Still trying to look for the bug... (-josh)
Class Methods
*ar (in, roomsize: 10, revtime: 3, damping: 0.5, inputbw: 0.5, spread: 15, drylevel: 1, earlyreflevel: 0.7, taillevel: 0.5, maxroomsize: 300, mul: 1, add: 0)
Arguments:
in
mono input.
roomsize
in squared meters.
revtime
in seconds.
damping
0 to 1, high frequency rolloff, 0 damps the reverb signal completely, 1 not at all.
inputbw
0 to 1, same as damping control, but on the input signal.
spread
a control on the stereo spread and diffusion of the reverb signal.
drylevel
amount of dry signal.
earlyreflevel
amount of early reflection level.
taillevel
amount of tail level.
maxroomsize
to set the size of the delay lines. Defaults to roomsize + 1.
mul

add





















(
SynthDef(\FAW_LowPad, {|outbus = 0, seconds = 400, pan = -1|
var env = EnvGen.ar(Env.linen(10, seconds - 20, 10), doneAction:2);
var lfo = SinOsc.ar(0.01);
var amp = 0.01;
var sinFunc = {|i| 
SinOsc.ar(
3 * (i + 1), 
mul: max(0, LFNoise1.kr(1))
)
};
var mix = Mix(Array.fill(150, sinFunc)) ;
var output = mix * lfo * env * amp;
Out.ar(outbus, Pan2.ar(output, pan));
}).play;
)


EnvGen              envelope generator

Inherits from: Object : AbstractFunction : UGen

Plays back break point envelopes. The envelopes are instances of the Env class. See the Env for more info. The arguments for levelScale, levelBias, and timeScale are polled when the EnvGen is triggered and remain constant for the duration of the envelope.

*ar(envelope, gate, levelScale, levelBias, timeScale, doneAction)
*kr(envelope, gate, levelScale, levelBias, timeScale, doneAction)

*linen(attackTime, sustainTime, releaseTime, level, curve)

    Creates a new envelope specification which has a trapezoidal shape.
    attackTime - the duration of the attack portion.
    sustainTime - the duration of the sustain portion.
    releaseTime - the duration of the release portion.
    level - the level of the sustain portion.
    curve - the curvature of the envelope.
 
SinOsc          interpolating sine wavetable oscillator
SinOsc.ar(freq, phase, mul, add)

LFNoise1                ramp noise
LFNoise1.ar(freq, mul, add)
LFNoise1.kr(freq, mul, add)

Mix         sum an array of channels
Mix.new(array)
Mix will mix an array of channels down to a single channel or an array of arrays of channels down to a single array of channels. More information can be found under MultiChannel.

Pan2            two channel equal power pan
Pan2.ar(in, pos, level)
Two channel equal power panner.
in - input signal
pos - pan position, -1 is left, +1 is right
level - a control rate level input






















(
// exponential random
{Mix.fill(12, // number of oscillators
{arg i;
Pan2.ar(SinOsc.ar(SinOsc.ar(
freq: MouseX.kr(rrand(0.1, 5.0), rrand(3.0, 20.0)), // speed of vibrato
mul: MouseY.kr(10, 50), // width of vibrato
add: exprand(200, 5000)), // freq of exponential random oscillators
mul: max(0, LFNoise0.kr(MouseX.kr(rrand(1, 6),rrand(6, 1))))),1.0.rand2)
})*0.03
}.play
)
(
// linear random waves
{Mix.fill(12, // number of oscillators
{arg i;
Pan2.ar(SinOsc.ar(SinOsc.ar(
freq: MouseX.kr(rrand(0.1, 5.0), rrand(3.0, 20.0)), // speed of vibrato
mul: MouseY.kr(10, 50), // width of vibrato
add: rrand(200, 5000)), // freq of linear random oscillators
mul: max(0, LFNoise0.kr(MouseX.kr(rrand(1, 6), rrand(6, 1))))), 1.0.rand2)
})*0.03
}.play
)






















il suono del respiro è preso da freesound.org

la sorta di allarme periodico che si sente ha un attacco veloce e un release medio; le due rampe in ring mode di cui la seconda detunata creano di fatto il suono che viene riverberato molto in stereo in una stanza media; un LFO molto veloce sul volume per creare l'effetto tremolo;















un mix di 5 SinOsc pannati random e modulati da LFO sinusoidali


{
Mix.ar(
Array.fill(5, // not too many values, could crash
{Pan2.ar(
SinOsc.ar(SinOsc.ar(1/10, rrand(0, 6.0), 200, 500)),
1.0.rand)}
)
)*0.02
}.play
)


(
{
var trig, out, delay;
trig = Impulse.kr(6); // trigger rate
out = Blip.ar(
TRand.kr(48, 72, trig).midicps, // range, in midi, of pitches
TRand.kr(1, 12, trig), // range of timbre
max(0, TRand.kr(-0.5, 0.4, trig)) // amplitudes
);
out = Pan2.ar(out, TRand.kr(-1.0, 1.0, trig));
out = out*EnvGen.kr(Env.perc(0, 1), trig);
out = Mix.ar({out}.dup(6))*0.2;
delay = CombL.ar(out, 2.0, 4/6, 6);
out + delay
}.play
)


Blip            band limited impulse oscillator

Blip.ar(freq, numharm, mul, add)


TRand           triggered random number generator

TRand.kr(lo, hi, trig)
TRand.ar(lo, hi, trig)

Generates a random float value in uniform distribution from lo to hi
each time the trig signal changes from nonpositive to positive values

EnvGen              envelope generator

Inherits from: Object : AbstractFunction : UGen

Plays back break point envelopes. The envelopes are instances of the Env class. See the Env for more info. The arguments for levelScale, levelBias, and timeScale are polled when the EnvGen is triggered and remain constant for the duration of the envelope.
     
*ar(envelope, gate, levelScale, levelBias, timeScale, doneAction)
*kr(envelope, gate, levelScale, levelBias, timeScale, doneAction)


*perc(attackTime, releaseTime, peakLevel, curve)

    Creates a new envelope specification which (usually) has a percussive shape.
    attackTime - the duration of the attack portion.
    releaseTime - the duration of the release portion.
    peakLevel - the peak level of the envelope.
    curve - the curvature of the envelope.
    
        Env.perc(0.05, 1, 1, -4).test.plot;
        Env.perc(0.001, 1, 1, -4).test.plot;    // sharper attack
        Env.perc(0.001, 1, 1, -8).test.plot;    // change curvature
        Env.perc(1, 0.01, 1, 4).test.plot;  // reverse envelope