class:: Plorenz
summary:: lorenz 3D chaotic pattern
related:: Classes/LorenzTrig
categories:: Streams-Patterns-Events>Patterns>Random


Description::

Returns a stream that behaves like a strange attractor (x, y, z).

note::
Plorenz does not have a normalize argument (it does it automatically) because it was always returning nil even when a default value of true (or false) was given.  this may be a bug related to the number of arguments?
::

ClassMethods::

method::new


Examples::

code::
(
var a;
a = Plorenz(8, 20, 2.5, 0.02);
a.asStream.nextN(1000).flop.plot;	//note 3 channels
)

// sound example
(
SynthDef(\help_sinegrain2,
	{ arg out=0, freq=440, sustain=0.05, pan= 0;
	var env= EnvGen.ar(Env.perc(0.01, sustain, 0.2), doneAction:2);
	Out.ar(out, Pan2.ar(SinOsc.ar(freq, 0, env), pan));
}).add;
)

(
var a = Plorenz(10, 28, 2.667, 0.01, 0,09, 2.9, 24).asStream;
{
	loop {
		var x, y, z;
		#x, y, z = a.next;
		Synth(\help_sinegrain2, [\freq, x * 600 + 300, \pan, -1]);
		0.02.wait;
		Synth(\help_sinegrain2, [\freq, y * 600 + 300, \pan, 0]);
		0.02.wait;
		Synth(\help_sinegrain2, [\freq, z * 600 + 300, \pan, 1]);
		0.02.wait;
	}
}.fork;
)
::
