Go Back   Cockos Incorporated Forums > Projects > Deprecated REAPER issue tracker > Closed Issue

JS float-int conversion in REAPER v4.261 Issue Tools
issueid=4368 09-21-2012 08:23 AM
Human being with feelings
JS float-int conversion in REAPER v4.261
Behaviour differs for envelope and manual control: JS rounds (enveloped) or truncates (manual) for integer-based logical operators on values derived from sliders.

Please see the JS "effect" code below, a demo extracted from a bigger plugin.

Float value x (>=0) is derived from a control slider. The plugin also needs the integer part of x, either from rounding or from truncation.
BUT
under manual mousing of the slider, logical operators TRUNCATE to give the integer
AND
under envelope automation of the slider, logical operators ROUND to give the integer
for exactly the same plugin code.
Behaviour should be exactly the same in both cases?
There's no simple workaround (?) that make manual and automation work mutually consistently.


// A dummy JS patch to show float - integer conversion weirdness.

slider1:0<0,10,0.001>control "s"
slider2:0<0,10,0.001>derived "x"
slider3:0<0,10,0.001>integer "x_int"
slider4:0<0,10,0.001>different "x_int2"

@slider
// Compare: slider1 manually controlled vs slider1 under envelope control.

s = slider1;
x = s * 2; // x is a derived value, not even directly controlled,
slider2 = x;

x_int = x << 0; // yet this step TRUNCATES for manual control, and ROUNDS for envelope control!
slider3 = x_int;

x_int2 = x & 9999999; // another way of getting an int value: same problem
slider4 = x_int2;
Issue Details
Issue Type Closed Issue
Project Deprecated REAPER issue tracker
Category Plugins
Status Fixed
Priority 3
Affected Version 4.26
Closed Version 4.33
Yes votes 0
No votes 0
Assigned Users (none)
Tags (none)

04-08-2013 08:14 PM
Administrator
 
This should be fixed in 4.33pre24+, thanks.
Reply
Reply

Issue Tools
Subscribe to this issue

All times are GMT -7. The time now is 12:25 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.