This allows the loss coefficient of an individual mode to be altered dynamically.
The (set-mode-loss ... ) function can be called using the following Lisp syntax:
(set-mode-loss object_reference mode_number value)
or:
(set-mode-loss object_reference mode_number controller)
The (set-mode-loss ... ) function requires three arguments:
The mode-number must lie between zero and the number of modes in the object minus one.
This function is used to set the loss coefficient of a mode to a new value. The following example shows how you can use (get-info 'mode-loss ... ) to obtain the loss coefficient of a given mode, and then scale it dynamically using (set-mode-loss ... ):
(setq orig-loss-mode0 (get-info 'mode-loss my-string 0))
(setq loss-env-mode0 (make-controller 'envelope 1
(list (list 0 orig-loss-mode0)
(list 1 (* 0.5 orig-loss-mode0))
(list 2 orig-loss-mode0))))
(set-mode-loss my-string 0 loss-env-mode0)
This function is not yet implemented for Hybrids; an error message will be displayed if object is of hybrid type.
Modalys also has an older syntax for this function:
(set-mode-loss! object_reference mode_number value)
The older function basically did the same thing without the convenience of optionally using a controller), so any older Modalys scripts using it should be updated to use the new syntax (without the exclamation point).