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



  • 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.



  • 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)?


Log in to reply
 

13
Online

1.3k
Users

4.3k
Topics

38.6k
Posts