Sound Design Toolkit  078
Physically informed sound synthesis for everyday sounds

Typedefs

typedef struct SDTInteractor SDTInteractor
 Opaque data structure representing the interactor interface.
 
typedef struct SDTInteractor SDTInteractor
 Opaque data structure representing the interactor interface.
 

Functions

void SDTInteractor_setFirstResonator (SDTInteractor *x, SDTResonator *p)
 Sets the pointer to the first interacting resonator. More...
 
void SDTInteractor_setSecondResonator (SDTInteractor *x, SDTResonator *p)
 Sets the pointer to the second interacting resonator. More...
 
void SDTInteractor_setFirstPoint (SDTInteractor *x, long l)
 Sets the contact point index for the first resonator. More...
 
void SDTInteractor_setSecondPoint (SDTInteractor *x, long l)
 Sets the contact point index for the second resonator. More...
 
double SDTInteractor_computeForce (SDTInteractor *x)
 Computes a force to apply to the contact points, based on the resonators' state at the chosen pickups.
 
void SDTInteractor_dsp (SDTInteractor *x, double f0, double v0, double s0, double f1, double v1, double s1, double *outs)
 Signal processing routine. Convenience method to compute the interaction force, apply it to the resonators and update their state. This method already calls the DSP routines of the two resonators, so be sure not to call them if you use this method. More...
 

Detailed Description

This abstract object acts as a generic interface implemented by all interactors. It contains two pointers to the interacting objects, information on the chosen contact points, and an algorithm that, after reading the state of the objects (displacement and velocity) at the specified contact points, accordingly computes a force to apply to those contact points. The generic interactor should never be directly instantiated, instead it should be obtained through the specific SDTImpact and SDTFriction constructors.

Function Documentation

void SDTInteractor_dsp ( SDTInteractor x,
double  f0,
double  v0,
double  s0,
double  f1,
double  v1,
double  s1,
double *  outs 
)

Signal processing routine. Convenience method to compute the interaction force, apply it to the resonators and update their state. This method already calls the DSP routines of the two resonators, so be sure not to call them if you use this method.

Parameters
[in]f0Applied force to the first resonator
[in]v0Applied velocity to the first resonator (resets position to 0, or to make contact with second object if present)
[in]s0Fragment size of the first resonator
[in]f1Applied force to the second resonator
[in]v1Applied velocity to the second resonator (resets position to 0, or to make contact with first object if present)
[in]s1Fragment size of the second resonator
[out]outsDisplacement of the resonators at their pickup points
void SDTInteractor_setFirstPoint ( SDTInteractor x,
long  l 
)

Sets the contact point index for the first resonator.

Parameters
[in]Numberof the first resonator pickup chosen for interaction
void SDTInteractor_setFirstResonator ( SDTInteractor x,
SDTResonator p 
)

Sets the pointer to the first interacting resonator.

Parameters
[in]pPointer to a SDTResonator instance
void SDTInteractor_setSecondPoint ( SDTInteractor x,
long  l 
)

Sets the contact point index for the second resonator.

Parameters
[in]Numberof the second resonator pickup chosen for interaction
void SDTInteractor_setSecondResonator ( SDTInteractor x,
SDTResonator p 
)

Sets the pointer to the second interacting resonator.

Parameters
[in]pPointer to a SDTResonator instance