Go Back   Cockos Incorporated Forums > REAPER Forums > REAPER Bug Reports

Reply
 
Thread Tools Display Modes
Old 04-07-2024, 04:01 PM   #1
Daimebag
Human being with feelings
 
Join Date: May 2014
Location: France
Posts: 29
Default Inverted Normalized Values with ReaSurround Cockos and Reaper API?

Hi, I am trying to fix an issue with Reaper API in Lua and I think there is a potential Issue with Min and Max Values inverted in my example with ReaSurround Pan and the param "scene X":

I am using W11 Pro 23H2 and Reaper v7.12.

Here is the an example of the output in my console:
> reaper.TrackFX_GetParamName(tr, 0, 3)
{true, "scene X"}
> reaper.TrackFX_GetParamEx(tr, 0, 3)
{1.0, 1.0, 0.0, 0.5}
> reaper.TrackFX_GetParamNormalized(tr, 0, 3)
0.0
> reaper.TrackFX_SetParamNormalized(tr, 0, 3, 1)
true
> reaper.TrackFX_GetParamNormalized(tr, 0, 3)
0.0
> reaper.TrackFX_SetParamNormalized(tr, 0, 3, 0)
true
> reaper.TrackFX_GetParamNormalized(tr, 0, 3)
1.0
Attached Images
File Type: png Screenshot 2024-04-08 005545.png (16.0 KB, 55 views)
Daimebag is offline   Reply With Quote
Old 04-08-2024, 02:43 AM   #2
Daimebag
Human being with feelings
 
Join Date: May 2014
Location: France
Posts: 29
Default

I think the issue is at SetParamNormalized which doesnt handle rare case of params which have a minValue >= to maxValue.
Daimebag is offline   Reply With Quote
Old 04-08-2024, 04:13 AM   #3
schwa
Administrator
 
schwa's Avatar
 
Join Date: Mar 2007
Location: NY
Posts: 15,910
Default

The 'scene X' parameter in ReaSurroundPan is inverted, as you noticed, in order to match the convention with track pan where positive values mean pan left and negative values mean pan right.

For consistency with other functions I'm not sure whether it's better to fix SetParamNormalized() or GetParamNormalized(), but they do need to be consistent, so we will fix that, thanks for the report.

Last edited by schwa; 04-08-2024 at 04:43 AM.
schwa is offline   Reply With Quote
Old 04-08-2024, 04:56 AM   #4
ScuzzyEye
Human being with feelings
 
ScuzzyEye's Avatar
 
Join Date: Apr 2021
Posts: 564
Default

Heh, think I just ran into this myself yesterday with my very first time writing code to interface with Reaper.

I'll be following along to see which solution is chosen to see if I need to remove a '-' from my code or not.
ScuzzyEye is offline   Reply With Quote
Old 04-08-2024, 02:42 PM   #5
Daimebag
Human being with feelings
 
Join Date: May 2014
Location: France
Posts: 29
Default

Quote:
Originally Posted by schwa View Post
The 'scene X' parameter in ReaSurroundPan is inverted, as you noticed, in order to match the convention with track pan where positive values mean pan left and negative values mean pan right.

For consistency with other functions I'm not sure whether it's better to fix SetParamNormalized() or GetParamNormalized(), but they do need to be consistent, so we will fix that, thanks for the report.
Ok I thought the purpose of normalized values was to having always a value range with minVal = 0.0 and maxVal = 1.0 but it could be inverted for cases like scene X in Reasurround?
Daimebag is offline   Reply With Quote
Old 04-11-2024, 02:21 AM   #6
Buy One
Human being with feelings
 
Buy One's Avatar
 
Join Date: Sep 2019
Posts: 1,151
Default

Quote:
Originally Posted by schwa View Post
the convention with track pan where positive values mean pan left and negative values mean pan right.
Interesting perspective, i've always thought that the the position in the stereo field was relative to the listener facing the source rather than the player facing the listener. And this is born out in the track pan behavior, when the UI shows X%L the value returned by the Info_Value function is negative and when it shows X%R the value is positive
Buy One is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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