First time here? Check out the FAQ!

Why does durationBetweenTriggers give a duration after the first trigger?

0 votes

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, 2019 in Capytalk & Smalltalk by alan-jackson (Virtuoso) (13,570 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, 2019 by ssc (Savant) (107,900 points)
fabulous thanks!