Pango Script "if / then"

Hi there,

is it possible to paste a if/then code for another action?
I want, when i rotate a encoder wheel that a button show a color in different % cases.

For example:
Encoder B0 30 XX -> Button 90 20 XX
Encoder = 0% -> Off
Encoder = 25% -> red
Encode = 50% -> yellow

thanks for your answers
 
I know an ugly way to do it... Sure wish I knew all the programming constructs and operators, etc available in pangoscript, is there a doc available that explains things like conditionals, etc?

Anyway, here's my ugly hack job, someone please come along and make it better so I can learn.

1. Create a Wheel in the universe and give it <somename>, set min value 0, max value 100

2. In the pangoscript section of the midi input settings for your encoder, add:
Code:
<universe>.<somename>.Value=extvalue(0,100)
3. Create a new pangoscript in the right side tab area like:
Code:
CodeName "mycode"
AutoStart
if (<universe>.<somename>.Value < 25) midiout 90 20 <off>
if ((<universe>.<somename>.Value >=25)  & (<universe>.<somename>.Value<50)) midiout 90 20 <red>
if (<universe>.<somename>.Value >= 50) midiout 90 20 <yellow>
restart
 
Thanks for your answer you are right vergy ugly :)
So you spoke, there are a documentation about pango script? do you mean the 2 site doc in the help topic? :D or a really help file...
 
Last edited:
I found another way :)

DmxOut 1, param(3)*2
if (param(3)*2 = 0) MidiOut 0x90, 0x00, 0x00
if (param(3)*2 > 1) MidiOut 0x90, 0x00, 0x40
 
Hey Rich,

Midi sends Channel Data from 1 to 127
DMX sends Chanel Data from 1 to 255

param(3)*2 use the third (3) byte of Midi multiplication with (2) = 254
so you can use 254 steps and not 127

this is good for dmx lamps which have a complex dmx table in one channnel
(RGB,Strobe,Macro,etc.)
 
Back
Top