Sound Design Toolkit  078
Physically informed sound synthesis for everyday sounds
SDTResonators.h
1 
14 #ifndef SDT_RESONATORS_H
15 #define SDT_RESONATORS_H
16 
17 #ifdef __cplusplus
18 extern "C" {
19 #endif
20 
22 typedef struct SDTResonator SDTResonator;
23 
28 extern SDTResonator *SDTResonator_new(unsigned int nModes, unsigned int nPickups);
29 
32 extern void SDTResonator_free(SDTResonator *x);
33 
37 extern double SDTResonator_getPosition(SDTResonator *x, unsigned int pickup);
38 
42 extern double SDTResonator_getVelocity(SDTResonator *x, unsigned int pickup);
43 
47 
51 extern void SDTResonator_setPosition(SDTResonator *x, unsigned int pickup, double f);
52 
56 extern void SDTResonator_setVelocity(SDTResonator *x, unsigned int pickup, double f);
57 
61 extern void SDTResonator_setFrequency(SDTResonator *x, unsigned int mode, double f);
62 
66 extern void SDTResonator_setDecay(SDTResonator *x, unsigned int mode, double f);
67 
71 extern void SDTResonator_setWeight(SDTResonator *x, unsigned int mode, double f);
72 
77 extern void SDTResonator_setGain(SDTResonator *x, unsigned int pickup, unsigned int mode, double f);
78 
83 extern void SDTResonator_setFragmentSize(SDTResonator *x, double f);
84 
87 extern void SDTResonator_setActiveModes(SDTResonator *x, unsigned int i);
88 
95 extern void SDTResonator_applyForce(SDTResonator *x, unsigned int pickup, double f);
96 
101 extern double SDTResonator_computeEnergy(SDTResonator *x, unsigned int pickup, double f);
102 
107 extern void SDTResonator_dsp(SDTResonator *x);
108 
109 #ifdef __cplusplus
110 };
111 #endif
112 
113 #endif
114 
double SDTResonator_getVelocity(SDTResonator *x, unsigned int pickup)
Gets the velocity of the object at a given pickup point.
void SDTResonator_dsp(SDTResonator *x)
Signal processing routine. Call this function at sample rate to update the internal state of the reso...
void SDTResonator_setGain(SDTResonator *x, unsigned int pickup, unsigned int mode, double f)
Sets the pickup gain for a given mode and pickup.
void SDTResonator_setWeight(SDTResonator *x, unsigned int mode, double f)
Sets the weight for a given mode.
void SDTResonator_setFrequency(SDTResonator *x, unsigned int mode, double f)
Sets the resonant frequency for a given mode.
SDTResonator * SDTResonator_new(unsigned int nModes, unsigned int nPickups)
Object constructor.
void SDTResonator_setActiveModes(SDTResonator *x, unsigned int i)
Sets the number of active (actually computed) modes.
void SDTResonator_free(SDTResonator *x)
Object destructor.
void SDTResonator_setDecay(SDTResonator *x, unsigned int mode, double f)
Sets the decay for a given mode.
void SDTResonator_applyForce(SDTResonator *x, unsigned int pickup, double f)
Applies a force to the resonator at a given pickup point. The force is distributed across the modes a...
void SDTResonator_setPosition(SDTResonator *x, unsigned int pickup, double f)
Sets a modal displacement at a given pickup point.
double SDTResonator_getPosition(SDTResonator *x, unsigned int pickup)
Gets the displacement of the object at a given pickup point.
void SDTResonator_setFragmentSize(SDTResonator *x, double f)
Reduces the object into a smaller fragment. This paramenter influences various aspects of the object:...
int SDTResonator_getNPickups(SDTResonator *x)
Gets the number of pickup points.
struct SDTResonator SDTResonator
Opaque data structure representing a solid resonator object.
Definition: SDTResonators.h:22
void SDTResonator_setVelocity(SDTResonator *x, unsigned int pickup, double f)
Sets a modal velocity at a given pickup point.
double SDTResonator_computeEnergy(SDTResonator *x, unsigned int pickup, double f)
Computes the total energy of the object, after applying all acting forces.