SuperCollider CLASSES (extension)

OteyPiano
ExtensionExtension

Piano physical model.
Inherits from: UGen : AbstractFunction : Object

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.

Class Methods

*ar (freq: 440, vel: 1, t_gate: 0, rmin: 0.35, rmax: 2, rampl: 4, rampr: 8, rcore: 1, lmin: 0.07, lmax: 1.4, lampl: -4, lampr: 4, rho: 1, e: 1, zb: 1, zh: 0, mh: 1, k: 0.2, alpha: 1, p: 1, hpos: 0.142, loss: 1, detune: 0.0003, hammer_type: 1)

Arguments:

freq

Sound frequency.

vel

Key pulsation velocity. Betwen 0 and 1.

t_gate

Retriggers note, use a TriggerControl for not retriggering continuosly.

rmin

minimum string radio

rmax

maximun string radio

rampl

radius left sigmoidal shape.

rampr

radius right sigmoidal shape.

rcore

cord nucleus radio.

lmin

minimum string length.

lmax

maximum string length.

lampl

lenght left sigmoidal shape.

lampr

lenght right sigmoidal shape.

rho

string density multiplier.

e

young modulus multiplier.

zb

bridge impedance multiplier.

zh

hammer impedance multiplier.

mh

mass hammer multiplier.

k

force hammer multiplier.

alpha

hysteresys hammer multiplier.

p

stiffness_exponent_hammer multiplier.

hpos

hammer position. (0 to 1)

loss

string loss factor.

detune

detuning among 3 strings.

hammer_type

1 is Stulov model, 2 is Banks model.

Inherited class methods

Instance Methods

Inherited instance methods

Examples

(
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;
)