"Unstable" value in phrase.shuffle

Steps to reproduce:

  1. Create two phrases in an instrument.
  2. Set the shuffle value in phrase 01 to 10%
  3. Do this in the terminal:
    renoise.song().selected_instrument:phrase(2).shuffle = renoise.song().selected_instrument:phrase(1).shuffle
  4. Phrase 01 will have shuffle value 10% while Phrase 02 will be set to 9% according to the GUI. Both should be 10%.

Edit:
Actually it’s enough to just do this:
renoise.song().selected_phrase.shuffle = renoise.song().selected_phrase.shuffle
The value will change from 10% to 9%.

I discovered it when trying to mirror parameters in phrases via observables. Will check if it’s easy to circumvent programatically by rounding.

Here’s a formula for fixing it. It actually seems to correct the decimals 100%, so maybe it should be implemented natively? Maybe there are more values in Renoise that are suffering from this “101 steps in 0-100 range” conondrum? … i think i remember there were some unstable floats someplace.

val = math.floor(val * 101) / 100
val = (val <= 1) and val or 1
1 Like

Shuffle internally is an integer with a range from 0 to 100, so this indeed needs some rounding to avoid changes on assignments like renoise.song().selected_phrase.shuffle = renoise.song().selected_phrase.shuffle.