OpenMusic Reference
om-scale/sum

om-scale/sum
(arithmetic module) -- scales a list based on a new sum
Syntax
om-scale/sum self sum
Inputs
| name | data type(s) | comments |
|---|---|---|
| self | a tree | the list to be scaled |
| sum | a number | the target sum of the rescaled list |
Output
| output | data type(s) | comments |
|---|---|---|
| first | a tree | returns the tree self , rescaled |
Description
This function scales the values of elements in a list. The values of self are recalculated such that they add up to sum while keeping their relative sizes intact.
If self is a nested list, a tree of identical dimensions is returned
Trees can also be rescaled with the om-scale function.
| Prev | Home | Next |
|---|---|---|
| om-scale | Up | omif |