1class:: Gendy5 2summary:: Dynamic stochastic synthesis generator 3related:: Classes/Gendy1, Classes/Gendy2, Classes/Gendy3, Classes/Gendy4 4categories:: UGens>Generators>Stochastic 5 6 7Description:: 8 9This is a non-interpolating version of Nick Collins's link::Classes/Gendy1:: UGen. My idea was to use it as a kind of sample and hold jitter UGen. It works quite well in that context, and is not a bad sound generator in its own right. 10 11warning:: 12if you have lots of CPs and you have fast frequencies, the CPU cost goes up a lot because a new CP move happens every sample! 13:: 14 15 16classmethods:: 17 18method::ar, kr 19see link::Classes/Gendy1#*ar:: for explanation of parameters. 20 21 22Examples:: 23 24code:: 25//defaults 26{Pan2.ar(Gendy5.ar)}.play 27 28//sorry Xenakis!!! 29( 30var scale, buffer; 31scale = FloatArray[0, 2, 4, 6, 7, 9, 11]; 32buffer = Buffer.alloc(s, scale.size,1, {|b| b.setnMsg(0, scale) }); 33 34play({ 35 var mix; 36 mix = 37 SinOsc.ar( 38 ( 39 DegreeToKey.kr( 40 buffer.bufnum, 41 Gendy5.kr(minfreq:1, maxfreq:8, ampscale:0.1, durscale:0.1, initCPs:3, mul:7.5, add:7.5), 42 12, 43 1, 44 60 45 ) 46 + LFNoise1.kr([3,3], 0.04) 47 ).midicps, 48 0).cubed * 0.1 49 + RLPFD.ar(LFPulse.ar([48,55].midicps, 0.15), 50 Gendy4.kr(2, 2, 1, 1, 0.1, 0.2, 0.1, 0.1, 2, mul:10, add:72).midicps, 0.6, 0.2); 51 CombN.ar(mix, 0.31, 0.31, 2, 0.2, mix) 52}) 53) 54 55//wandering bass/ powerline 56{Pan2.ar(Gendy5.ar(1,1,1.0,1.0,30,100,0.3,0.05,5))}.play 57 58//play me 59{Pan2.ar(RLPF.ar(Gendy5.ar(2,3,minfreq:20, maxfreq:MouseX.kr(100,1000), durscale:0.0, initCPs:40), 500,0.3, 0.2), 0.0)}.play 60 61//scream! - careful with your ears for this one! 62( 63{ 64var mx, my; 65 66mx= MouseX.kr(220,440); 67my= MouseY.kr(0.0,1.0); 68 69Pan2.ar(Gendy5.ar(2,3,1,1,minfreq:mx, maxfreq:8*mx, ampscale:my, durscale:my, initCPs:7, mul:0.3), 0.0)}.play 70) 71 72 73//1 CP = random noise effect 74{Pan2.ar(Gendy5.ar(initCPs:1))}.play 75 76//2 CPs = suudenly an oscillator (though a fast modulating one here) 77{Pan2.ar(Gendy5.ar(initCPs:2))}.play 78 79 80//used as an LFO 81( 82{Pan2.ar(SinOsc.ar(Gendy5.kr(2,4,SinOsc.kr(0.1,0,0.49,0.51),SinOsc.kr(0.13,0,0.49,0.51), 3.4,3.5, SinOsc.kr(0.17,0,0.49,0.51), SinOsc.kr(0.19,0,0.49,0.51),10,10,50, 350), 0, 0.3), 0.0)}.play 83) 84 85DegreeToKey 86 87//wasp 88{Pan2.ar(Gendy5.ar(0, 0, SinOsc.kr(0.1, 0, 0.1, 0.9),1.0, 50,1000, 1,0.005, 12, 12, 0.2), 0.0)}.play 89 90 91//modulate distributions 92//change of pitch as distributions change the duration structure and spectrum 93{Pan2.ar(Gendy5.ar(MouseX.kr(0,7),MouseY.kr(0,7),mul:0.2), 0.0)}.play 94 95 96//modulate num of CPs 97{Pan2.ar(Gendy5.ar(knum:MouseX.kr(1,13),mul:0.2), 0.0)}.play 98 99 100//Gendy into Gendy...with cartoon side effects 101{Pan2.ar(Gendy5.ar(maxfreq:Gendy5.kr(5,4,0.3, 0.7, 0.1, MouseY.kr(0.1,10), 1.0, 1.0, 5,5, 500, 600), knum:MouseX.kr(1,13),mul:0.2), 0.0)}.play 102 103 104//use SINUS to track any oscillator and take CP positions from it, use adparam and ddparam as the inputs to sample 105{Pan2.ar(Gendy5.ar(6,6,LFPulse.kr(100, 0, 0.4, 1.0), SinOsc.kr(30, 0, 0.5),mul:0.2), 0.0)}.play 106 107 108//try out near the corners especially 109{Pan2.ar(Gendy5.ar(6,6,LFPulse.kr(MouseX.kr(0,200), 0, 0.4, 1.0), SinOsc.kr(MouseY.kr(0,200), 0, 0.5),mul:0.2), 0.0)}.play 110 111 112//texture 113( 114{ 115Mix.fill(10,{ 116var freq; 117 118freq= rrand(130,160.3); 119Pan2.ar(SinOsc.ar(Gendy5.ar(6.rand,6.rand,SinOsc.kr(0.1,0,0.49,0.51),SinOsc.kr(0.13,0,0.49,0.51),freq ,freq, SinOsc.kr(0.17,0,0.49,0.51), SinOsc.kr(0.19,0,0.49,0.51), 12, 12, 200, 400), 0, 0.1), 1.0.rand2) 120}); 121}.play 122) 123 124//wahhhhhhhh- try durscale 1.0 and 0.0 too 125( 126{Pan2.ar( 127CombN.ar( 128Resonz.ar( 129Gendy5.ar(2,3,minfreq:1, maxfreq:MouseX.kr(10,700), durscale:0.1, initCPs:10), 130MouseY.kr(50,1000), 0.1) 131,0.1,0.1,5, 0.6 132) 133, 0.0)}.play 134) 135 136 137//overkill 138( 139{ 140var n; 141n=10; 142 143Mix.fill(n,{ 144var freq, numcps; 145 146freq= rrand(130,160.3); 147numcps= rrand(2,20); 148Pan2.ar(Gendy5.ar(6.rand,6.rand,1.0.rand,1.0.rand,freq ,freq, 1.0.rand, 1.0.rand, numcps, SinOsc.kr(exprand(0.02,0.2), 0, numcps/2, numcps/2), 0.5/(n.sqrt)), 1.0.rand2) 149}); 150}.play 151) 152 153 154 155 156 157//another traffic moment 158( 159{ 160var n; 161n=10; 162 163Resonz.ar( 164Mix.fill(n,{ 165var freq, numcps; 166 167freq= rrand(50,560.3); 168numcps= rrand(2,20); 169Pan2.ar(Gendy5.ar(6.rand,6.rand,1.0.rand,1.0.rand,freq ,freq, 1.0.rand, 1.0.rand, numcps, SinOsc.kr(exprand(0.02,0.2), 0, numcps/2, numcps/2), 0.5/(n.sqrt)), 1.0.rand2) 170}) 171,MouseX.kr(100,2000), MouseY.kr(0.01,1.0)) 172; 173}.play 174) 175 176 177 178 179( 180{ 181var n; 182n=15; 183 184Resonz.ar( 185Mix.fill(n,{ 186var freq, numcps; 187 188freq= rrand(330,460.3); 189numcps= rrand(2,20); 190Pan2.ar(Gendy5.ar(6.rand,6.rand,1.0.rand,1.0.rand,freq,MouseX.kr(freq,2*freq), 1.0.rand, 1.0.rand, numcps, SinOsc.kr(exprand(0.02,0.2), 0, numcps/2, numcps/2), 0.5/(n.sqrt)), 1.0.rand2) 191}) 192,MouseX.kr(100,2000), MouseY.kr(0.01,1.0) 193) 194 195}.play; 196) 197:: 198