Hammer Methods

For a description of the Hammer device see section *. The following methods are available with a hammer.

    reset()
    drop()
    (<accessPoint>)
    (<instr>, <x>)
    (<instr>, <x>, <y>)
    setMass(<m>)
    setPosition(<p>)
    setInitVelocity(<v>)
    setGravity(<g>)
    setHeight(<h>)
    setDamping(<d>)
    setHardness(<h>)
    setMaxImpacts(<maxImpacts>)
    getMass()
    getPosition()
    getVelocity()
    getInitVelocity()
    getGravity()
    getHeight()
    getDamping()
    getHardness()
    numberOfImpacts()
    getMaxImpacts()

The reset method resets the hammer to its initial height and causes it to wait for a subsequent call to the drop method before the hammer will start falling and interacting with the instrument. As with the bow device there are three unnamed methods for specifying the access point with which the hammer will interact. The first expects an access point, the second an instrument name and a single x coordinate and the third an instrument name followed by an x and y coordinate.

The set... family of methods are used to set the various attributes of the hammer. Note that the setHeight method sets the height from which the hammer is dropped whereas the setPosition method sets the instantaneous height of the hammer. The setInitVelocity method sets the initial velocity of the hammer immediately after the drop method has been called. The setHardness method sets the strength of the spring which is used to simulate the elastic connection with the instrument. This is usually a value in the range [0..1] where 0 means the spring has no effect and 1 means that the spring has the same strength as the springs used in Tao's material. Values greater than 1 can also be used although this can lead to the model becoming unstable, due to the inherent limitations in modeling a continuous physical system using discrete time steps or ticks.


©1999,2000 Mark Pearson m.pearson@ukonline.co.uk April 30, 2000