This class provides utility methods to setup interactive musical environments using DIMPLE. It it useful to
Creates a new environment instance.
dimple |
Dimple instance to associate the environment with. |
An instance of InteractiveEnvironment.
The DIMPLE instance associated with this environment.
Gets/sets the creation function, which contains code to create the environment. It is automatically invoked each time the -create method is triggered. The DIMPLE instance is given as parameter.
Creates the environment. Therefore, a createFunction has to specified using -creationFunc. Furthermore, the object map (-objects) is initialized and the object Function (-objectFunc) is invoked for each object in the environment.
clear |
Specifies if the environment and the object map should be cleared before creating the environment. |
Enables collision detection and registers a callback function to be invoked for every collision.
callback |
Callback function to be invoked when a collision occurs. The following parameters are given:
|
Returns a map from object names (Symbols) to Dimple object instances.
Updates the object map.
Gets/sets a function which is invoked for each object in the environment. It receives a Dimple object as parameter.
Registers a callback function to track changes of an object's attribute.
object |
Object to track |
attribute |
Attribute to track, specified as Symbol (e.g. \position, \color) |
interval |
Interval (in milliseconds) for attribute updates |
callback |
Callback function which is invoked on every attribute update. It receives the following arguments:
|
Sonifies a moving object in the environment. Therefore a handler is automatically installed which updates the object's position regularly. A sound synthesis algorithm is specified in terms of a function which is installed as a Ndef.
object |
Object to be sonified. |
ndefFunc |
Sound synthesis algorithm, which is installed as Ndef. It receives the following parameters:
|
positionUpdateRate |
Position update interval (in milliseconds) |
Clears all objects in the environment as well as the object map.