Max Oepen
2016-12-30 22:43:28
I've come up with a set of rules that elegantly solves a multi-range challenge for a single knob (incoming/outgoing: B7 66 pp), but it shouldn't work:
uu=pp-64
if pp>63 then pp=uu
if pp<=63 then pp=pp*2
This outputs values from 0-127 for the incoming range of 0-63, and then again for 64-127. (I can explain later why I need this).
I had originally included the doubling of "uu" for values over 64 (uu=uu*2), because, mathematically, it should be required. See below:
uu=pp-64
uu=uu*2
if pp>63 then pp=uu
if pp<=63 then pp=pp*2
HOWEVER, if included, the translator will not work correctly. This suggests to me that the doubling of pp (as in "if pp<=63 then pp=pp*2") occurs even if the incoming value is >63, which according to the rules should not happen.
I have made sure no other translators are interfering, so I cannot not explain this.
Any of you hardcore coders can explain to me why this is? Or is it a bug??
uu=pp-64
if pp>63 then pp=uu
if pp<=63 then pp=pp*2
This outputs values from 0-127 for the incoming range of 0-63, and then again for 64-127. (I can explain later why I need this).
I had originally included the doubling of "uu" for values over 64 (uu=uu*2), because, mathematically, it should be required. See below:
uu=pp-64
uu=uu*2
if pp>63 then pp=uu
if pp<=63 then pp=pp*2
HOWEVER, if included, the translator will not work correctly. This suggests to me that the doubling of pp (as in "if pp<=63 then pp=pp*2") occurs even if the incoming value is >63, which according to the rules should not happen.
I have made sure no other translators are interfering, so I cannot not explain this.
Any of you hardcore coders can explain to me why this is? Or is it a bug??