HISE Logo Forum
    • Categories
    • Register
    • Login

    Script Processor onTimer() Callback

    Scheduled Pinned Locked Moved General Questions
    3 Posts 2 Posters 171 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • P
      Phelan Kane
      last edited by

      Hiya All

      I am having a few problems triggering the onTimer() callback in a Script Processor. I want to use it to generate a counter running at 16th notes at the host's BPM, feed from the setOnGridChange callback.

      I am using a button in the main scripts Interface to trigger the onTimer() within the script processor's onInit().

      Everything works fine in HISE but it doesn't seem to work on compiled VST3's and AUs.

      Screen Shot 2024-09-10 at 21.54.14.png

      Screen Shot 2024-09-10 at 21.53.30.png

      Enable Sound Generators FX is active in the project settings.

      HISE 3.6.2. Mac OS 10.13.6. Yeah I'm old skool...

      Any advice? Thanks in advance.

      Phelan

      HiseSnippet 1796.3oc2XstbaSDEVJIpT6dmK+eICLi5LdbrCIkBYJjFmjVCMItXSgYXFJqkVauSj2UHspMtcxL8cf2JdZ3M.N6EYIYKmTRa3G3ejrWNW91y4rmyYUmHtGINlGYYWo2jPhk80c5NgIF0ZDlxrZuqk80b5QGSh5QhEV6LIDGGS7srsW9QRBrqrhk52e8s6fCvLOR1RVVOiS8HOgNlJxVsy1eOMHXerOQJ1r02X61dbVKd.OA.yxNMrBwdGiGRNDKIaIGK6qrmOUvi5JvBRrk8J6v8mzcD+kLM8OiFS6GPjSZZ0EDjd484A9RDKW0p0HZfemzCcrEHkNYlfk0lfO14.pOc55Ylhaq1.kwQd6g8REg2xEfWy7vqQN3UBjVJGjVQCo63z0KhFJx1Q6ZZyDjnAXvrmGJZZsV5OupSKNPASTeL9Xx9Qvjob3tdiF0Pvet6VUqBl9XA5E3HzL5oI5AHU.Q8gDQAyh6pyR5pfjxDTeACXzSJfTP.hnEebHmASbWMk.IaCC38wAnf9AcEjv16tXtxHon5f0eLOVrSmCNSdSooTlaG+CILFkM7bEQFkRAUcs0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rrodOqWR8Eilt6ad51iHzgix0b92rs07p9FFU+DbeRfRyW2IqKrb59M375tsQ2K67UynXXqAfwnK8U4rUaVP0WcQp9FN4pEjS2a+a40cOitSm+qkbRmyXbgwzG4LWxrEgr27KS8HxLbVWlv5lododfFWbLRpe5VNRZQtxlKhu6WWBzJCI3.5P1XEPthS.Yfv5s2MBtvyFZotwq4Hstxl3tjg0cjvx3COSnM0OdKMzL77N.u21278gytZyRe52erji9kGkT5H2iav995LJtqVBgPg3FnZx5LnRJ.WBCui0hkandogolLph9omp1WzUNJz.KzNbiFo8TbJRU1cF8zPqmLIwCMkf1pxYW8rL6wBJjtXKAzz9+kkTy5KMczmCOVXKT0pU.gDyCH0Cinvoyrszvo5t1jLuPOXlGG3ySf5p83cgtSXCS4DhLpeWUm2+unF9m3ThO78U4b6bodV4eIDf7ON1RkOIcPIYJtsC7p6j.rn3GqR9E5La.tmBoIjskyfWpLI+o681Wv5sEh2woCU3MpbLtTIXT9wwtDvn469cCm8FLf3Ix.3JN6+yWNejOqefmHf6SGfgqURm7gIi6xSh7HxG5wfGOH82KICj0yaj5+6RX9pI+M7yrYS4baylMS2zZL1Kh+bOc3u7KKdU0J.lXpOpZEmCjyQyEoaYMl5SetmWQQMGiqeQY7KtnLtwEkwMunLduKJie4Ekw6e9LJ+RrOLQvGqu1XYcPm8TYlrs0e5HUzp0+jM7smF
      
      A 1 Reply Last reply Reply Quote 0
      • A
        aaronventure @Phelan Kane
        last edited by

        @Phelan-Kane no idea why it wouldn't run in vst.

        Can you try and make a global variable for storing the steps and write to that, declare your label normally into a const, and use a UI timer to refresh the label instead? If you use a panel and a paint routine for the label, the panel comes with a built in timer that stops automatically when the UI is closed. if you want to use the label component and use a custom timer from the Timer class, you'll have to add a broadcaster that stops and starts it on UI close/open if you don't want it to run pointlessly in the back.

        When you run the timer, simply have it sendRepaintMessage() to the panel. If you start it at 1000/30, that's 30fps. (it's in ms instead of seconds).

        in your panel paint routine, simply draw the text and refer to the global variable for the value.

        Right now, your realtime timer is updating component properties even when the UI is closed, which is unnecessary. You're also doing some string operations in there. Try to keep these out of the audio thread.

        P 1 Reply Last reply Reply Quote 0
        • P
          Phelan Kane @aaronventure
          last edited by

          @aaronventure thank you.

          Some good advice there. After some tests the timers run successfully in a compiled plug if the script processor timer is triggered on by a note on. I guess the noteOn() callbacks work more systematically than the onInit() callback.

          You post was much appreciated.

          P

          1 Reply Last reply Reply Quote 1
          • First post
            Last post

          14

          Online

          1.7k

          Users

          11.8k

          Topics

          102.5k

          Posts