Generating Negative and Positive Numbers


    Oct 12 2021 | 11:11 am
    Hello,
    I'm trying to generate random numbers between -63 and 63, but can't work out how to adapt previous patches that have been submitted to the forum. Also, would it be possible to adapt the equation for variable arguments?
    Thank you

    • Oct 12 2021 | 11:36 am
      hello. something like that ?
    • Oct 12 2021 | 11:42 am
      Hello,
      Perfect.
      Thank you very much
    • Oct 12 2021 | 11:45 am
      you're welcome =)
    • Oct 12 2021 | 12:01 pm
      2000 > 110 :(
    • Oct 12 2021 | 9:03 pm
      [expr random(-63,63)]
      ;D
    • Oct 13 2021 | 8:52 am
      Hello,
      Thanks, also.
    • Oct 13 2021 | 9:19 am
      Hi Schlam,
      Thanks a lot for the patch yesterday. It works great, but at the risk of sounding stupid, could I ask a question about its operation, please. I understand the addition of +1 to create the correct number for random, but why is the range 128? Is it because -63 becomes the equivalent of 0?
      Thank you
    • Oct 13 2021 | 10:07 am
      hello, with 128, [random] will output randomned values from 0 to 127 with the [- 63] after, it will output from -63 to 64. yes, for your request, random "127" would be more appropriate and will really output from -63 to 63
    • Oct 13 2021 | 10:16 am
      Hello,
      Great. Thanks for clarifying.
    • Oct 13 2021 | 2:11 pm
      the principle of "offset". if you need to need to do something which only works in a certain number range, do e.g. +64, process, -64
    • Oct 13 2021 | 2:42 pm
      Hello,
      OK, thanks. I think I understand what you mean, but would it be possible to illustrate with a basic example using a couple of objects, just so I'm sure.
      Thank you