///////////////////////////////////////////////////////////////// // GPN12 // SuperCollider Klangsynthese // Beno”t and the Mandelbrots ///////////////////////////////////////////////////////////////// // SuperCollider -> scsynth + sclang // UGens => scsynth Server.default.boot; Server.default.scope; ///////////////////////////////////////////////////////////////// // UGens, UGens, UGens ///////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////// // -- Generators // Audio Rate (44.1k) vs. Control Rate (64 sample blocks) // Periodic Oscillators: { SinOsc.ar }.play { Pulse.ar }.play { Saw.ar }.play { Impulse.ar }.play // Low Frequency Oscillators { LFPulse.ar }.play { LFSaw.ar }.play { LFPar.ar }.play { LFCub.ar }.play // Arguments: { SinOsc.ar( 120 ) }.play { SinOsc.ar( 440, 0.5pi, 0.1 ) }.play { SinOsc.ar( 880, mul:0.1 ) }.play // Noise: { WhiteNoise.ar }.play { PinkNoise.ar }.play { GrayNoise.ar }.play { ClipNoise.ar }.play { BrownNoise.ar }.play // Low Frequency Noise { LFNoise0.ar }.play { LFNoise1.ar }.play { LFNoise2.ar }.play // Operationen mit UGens: { SinOsc.ar(440) + SinOsc.ar(MouseX.kr(20, 440)) }.play // additiv { SinOsc.ar(120) * SinOsc.ar(MouseX.kr(2, 440)) }.play // amp mod // Control Ugens als argument: { SinOsc.ar( Line.kr(10000, 80, 0.05, doneAction:2) ) }.play { SinOsc.ar( MouseX.kr(220, 880) + SinOsc.kr(4, mul:40), 0, MouseY.kr(0, 1) ) }.play // Frequenzmodulation: { SinOsc.ar( SinOsc.kr( MouseX.kr(2, 400) ) * 200 + 400 ) }.play // Audio rate vs Control Rate modulation: { SinOsc.ar( SinOsc.kr(120) * 200 + 400 ) }.play { SinOsc.ar( SinOsc.ar(120) * 200 + 400 ) }.play // 'Sound UGen' vs 'LFUgen' { SinOsc.ar( LFPulse.ar(4) * 200 + 400 ) }.play { SinOsc.ar( Pulse.ar(4) * 200 + 400 ) }.play // LFPulse = unipolar UGen (0..1) { SinOsc.ar( LFPulse.kr(4, 0, 0.5, MouseX.kr(100, 400), 100) ) }.play ///////////////////////////////////////////////////////////////// // *** Multichannel expansion *** // { SinOsc.ar( [100, 200, 300, 400], 0, 0.1 ) }.draw // .draw anstatt play // expand and mix (EZ additive synthesis): { Mix.ar( SinOsc.ar( [100, 200, 300, 800], 0, 0.1 ) ) }.play { SinOsc.ar( [100, 200, 300, 400], 0, 0.1 ).sum }.play { Splay.ar( SinOsc.ar( [100, 200, 300, 400], 0, 0.1 ) ) }.play // harmonics: { Mix.ar( SinOsc.ar( 120 * (1..16), 0, 0.1 ) ) }.play // expand arguments: { SinOsc.ar( LFPulse.ar([3,4]) * [200,300] + [100, 150] ) }.play ///////////////////////////////////////////////////////////////// // *** Exotic UGens *** // // Stochastic { Gendy1.ar }.play { Gendy2.ar }.play { Gendy3.ar }.play // Chaotic { StandardL.ar }.play { LorenzL.ar }.play { GbmanN.ar }.play ///////////////////////////////////////////////////////////////// // -- Filters // HPF, LPF, BPF, BRF, RLPF, RHPF, und viele mehr! // BEQSuite (BLowPass, BHiPass, etc...) { LPF.ar(PinkNoise.ar, MouseX.kr(200, 8000), 0.1) }.play { RLPF.ar(PinkNoise.ar, MouseX.kr(400, 800), 0.1) }.play { MoogFF.ar( LFPulse.ar(60), MouseX.kr(60, 8000) ) }.play ///////////////////////////////////////////////////////////////// // -- Envelopes // Env = Envelope Beschreibung // EnvGen = Generator Env.perc.plot Env.sine.plot Env([0, 1, 0.5, 0], [1, 0.5, 0.1], [1, -4, 8]).plot { EnvGen.ar(Env.perc(0.01, 5)) * SinOsc.ar(220) }.play { EnvGen.ar(Env.sine(5)) * SinOsc.ar(220) }.play // !! WICHTIG !! doneAction! ( 2 = free synth ) { EnvGen.ar( Env.perc(0.01, 1) ) * SinOsc.ar(220) }.play { SinOsc.ar( EnvGen.kr(Env.perc(0.2, 2), doneAction:2) * 800 + 100 ) }.play ///////////////////////////////////////////////////////////////// // -- Buffers // read mono sample to 'b' b = Buffer.read(s, "/Users/yourname/Desktop/samples/loops/amen1.wav"); { PlayBuf.ar(1, b, MouseX.kr(-1, 1)) }.play { PlayBuf.ar(1, b, 1, Impulse.kr(MouseY.kr(1, 8)), MouseX.kr(0, b.numFrames)) }.play { GrainBuf.ar(2, Dust.ar(80), MouseY.kr(0.01, 0.3), b, 1, MouseX.kr(0, 1)) }.play ///////////////////////////////////////////////////////////////// // -- Live Input { SoundIn.ar(0) * SinOsc.ar(MouseX.kr(4.0, 80.0)) }.play // ez ring mod ///////////////////////////////////////////////////////////////// // sc-tweets // http://supercollider.sourceforge.net/sc140/ // http://soundcloud.com/groups/sc-tweets // http://sctweets.tumblr.com/ // http://sccode.org/ // 'Organ' + reverb: play{GVerb.ar(Blip.ar((Duty.kr(1/[1,2,4],0,Dseq([0,3,7,12,17]+24,inf))).midicps*[1,4,8],LFNoise1.kr(1/4,3,4)).sum,200,8)*0.1} // Bassline: play{t=Impulse.kr(6);f=lag(Demand.kr(t,0,Drand(midicps((10,13..40)),inf)));RLPF.ar(Pulse.ar(f),1+Decay2.kr(t)*LFNoise2.kr(2,8,9)*f,1/9)!2} // Bitwise operations: play{l=LFPar;Clip.ar((LFCub.ar(l.kr(1/[8,9],0,25,25).round(1),0,50,50) & l.kr(1/[7,5],0,25,25)),-1,1)} // Feedback: play{a=Blip.ar(60,4,LFGauss.ar(4,1/8));a=a/4+LocalIn.ar(2);a=FreqShift.ar(a,LFNoise0.kr(1/4,90));LocalOut.ar(DelayC.ar(a,1,0.1,0.9));a} ///////////////////////////////////////////////////////////////// // Useful UGens: * In / Out / LocalIn / LocalOut // IO * Pan2 / Splay / Balance2 // Panning * DelayN / DelayL / DelayC // Delays * AllpassN / AllpassL / AllpassC // All Pass Filter * CombN / CombL / CombC // Comb Filters * Gate / Select / SelectX / SelectXFocus // Source selection * Amplitude / DetectSilence // Amp Thresholding * Pitch / BeatTrack // Machine Listening * FFT / PV_UGens / IFFT // Spectral Analysis * Demand / Duty / TDuty / DUgens // Demand values * Osc / VarSaw / SynchSaw / Phasor // More oscillators * BufRd / BufWr / RecordBuf // Buffers * FreeVerb / GVerb // Reverbs * Clip / Fold / Wrap // Distortions * UGen.dumpClassSubtree // All UGens * Tour_of_UGens Guide (Documentation) // Explained tour ///////////////////////////////////////////////////////////////// // Plug-Ins: // http://sourceforge.net/projects/sc3-plugins/ // http://www.fredrikolofsson.com/pages/code-sc.html // Demo: Atari2600 // Copy extensions in: // thisProcess.platform.userExtensionDir ( SynthDef(\atari2600, {|out= 0, gate= 1, tone0= 5, tone1= 8, freq0= 10, freq1= 20, rate= 1, amp= 1, pan= 0| Ê Ê var e, z; Ê Ê e= EnvGen.kr(Env.asr(0.01, amp, 0.05), gate, doneAction:2); Ê Ê z= Atari2600.ar(tone0, tone1, freq0, freq1, 15, 15, rate); Ê Ê Out.ar(out, Pan2.ar(z*e, pan)); }).add; ) ( Pbind( Ê Ê \instrument, \atari2600, Ê Ê \dur, 0.125, Ê Ê \amp, 0.8, Ê Ê \tone0, Pseq([Pn(3, 64), Pn(2, 128), Pn(10, 8)], inf), Ê Ê \tone1, Pseq([Pn(8, 32), Pwhite(0, 15, 12)], inf), Ê Ê \freq0, Pseq([Pn(10, 17), Pn(Prand([1, 2, 3]), 4), Pn(10, 3)], inf), Ê Ê \freq1, Pseq([10, 3, Pwrand([20, 1], [0.6, 0.4])], inf) ).play )