Sound Design Toolkit  078
Physically informed sound synthesis for everyday sounds
SDTSolids.h: Registering/notifying resonators and interactors

Macros

#define SDT_MAX_MODES   16
 
#define SDT_MAX_PICKUPS   16
 
#define SDT_MAX_MODES   16
 
#define SDT_MAX_PICKUPS   16
 

Functions

int SDT_registerResonator (SDTResonator *x, char *key)
 Registers a resonator into the resonators list with a unique ID. If an interactor with the same ID is present, the resonator is bound to the interactor. More...
 
int SDT_unregisterResonator (char *key)
 Unregisters a resonator from the resonator list. If a resonator with the given ID is present, it is unregistered from the list. If also an interactor with the same ID is present, the object is released by the interactor as well. More...
 
int SDT_registerInteractor (SDTInteractor *x, char *key0, char *key1)
 Registers an interactor into the interactors list with two unique IDs, one for each resonator. If resonators with the same IDs are present, they are immediately bound to the interactor. More...
 
int SDT_unregisterInteractor (char *key0, char *key1)
 Unregisters an interactor from the interactors list. If an interactor with the given IDs is present, it is unregistered from the list. More...
 

Detailed Description

Bidirectional observer pattern, implementing a loose coupling between resonator and interactor objects. Particularly useful in patcher languages, where object instantiation is generally asynchronous.

Function Documentation

int SDT_registerInteractor ( SDTInteractor x,
char *  key0,
char *  key1 
)

Registers an interactor into the interactors list with two unique IDs, one for each resonator. If resonators with the same IDs are present, they are immediately bound to the interactor.

Parameters
[in]xResonator instance to register
[in]key0Unique ID of the first resonator
[in]key1Unique ID of the second resonator
int SDT_registerResonator ( SDTResonator x,
char *  key 
)

Registers a resonator into the resonators list with a unique ID. If an interactor with the same ID is present, the resonator is bound to the interactor.

Parameters
[in]xResonator instance to register
[in]keyUnique ID assigned to the resonator instance
int SDT_unregisterInteractor ( char *  key0,
char *  key1 
)

Unregisters an interactor from the interactors list. If an interactor with the given IDs is present, it is unregistered from the list.

Parameters
[in]key0Unique ID of the first resonator
[in]key1Unique ID of the second resonator
int SDT_unregisterResonator ( char *  key)

Unregisters a resonator from the resonator list. If a resonator with the given ID is present, it is unregistered from the list. If also an interactor with the same ID is present, the object is released by the interactor as well.

Parameters
[in]keyUnique ID of the resonator instance to unregister