Increasing button responsiveness time


#1

I am coding an app where a sound is looped as soon as the user presses a button. I used setTriggeredOnMouseDown(true), but still I have the feeling that the reaction of the button could be a lot faster.

Is there some way to do this? If yes, does it not consume too much CPU?


#2

No… there’s no way to do it any faster. It’ll already be calling your function directly from the mouse-down event!


#3

Hi,
Take a look at this thread, we had the same problem and what Tim here did is to compensate the latency.
So get the time of the orginal event and do some calcutalions to make up for the latency.
http://www.rawmaterialsoftware.com/juceforum/viewtopic.php?t=2706

Edwin


#4

You mean the latency of the soundcard? That one is not a problem, since I’ve got 4ms latency and the reaction time seems more like a “jitter” (sometimes it’s good, sometimes it’s worse). I think it’s just because my app uses waveform displays that are getting repainted every 20ms and since this is done in the message thread, I guess sometimes messages like mouse down messages just will have to wait to get executed. I don’t think that there’s a simple solution to this problem.


#5

But the timestamp on the mouse event is probably still accurate, even if the event itself gets delayed.