HISE Logo Forum
    • Categories
    • Register
    • Login

    Engine.getHostBpm() doesn't work in a deferred script

    Scheduled Pinned Locked Moved Scripting
    2 Posts 2 Posters 230 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.
    • B
      benosterhouse
      last edited by

      Hi,
      I wanted to share something I just found out by a lot of trial and error:
      If you defer a script, Engine.getHostBpm() doesn't work!
      I tried this in both Reaper and FL Studio.

      I don't know how everything's working on the inside with communication between DAW and VST.
      Maybe somehow the host communicates it's tempo on the audio thread instead of the message thread.

      I couldn't find anything on the forum about this, so I thought I'd share it here in case anyone else runs into this.

      1 Reply Last reply Reply Quote 0
      • Christoph HartC
        Christoph Hart
        last edited by

        Hi Ben,

        that‘s rather surprising - the tempo gets detected in the audio thread but it will be stored and should be accessible from any thread.

        Can you use it in another function that is run on the UI thread? Eg. a panel paint routine (or a slider callback)?

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

        54

        Online

        1.7k

        Users

        11.7k

        Topics

        101.8k

        Posts