class:: OteyPiano
summary:: Piano physical model.
categories:: UGens>PhysicalModels


Description::

Should not use this class but OteyPianoString instead (see example) for having only one soundboard for all strings which is more efficient.

Digital wave guide physical model of a piano wrapping the code provided by Clayton Otey.

It is important to release synth once finished because because it is CPU expensive.



Classmethods::

method::ar

argument::freq
Sound frequency.

argument::vel
Key pulsation velocity. Betwen 0 and 1.

argument::t_gate
Retriggers note, use a TriggerControl for not retriggering continuosly.


argument::rmin
minimum string radio

argument::rmax
maximun string radio

argument::rampl
radius left sigmoidal shape.

argument::rampr
radius right sigmoidal shape.

argument::rcore
cord nucleus radio.

argument::lmin
minimum string length.

argument::lmax
maximum string length.

argument::lampl
lenght left sigmoidal shape.

argument::lampr
lenght right sigmoidal shape.

argument::rho
string density multiplier.

argument::e
young modulus multiplier.

argument::zb
bridge impedance multiplier.

argument::zh
hammer impedance multiplier.

argument::mh
mass hammer multiplier.

argument::k
force hammer multiplier.

argument::alpha
hysteresys hammer multiplier.

argument::p
stiffness_exponent_hammer multiplier.

argument::hpos
hammer position. (0 to 1)

argument::loss
string loss factor. 

argument::detune
detuning among 3 strings.

argument::hammer_type
1 is Stulov model, 2 is Banks model.

Examples::

code::
(
x = {OteyPiano.ar(50,0.5)}.play;
)
x.free;

//Define piano synthdef
(
SynthDef(\help_oteypiano, { |out=0, freq=440,gate=1, amp=0.5,rho=1|
	var son = OteyPiano.ar(freq, amp, rho:rho)*EnvGen.ar(Env.asr(0,1,0.1),gate,doneAction:2);
	Out.ar(out, Pan2.ar(son * 0.1, LinLin.kr(freq,36.midicps,90.midicps,-0.75,0.75)));
}).add;
)

//Use it.
(
Pbind(
    \instrument, \help_oteypiano,
    \delta, 1,
    \dur, 3,
	\degree, Pseq([1,3,5], inf),
	\rho, Pwhite(0.1,3) //comment this line to get standard sound
).play;
)
::
