Damping Parts of an Instrument
A number of methods are provided for damping parts of an instrument.
These include:
setDamping(<d>)
setDamping(<x>,<d>)
setDamping(<x>,<y>,<d>)
setDamping(<x1>,<x2>,<y1>,<y2>,<d>)
resetDamping()
resetDamping(<x>)
resetDamping(<x>,<y>)
resetDamping(<x1>,<x2>,<y1>,<y2>)
In each case the argument <d> is a floating point value in
the range [0..1], where 0 represents no damping at all and 1 means that
the portion of material affected will be locked rigidly in a fixed
position. The progression from the former state to the latter as
<d> changes from 0 to 1 is logarithmic rather than linear
for reasons which are explained below.
The damping value <d> is converted via the following formula
into the appropriate velocityMultiplier attribute (see section
*):
vm = 1 - (10000d)/(10000)
where vm and d correspond to velocityMultiplier and
<d> respectively.
You may remember that the velocityMultiplier value also lies in the
range [0..1] and on each tick of the synthesis engine the velocity of
each cell is multiplied by this value.
The resetDamping family of methods set the damping back to what
it was when the instrument was created. This is useful for situations
where it is desirable to temporarily damp a region. An example application
might be playing a harmonic on a string. Any guitarist will know that
in order to do so a finger is placed momentarily in contact with one of
the strings, over a node, whilst (or after) the string is plucked. Once
the harmonic begins to clearly ring out the players finger is removed
again leaving the string to continue vibrating in its modified pattern.
|