Gendy4

This is a cubic-interpolated version of Nick Collins's Gendy1 UGen. 

Class Methods

*ar(ampdist=1, durdist=1, adparam=1.0, ddparam=1.0, minfreq=20, maxfreq=1000, ampscale= 0.5, durscale=0.5, initCPs=12, knum=12, mul=1.0, add=0.0)

seeGendy1 for explanation of parameters

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!	

//defaults	
{Pan2.ar(Gendy4.ar)}.play

//wandering bass/ powerline
{Pan2.ar(Gendy4.ar(1,1,1.0,1.0,30,100,0.3,0.05,5))}.play

//play me	
{Pan2.ar(RLPF.ar(Gendy4.ar(2,3,minfreq:20, maxfreq:MouseX.kr(100,1000), durscale:0.0, initCPs:40), 500,0.3, 0.2), 0.0)}.play

//scream! - careful with your ears for this one!
(
{
var mx, my;

mx= MouseX.kr(220,440);
my= MouseY.kr(0.0,1.0);

Pan2.ar(Gendy4.ar(2,3,1,1,minfreq:mx, maxfreq:8*mx, ampscale:my, durscale:my, initCPs:7, mul:0.3), 0.0)}.play
)

//1 CP = random noise effect
{Pan2.ar(Gendy4.ar(initCPs:1))}.play

//2 CPs = suudenly an oscillator (though a fast modulating one here)
{Pan2.ar(Gendy4.ar(initCPs:2))}.play

//used as an LFO	
(
{Pan2.ar(SinOsc.ar(Gendy4.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
)
	
//wasp
{Pan2.ar(Gendy4.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

//modulate distributions
//change of pitch as distributions change the duration structure and spectrum
{Pan2.ar(Gendy4.ar(MouseX.kr(0,7),MouseY.kr(0,7),mul:0.2), 0.0)}.play

//modulate num of CPs
{Pan2.ar(Gendy4.ar(knum:MouseX.kr(1,13),mul:0.2), 0.0)}.play

//Gendy into Gendy...with cartoon side effects
{Pan2.ar(Gendy4.ar(maxfreq:Gendy4.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(Gendy4.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(Gendy4.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
(
{
Mix.fill(10,{
var freq;

freq= rrand(130,160.3);
Pan2.ar(SinOsc.ar(Gendy4.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)
});
}.play
)

//wahhhhhhhh- try durscale 10.0 and 0.0 too
(
{Pan2.ar(
CombN.ar(
Resonz.ar(
Gendy4.ar(2,3,minfreq:1, maxfreq:MouseX.kr(10,700), durscale:0.1, initCPs:10),
MouseY.kr(50,1000), 0.1)
,0.1,0.1,5, 0.6
)
, 0.0)}.play
)

//overkill
(
{
var n;
n=10;

Mix.fill(n,{
var freq, numcps;

freq= rrand(130,160.3);
numcps= rrand(2,20);
Pan2.ar(Gendy4.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)
});
}.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(Gendy4.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))
;
}.play
)

(
{
var n;
n=15;

Out.ar(0,
Resonz.ar(
Mix.fill(n,{
var freq, numcps;

freq= rrand(330,460.3);
numcps= rrand(2,20);
Pan2.ar(Gendy4.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)
})
,MouseX.kr(100,2000), MouseY.kr(0.01,1.0))
)

}.play;
)