Round-off error in rateRange control in prefs window
Bug #533477 reported by
Sean M. Pappalardo
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Mixxx |
Invalid
|
Low
|
Sean M. Pappalardo |
Bug Description
While tuning a MIDI controller's pitch range LEDs, I discovered that the rateRange" control introduces round-off error somewhere. When I had the controller set the range from 0.01 through 0.05 it was fine, but 0.06 had a repeating decimal, causing the LED equals checks to be skipped. (I worked around it in the script by rounding off to two places, but this should probably be checked in the engine incase it's messing anything else up.)
Changed in mixxx: | |
assignee: | nobody → Pegasus (pegasus-renegadetech) |
importance: | Undecided → Low |
milestone: | none → 1.8.0 |
To post a comment you must log in.
I tried this out in my working copy of trunk.
This is the script snippet I added to midi-mapping- script. js:
var rateRanges = [0.3, 0.6, 0.7, 0.8, 0.9];
for (var i = 0; i < rateRanges.length; i++) { setValue( "[Channel1] ","rateRange" , rateRanges[i]); "rateRange= " + engine. getValue( "[Channel1] ","rateRange" ));
engine.
print(
}
And here is the results I got:
rateRange=0.3
rateRange=0.6
rateRange=0.7
rateRange=0.8
rateRange=0.9
I also added a slot hooked to rateRanges valueChanged signal and it spit this out:
Debug: [Main]: DEBUG VALUE: 0.3
Debug: [Main]: DEBUG VALUE: 0.6
Debug: [Main]: DEBUG VALUE: 0.7
Debug: [Main]: DEBUG VALUE: 0.8
Debug: [Main]: DEBUG VALUE: 0.9