TimerObject execution time-out error



  • @d-healey Complex interface and big DSP



  • @d-healey -- hmm OK but I also have a need to run a timer - and to stop it inside the timer and then calc a new "time" and restart the timer.. so simplified example:

    const var myTimer = Engine.createTimerObject();
    var kounter = 0;
    
    myTimer.setTimerCallback(function()
    {
        myTimer.stopTimer();    
    
        if (kounter == 0)
        {
           myTimer.startTimer(30);
           Console.print("short");
        }else{
            myTimer.startTimer(200);
            Console.print("Long");    
        }
        kounter = 1 - kounter;
    
    });
    myTimer.startTimer(30);
    

    How would you do this?



  • I still have the timer issue...
    I have a lead though!
    The panel can be hidden, and I know hidden panels are not repainted in the background and cause issues...
    Investigating...



  • @ustk said in TimerObject execution time-out error:

    @d-healey Complex interface and big DSP

    I haven't done any DSP stuff so this could be causing instability that I haven't experienced.

    @Lindon

    In you're example the timer effectively won't stop. So you might as well get rid of the .stopTimer() call. The call to startTimer() (inside the callback) will just change the timer's speed so should work how you want.



  • @d-healey said in TimerObject execution time-out error:

    @ustk said in TimerObject execution time-out error:

    @d-healey Complex interface and big DSP

    I haven't done any DSP stuff so this could be causing instability that I haven't experienced.

    @Lindon

    In you're example the timer effectively won't stop. So you might as well get rid of the .stopTimer() call. The call to startTimer() (inside the callback) will just change the timer's speed so should work how you want.

    --ohhhh. riiiight I didnt know I could effectively change the timer length without stopping it - great. Thanks.



  • Every time I have a project getting big, Hise behave strangely. I say strangely because it's not 100% the same issue all the time.

    One thing that might cause issues is the compile time-out which fires if you have a lot of stuff to do in the first onInit call. For example loading a lot of audio files might cause the time-out to fire, but if you compile it multiple times, it wents through.

    The default is 5 seconds, but you can raise that value if you run against that limit with bigger stuff in the HISE settings (search "Compile Timeout").



  • @Christoph-Hart Yep that's what I thought at first, so I set it to 10sec, but my compile time is about 2sec with the i7...
    It's like the scripts compile before the interface is done, because all the errors (in that case) are only "component not found" (sometimes 10-15 components)
    I got all scripts in external .js files (about 35 files). Maybe it can be related...

    Another thing, when I recompile (just F5) in the onInit script it generally works well. But if I'm in a subscript it's a crash 80% of the time (shift-F5 seems more stable though, because I guess it's more like an init sequence). So now I always keep a tab with the onInit opened and I try to compile in that tab even if I work somewhere else. Recompiling in the interface designer works too.



  • @Christoph-Hart It's weird, every now and then I get an execution time out from anywhere in the project. A loop in this script, a timer in that one, another loop somewhere else...

    Nothing is related, and it happens with no apparent reason, except that it's when I pass the mouse on a painted panel (a hover redraw the panel and the execution time out points to a loop in the paint routine)... I recompile, it's gone, and 5 minutes later I get another one somewhere else...

    Nothing should be twisted in the code, and everything works fine (parts of these scripts are several months old and I haven't modified them)

    If you want to test my project I can share the git with you (only if you're interested, I know you have bigger fish to fry 😉 )



  • I was thinking... In a panel constructor (same panel 4 times), I have a paint routine. In this paint routine, I have a loop (i goes up to 50) to paint a curve out of two values.

    The question is, what happens if another panel callback is called when the loop of the first one isn't yet done?
    I'm thinking of a leaking i



  • @ustk try defining i in each funciton

    local i;


Log in to reply
 

7
Online

621
Users

2.5k
Topics

20.2k
Posts