Hi everyone. Where might I find information about mathematic functions and methods, or more broadly, dealing with numeric values, in Sonic Pi?
For example, I’m looking to map incoming MIDI data (i.e., 0–127) onto a new range. In Max, I would do this by using the scale object. Additionally, how might I go about dealing with conversion, e.g., from float to integer?
Are you looking to do a linear mapping? If so, there’s no supported functionality built-into Sonic Pi at this stage (although this is planned for a future version). For now, this is how you might calculate a linear range mapping:
With respect to converting from float to integer - in which context are you trying to do this? You typically shouldn’t need to worry if something’s a float or an int…