Closed robsmithrob closed 11 years ago
Many mathematic functions are already available. For example, try evaluating the following line in Sonic Pi: puts Math.sin 0.3
Scaling number ranges is just a case of passing a function over a series of elements. For example: [1,2,3,4,5].each{|e| e * 2}
. Take a look at something like: http://perl.about.com/od/rubytutorials/a/rubyeachloop.htm
Finally, if
and while
are available and you can do the kinds of things you might do with for
with other approaches.
`
In interpreting and translating data from one form to another it might be useful to have mathematical functions, that could scale number ranges for example, multiply, subtract etc... which got me thinking about things like 'if' 'while' and 'for' and creating variables which we know from other programming situations are these going to be part of Sonic Pi?