getPosition()->getbpm() always returning 1!

Hi,

I’m trying to make a plugin that requires syncronisation with the host. Obviously this requires knowing the bpm that the host is operating at. This is the logic that does that:


The DBG shows that this call is constantly returning 1, even when I change the internal bpm of Ableton.

Am I missing some special case to do with the Optional<> type?

Many thanks

It’s a wrapper for std::optional . Use hasFallback or how it’s called or point to it adding asterisk (*). Just remember you should check if it has value before pointing to it (or use the fallback)

you will only get the correct number if the host supports and only call it in the process block