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

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.

Line line generator

Inherits from: Object : AbstractFunction : UGen

Line.ar(start, end, dur, mul, add, doneAction)
Line.kr(start, end, dur, mul, add, doneAction)

Generates a line from the start value to the end value.
start - starting value
end - ending value
dur - duration in seconds
doneAction - a doneAction to be evaluated when the Line is completed. See UGen-doneActions for more detail.

Limiter peak limiter

Limiter.ar(in, level, dur)

Limits the input amplitude to the given level. Limiter will not overshoot
like Compander will, but it needs to look ahead in the audio. Thus there is a
delay equal to twice the lookAheadTime.
Limiter, unlike Compander, is completely transparent for an in range signal.

in - the signal to be processed.
level - the peak output amplitude level to which to normalize the input.
dur - aka lookAheadTime. The buffer delay time. Shorter times will produce smaller delays
and quicker transient response times, but may introduce amplitude modulation artifacts.

GVerb A two-channel reverb

#left, right = GVerb.ar(in, roomsize, revtime, damping, inputbw, spread, drylevel, earlyreflevel, taillevel,
maxroomsize, mul, add)

A two-channel reverb UGen, based on the "GVerb" LADSPA effect by Juhana Sadeharju (kouhia at nic.funet.fi).

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





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




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

(
{
var source;
var fx;
var n=10;

source= EnvGen.ar(Env([0,1,0],[0.1,1.5]),LFNoise1.kr(Rand(20,30)))*Saw.ar(170,0.5);

fx= Mix.fill(n, {
var maxdelaytime= rrand(0.01,0.03);
var half= maxdelaytime*0.5;
var quarter= maxdelaytime*0.25;

DelayC.ar(source, maxdelaytime, LFNoise1.kr(Rand(5,10),0.01,0.02) )

})!2;

fx
}.play
)


(Env([0,1,0],[0.1,1.5])).plot

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.


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)


envelope - an instance of Env, or an Array of Controls. (See Control and the example below for how to use this.)
gate - this triggers the envelope and holds it open while > 0. If the Env is fixed-length (e.g. Env.linen, Env.perc), the gate argument is used as a simple trigger. If it is an sustaining envelope (e.g. Env.adsr, Env.asr), the envelope is held open until the gate becomes 0, at which point is released.
levelScale - scales the levels of the breakpoints.
levelBias - offsets the levels of the breakpoints.
timeScale - scales the durations of the segments.
doneAction - an integer representing an action to be executed when the env is finished playing. This can be used to free the enclosing synth, etc. See UGen-doneActions for more detail.


Env envelope

superclass: Object

An Env is a specification for a segmented envelope. Envs can be used both server-side, by an EnvGen within a SynthDef, and clientside, with methods such as at and asStream, below. An Env can have any number of segments which can stop at a particular value or loop several segments when sustaining. It can have several shapes for its segment


LFNoise1 ramp noise

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

Generates linearly interpolated random values at a rate.
freq - approximate rate at which to generate random values.




(
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








puntini biancastri che appaiono su uno schermo televisivo a causa di un guasto dell'apparato ricevente o per la debolezza del segnale. è il colore della televisione sintonizzata su un canale morto, è l'interruzione del segnale portante e ipnotico del pensiero dominante.

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.




(
{
    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.



"The signal is the truth. The noise is what distracts us from the truth. Hack Noise."

(
SynthDef(\help_InFeedback, { arg out=0, in=0;
var input, sound;
input = InFeedback.ar(in, 1);
sound = SinOsc.ar(input * 1300 + 100, 0, 0.4)!2;
Out.ar(out, sound + Pluck.ar(ar(n=LFNoise1,400),a=SinOsc.kr(1),1,1/a.abs/200,99, mul: 0.1));

}).play;
)

InFeedback read signal from a bus with a current or one cycle old timestamp

Inherits from: Object : AbstractFunction : UGen : MultiOutUGen : AbstractIn

*ar(bus, numChannels)

bus - the index of the bus to read in from.
numChannels - the number of channels (i.e. adjacent buses) to read in. The default is 1. You cannot modulate this number by assigning it to an argument in a SynthDef


LFNoise1 ramp noise

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

Generates linearly interpolated random values at a rate.
freq - approximate rate at which to generate random values.

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

(
Ndef(\happyalone, { arg amp=0.5;
var source, local, lfo;

lfo = LFNoise1.kr(0.32).abs*50+[70,0.01];
#source=SinOsc.ar(lfo,amp);
source=Decay.ar(LFSaw.ar(lfo), 0.1) * WhiteNoise.ar(0.2);
local = LocalIn.ar(2) + source;
local = LPF.ar(local, 400 + LFNoise1.kr(0.1,300,100)) * 1.5;
Splay.ar(local, LFNoise1.kr(0.21).range(0,1)) * amp;

}).play
)


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


LocalIn define and read from buses local to a synth

Inherits from: Object : AbstractFunction : UGen : MultiOutUGen : AbstractIn

*ar(numChannels) - define and read from an audio bus local to the enclosing synth.
*kr(numChannels) - define and read from a control bus local to the enclosing synth.

numChannels - the number of channels (i.e. adjacent buses) to read in. The default is 1. You cannot modulate this number by assigning it to an argument in a SynthDef.

LocalIn defines buses that are local to the enclosing synth. These are like the global buses, but are more convenient if you want to implement a self contained effect that uses a feedback processing loop.
There can only be one audio rate and one control rate LocalIn per SynthDef.
The audio can be written to the bus using LocalOut.


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.


abs absolute value

a.abs
abs(a)


SimpleNumber

abs(-5);
-5.abs;
Update cookies preferences