Engine.getHostBpm() doesn't work in a deferred script
benosterhouse last edited by
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.
Christoph Hart last edited by
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)?