First time here? Check out the FAQ!
x

Why does durationBetweenTriggers give a duration after the first trigger?

0 votes
46 views

If I want to time the duration between two button presses on the VCS is durationBetweenTriggers a good way of doing it? When I tried it, it gives a duration after the first buttonpress. Is there a neat way of preventing that?

 

Here I'm using durationBetweenTriggers in an STGC and pressing a !Record button.  I only want a duration after the second button press.

asked Aug 21 in Capytalk & Smalltalk by alan-jackson (Virtuoso) (11,600 points)

1 Answer

+1 vote

When !Record turns on the first time, it will give you the duration from the start of the Sound. Every subsequent time !Record turns on, it will give you the time since the previous time !Record turned on.

Here's one way to get the behavior you want:

(!Record countTriggers gt: 1) true: !Record durationBetweenTriggers false: 0

 

answered Aug 21 by ssc (Savant) (93,990 points)
fabulous thanks!
...