I’ve seen a few examples in the forums of people using an “On TimerTick” callback, but for the life of me I can’t find the documentation for it.
I’m sure I’m looking in the wrong place, but I am at Introduction to GPScript for Gig Performer 4 and I don’t get any search results for “TimerTick”, “timertick”, “timer”, or “tick”. I also scanned through the entire Callbacks chapter and didn’t find it.
Every cpu cycle counts, so yes. Furthermore I would keep the processing in the timer as little as needed. As far as I can see, gpscript runs on the gui-thread (@dhj will know for sure) and there is only one. But you should not have sleepless nights about it
I use it in a script and do quite some functionality inside, like checking peak values of sixteen channels and change widget properties based on it. Of course for a computer this is still not much.
Also the time is not exactly fifty seconds, as far as I can remember the time varies a lot.
You could also try to use a ramp callback which is more precise, but I haven’t tried that myself. This callback is useful when you need exact period callbacks.
@pianopaul provided an eloquent solution to solving the problem of setting a timer and then getting a callback when that timer goes off. I am thinking that people reading this thread would like to see his solution:
The only thing is that you are not satisfied with the TimerTick not being called every 10ms, but the solution you are trying to follow won’t necessary guaranty this. The MIDI note will indeed be sent after 10ms, but the MIDI callback need a little time to response to the MIDI event. The overall process will probably be close to 10ms, but no guaranty to have exactly 10ms.
That’s OK, because I can adjust the delay until I find the right combination. I am trying to catch a bunch of MIDI notes that are close together when they are played. If they are played within 10ms, I will consider them notes in a chord.