Access Point Methods

These methods are some of the most important since they are the ones which allow simulated physical interaction with Tao's cellular material.

    getPosition()
    getVelocity()
    getForce()
    getInstrument()
    applyForce(<force>)
    clear()   

The getPosition, getForce and getVelocity methods return the physical attributes of the material at the access point. All three values returned are with respect to the z axis of the material.

The getInstrument method returns the instrument on which the access point is operating.

The applyForce method applies the given force at the position of the access point, not surprisingly! Note that in the same way that an access point can be used to read the physical attributes of the material at any point, forces can be applied at any point too. This means that you could for example generate a moving access point whose instrument coordinates were governed by some time varying value generated by an arbitrary expression, and apply a time varying force at that moving point.

The following example illustrates the use of the access point methods (although I don't know whether it would produce interesting sounds or not).

    Audio rate: 44100;
    
    String s(200 Hz, 20 secs);
    AccessPoint p1, p2;
    Param x1, x2;
    
    Init:
        s.lockEnds();
        ...
    
    Score 10 secs:
        x1=0.5+0.5*cos(Time*1000.0);
        x2=0.5+0.5*cos(Time*1100.0);
        p1=s(x1);
        p2=s(x2);
        
        Every 0.01 secs:
            Print "At time ", Time, ", position=", p1.getPosition(), 
                  " velocity=", p1.getVelocity(),  newline;
            ...
    
        If p1.getForce() < 1:
            p2.applyForce(1.0);
            ...
        If p2.getVelocity() > -1:
            p1.applyForce(-1.0);
            ...
        ...

Finally, the clear method resets the access point to be null. Attempting to read any physical attributes off of the access point will result in zero being returned. In addition, attempting to apply a force to a null access point has no effect.


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