C_COUNTER cannot count backwards…

Home Forums Products Vsig and Preset Development C_COUNTER cannot count backwards…

  • This topic is empty.
Viewing 3 reply threads
  • Author
    Posts
    • #106691
      jfcharles
      Member

      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.

    • #119609
      IDeangelis
      Member

      …just quickly off the top of my head…

      would using a control math module work, like C_SUBTRACT or C_MULTIPLY by -1?

      I

    • #119610
      jfcharles
      Member

      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 jfcharles2009

      Now, let's try and add a reset function to that. 

    • #119611
      jfcharles
      Member

      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

Viewing 3 reply threads
  • You must be logged in to reply to this topic.