Home › Forums › Products › Vsig and Preset Development › C_COUNTER cannot count backwards…
- This topic is empty.
-
AuthorPosts
-
-
December 4, 2009 at 5:35 pm #106691jfcharlesMember
Hello,
It seems that the increment of a counter may not be set to a negative value. This is very unfortunate: makes it difficult to implement a "UP" and "DOWN" triggers to trigger the "previous" value in a STEXTKNOW, and not only the "next" one (for instance to add a "previous chord" button to factory preset 733).
Any workaround? Any pointer?
Thanks.
-
December 4, 2009 at 5:42 pm #119609IDeangelisMember
…just quickly off the top of my head…
would using a control math module work, like C_SUBTRACT or C_MULTIPLY by -1?
I
-
December 4, 2009 at 9:14 pm #119610jfcharlesMember
Well, yes, that means making your own counter, not using the COUNTER, like that:
HEADM adc 2 2 adc-null adc-null CounterWithAdder "" 3 count-obj up_trigger-obj down_trigger-obj ;=300,-25,100,0
TRIGGER up_trigger "" UP ;=100,0,100,0
TRIGGER down_trigger trigger DOWN ;=100,125,100,0
C_MULTIPLY c_multiply down_trigger-out -1 ;=250,125,100,0
C_ADDER c_adder1 2 up_trigger-out c_multiply-out ;=375,0,100,0
C_ADDER c_adder 2 c_adder1-out c_adder-out ;=600,0,100,0
MONITOR count c_adder-out "current count:%.f" count ;=825,0,100,0
TAIL jfcharles2009Now, let's try and add a reset function to that. -
December 4, 2009 at 11:23 pm #119611jfcharlesMember
Following up on my previous message (I see it hasn't been approved yet):
Here is the version with a reset trigger, if anybody is interested.
Jean-François.
HEADM adc 2 2 adc-null adc-null CounterTest "" 4 count-obj up_trigger-obj down_trigger-obj reset_trigger-obj ;=300,-25,100,0
TRIGGER up_trigger "" UP ;=100,0,100,0
TRIGGER down_trigger trigger DOWN ;=100,125,100,0
C_MULTIPLY c_multiply down_trigger-out -1 ;=250,125,100,0
C_ADDER c_adder1 2 up_trigger-out c_multiply-out ;=375,0,100,0
TRIGGER reset_trigger "" RESET ;=100,275,100,0
C_SWITCH c_switch 2 reset_trigger-out c_adder-out 0 ;=600,150,100,0
C_ADDER c_adder 2 c_adder1-out c_switch-out ;=600,0,100,0
MONITOR count c_adder-out "current count:%.f" count ;=825,0,100,0
TAIL jfcharles2009
-
-
AuthorPosts
- You must be logged in to reply to this topic.