/usr/share/SuperCollider/HelpSource/Classes/Gendy2.schelp is in supercollider-common 1:3.8.0~repack-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 | class:: Gendy2
summary:: Dynamic stochastic synthesis generator.
related:: Classes/Gendy1, Classes/Gendy3
categories:: UGens>Generators>Stochastic
Description::
See link::Classes/Gendy1:: help file for background. This variant of
GENDYN is closer to that presented in emphasis::Hoffmann, Peter. (2000) The New GENDYN Program. Computer Music Journal 24:2, pp 31-38::.
note::
Random walk is of the amplitude and time delta, not the amp and time
directly. The amplitude step random walk uses a Lehmer style number
generator whose parameters are accessible.
::
SuperCollider implementation by Nick Collins
classmethods::
method::ar, kr
argument::ampdist
Choice of probability distribution for the next perturbation of
the amplitude of a control point.
The distributions are (adapted from the GENDYN program in Formalized Music):
table::
## 0: || LINEAR.
## 1: || CAUCHY.
## 2: || LOGIST.
## 3: || HYPERBCOS.
## 4: || ARCSINE.
## 5: || EXPON.
## 6: || SINUS.
::
Where the sinus (Xenakis' name) is in this implementation taken
as sampling from a third party oscillator. See example below.
argument::durdist
Choice of distribution for the perturbation of the current inter
control point duration.
argument::adparam
A parameter for the shape of the amplitude probability
distribution, requires values in the range 0.0001 to 1 (there are
safety checks in the code so don't worry too much if you want to
modulate!).
argument::ddparam
A parameter for the shape of the duration probability
distribution, requires values in the range 0.0001 to 1.
argument::minfreq
Minimum allowed frequency of oscillation for the Gendy1
oscillator, so gives the largest period the duration is allowed
to take on.
argument::maxfreq
Maximum allowed frequency of oscillation for the Gendy1
oscillator, so gives the smallest period the duration is allowed
to take on.
argument::ampscale
Normally 0.0 to 1.0, multiplier for the distribution's delta
value for amplitude. An ampscale of 1.0 allows the full range
of -1 to 1 for a change of amplitude.
argument::durscale
Normally 0.0 to 1.0, multiplier for the distribution's delta
value for duration. An ampscale of 1.0 allows the full range of
-1 to 1 for a change of duration.
argument::initCPs
Initialise the number of control points in the memory.
Xenakis specifies 12. There would be this number of control
points per cycle of the oscillator, though the oscillator's
period will constantly change due to the duration distribution.
argument::knum
Current number of utilised control points, allows modulation.
argument::a
Parameter for Lehmer random number generator perturbed by
Xenakis as in
code::
((old*a)+c)%1.0
::
argument::c
Parameter for Lehmer random number generator perturbed by
Xenakis.
argument::mul
Output will be multiplied by this value.
argument::add
This value will be added to the output.
discussion::
All parameters can be modulated at control rate except for code::initCPs:: which is used only at initialisation.
Examples::
warning::
if 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!
::
code::
//LOUD! defaults like a rougher Gendy1
{Pan2.ar(Gendy2.ar)}.play
//advantages of messing with the random number generation- causes periodicities
{Pan2.ar(Gendy2.ar(a:MouseX.kr(0.0,1.0),c:MouseY.kr(0.0,1.0)))}.play
(
{Pan2.ar(
Normalizer.ar(
RLPF.ar(
RLPF.ar(Gendy2.ar(a:SinOsc.kr(0.4,0,0.05,0.05),c:SinOsc.kr(0.3,0,0.1,0.5)),
MouseX.kr(10,10000,'exponential'),0.05),
MouseY.kr(10,10000,'exponential'),0.05)
,0.9)
,Lag.kr(LFNoise0.kr(1),0.5))}.play
)
{Pan2.ar(Gendy2.ar(3,5,1.0,1.0,50,1000,MouseX.kr(0.05,1),MouseY.kr(0.05,1),15, 0.05,0.51,mul:0.5))}.play
//play me
{Pan2.ar(RLPF.ar(Gendy2.ar(1,3,minfreq:20,maxfreq:MouseX.kr(100,1000),durscale:0.0,initCPs:4),500,0.3, 0.2),0.0)}.play
//1 CP = random noise effect
{Pan2.ar(Gendy2.ar(initCPs:1))}.play
//2 CPs = suddenly an oscillator (though a fast modulating one here)
{Pan2.ar(Gendy2.ar(initCPs:2))}.play
//used as an LFO
(
{Pan2.ar(SinOsc.ar(Gendy2.kr(2,1,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,mul:50, add:350), 0, 0.3), 0.0)}.play
)
//very angry wasp
{Pan2.ar(Gendy2.ar(0, 0, SinOsc.kr(0.1, 0, 0.1, 0.9),1.0, 50,1000, 1,0.005, 12, 12, 0.2,0.2,0.2), 0.0)}.play
//modulate distributions
//change of pitch as distributions change the duration structure and spectrum
{Pan2.ar(Gendy2.ar(MouseX.kr(0,7),MouseY.kr(0,7),mul:0.2), 0.0)}.play
//modulate num of CPs
{Pan2.ar(Gendy2.ar(knum:MouseX.kr(1,13),mul:0.2), 0.0)}.play
(//Gendy1 into Gendy2...with cartoon side effects
{Pan2.ar(Gendy2.ar(maxfreq:Gendy1.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
)
//use SINUS to track any oscillator and take CP positions from it, use adparam and ddparam as the inputs to sample
{Pan2.ar(Gendy2.ar(6,6,LFPulse.kr(100, 0, 0.4, 1.0), SinOsc.kr(30, 0, 0.5),mul:0.2), 0.0)}.play
(//try out near the corners especially
{Pan2.ar(Gendy2.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
)
//texture- the howling wind?
(
{
Mix.fill(10,{
var freq;
freq= rrand(130,160.3);
Pan2.ar(SinOsc.ar(Gendy2.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, 0.4.rand, 0.4.rand, 200, 400), 0, 0.1), 1.0.rand2)
});
}.play
)
//CAREFUL! mouse to far right causes explosion of sound
(
{Pan2.ar(
CombN.ar(
Resonz.ar(
Gendy2.ar(2,3,minfreq:1, maxfreq:MouseX.kr(10,700), initCPs:100),
MouseY.kr(50,1000), 0.1)
,0.1,0.1,5, 0.16
)
, 0.0)}.play
)
//storm
(
{
var n;
n=15;
0.5*Mix.fill(n,{
var freq, numcps;
freq= rrand(130,160.3);
numcps= rrand(2,20);
Pan2.ar(Gendy2.ar(6.rand,6.rand,10.0.rand,10.0.rand,freq,freq*exprand(1.0,2.0),
10.0.rand, 10.0.rand, numcps, SinOsc.kr(exprand(0.02,0.2), 0, numcps/2, numcps/2),
10.0.rand, 10.0.rand, 0.5/(n.sqrt)), 1.0.rand2)
});
}.play
)
//another traffic moment
(
{
var n;
n=10;
Resonz.ar(
Mix.fill(n,{
var freq, numcps;
freq= rrand(50,560.3);
numcps= rrand(2,20);
Pan2.ar(Gendy2.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)
})
,MouseX.kr(100,2000), MouseY.kr(0.01,1.0), 0.3)
;
}.play
)
::
|