A little issue with range, rounding and/or variables nodes

Moderator: Moderator Group

A little issue with range, rounding and/or variables nodes

Postby claude.rivet » Fri Jul 05, 2013 7:28 pm

I am programming a system where I play back videos via customscriptbuttons, the fade-in time is assigned via a midi fader. I use a range node to convert the 1-127 midi values into 1-5 values, then I pass that trough a round math node so I have no more than one decimal place and assign it to a "fadetime" variable. Then when I click the customscriptbutton it WDFadeToValue,1,fadetime,255 for example.

My issue is that it rounds the "fadetime" value to the nearest second, so if my "fadetime" variable is set a 0,5 it will CUT the video in, if it is set at 0,6 it will fade it in for 1 sec. I believe the problem lies in the way the range tool works vs how the script are written; in script time has to be expressed with a period as in 0.6 whereas the range node output 0,6. Does it makes sense? Is that really the issue? How can I correct this?
claude.rivet
 
Posts: 67
Joined: Tue Aug 07, 2012 5:40 pm

Re: A little issue with range, rounding and/or variables nod

Postby Dennis Kuypers » Mon Jul 08, 2013 10:13 am

Hi Claude,

What revision are you using? There was a fix around revision 399 that should stop this comma vs dot problem. Another reason might be that you are using a Integer variable that can not hold decimal places and will always give you a rounded value. In this case, try a VDouble.

Edit: Yes indeed revision 399:
Rev 399 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Bugfix
-cultureinfo changed to invariant culture, this should resolve all number conversions like german english "1.1" to "1,1"


Best regards
Dennis
Dennis Kuypers
(former Product Developer, Software)
Dennis Kuypers
coolux Germany
 
Posts: 771
Joined: Thu Jul 05, 2012 12:18 pm

Re: A little issue with range, rounding and/or variables nod

Postby claude.rivet » Mon Jul 08, 2013 2:41 pm

Using WD Pro 3.5 rev 249G

Not sure I'll be able to obtain a more recent version unless it's free so I will have to deal with the limitation. I am thinking of forming a string from the digits with a "." in the middle and then using VValue,fadetime,"string variable name", I'll post if I am ever successful.

Thanks for the help!
claude.rivet
 
Posts: 67
Joined: Tue Aug 07, 2012 5:40 pm

Re: A little issue with range, rounding and/or variables nod

Postby Dennis Kuypers » Tue Jul 09, 2013 9:30 am

Hi Claude,

Unfortunately revision 399 and upwards are Widget Designer 4 which can be bought as a upgrade for your existing Widget Designer 3.5

Since 0,6 is properly rounded to 1, can you check if you are using a integer variable? Sounds to me like the problem needn't be related to the comma-dot-conversion problem.

Best regards
Dennis
Dennis Kuypers
(former Product Developer, Software)
Dennis Kuypers
coolux Germany
 
Posts: 771
Joined: Thu Jul 05, 2012 12:18 pm

Re: A little issue with range, rounding and/or variables nod

Postby claude.rivet » Tue Jul 09, 2013 7:37 pm

aaannd it was an integer... sigh

Thanks, seems like my skull was numb when programming this :D
claude.rivet
 
Posts: 67
Joined: Tue Aug 07, 2012 5:40 pm


Return to Widget Designer V4.7

Who is online

Users browsing this forum: No registered users and 30 guests

cron