DoubleClick Calculation

Hello community!

I have a little question for you.
I receive an OSC message with a “bang” (Off to On), that’s like a click when you press your finger on a zone. I want to calculate the time between 2 clicks and if they are very near like a typical double click, I want to have a result = 1 if they are not near in time, my result must be = 0.

How could I do that? With Chop expression? I really don’t know hoe to use for example an “if” inside that node. Do you have another solution?

Nice day for everyone!
Nima

Hey Nima,

you could use a Count CHOP which is fed by the incoming osc channel. This will always count up when the “bang” is received. Now also connect a Trigger CHOP to the “bang” channel, set the parameters for Attack Length, Decay Length, Sustain Level and Release Length to 0. Also change the Peak Length to something small like 0.01 s.

Now set the Re-trigger Delay of the Trigger CHOP to the value that you think a second click would occur in (I choose 0.5 s) and connect the Trigger CHOP to the second input (Reset Input) of the Count CHOP.

When clicking once, the count will stay at 0 since it is being reset to 0 at the same time as you click. When double-clicking the re-trigger delay of the Trigger CHOP prevents it from going off and therefor prevents it from resetting the count — the Count CHOP goes to 1 and you know that the event happened twice.

Hope that helps
Markus

YESSSS Markus!!! Thank you a lot!!

It works so good! I made a .tox and i attached here :slight_smile:

Thanks again! Derivative staff… SO COOL!!! :smiley:
DOUBLEclickCalc.tox (1.12 KB)