How can module code discover the host tempo?

Is there anything in incoming MIDI or in the Rack engine that reports the host tempo as a number?

Or can module code discover the tempo only by measuring the period of the incoming MIDI P24 clock?

Sorry - misread your post

Im not 100% sure, but I think its a case of measuring the period of the incoming MIDI P24 clock

nysthi Clock Multiplier

put the clock in CLK-IN

and use the 3 calculators (using the divider/multiplier)

1 Like

It looks as if that computes the tempo by measuring the period of the incoming clock. Is that right?

That may be the best I can do, but I was hoping for a direct indication of the host tempo.

The reason I want a direct indication is that (as far as I can tell) otherwise my module can’t learn the tempo until at least two rising edges have occurred.

Or am I missing something?

yes, measures time using differentials on pulses

the clock out 1 using the multiplier 0.0416 will give you the correct incoming tempo

Yep I think that’s the best you can do. One neat trick though is to store that tempo after the first start/stop. then the next time you can start at that tempo on the first pulse and then adjust if necessary (if BPM has changed).

I’m no C++ developer but I think it makes sense that it needs to work like this. Midi hardware communicates timing with clock pulses - it’s not like one piece of midi hardware just says to other bits of midi kit “Hey we’re at 130 bpm so generate your internal clock based on that”

I’m afraid…recently I searched the VCV API for the same purpose and I found no way to access the VST API.

So we have to rely on midi clock.

The thing I’m missing on using VCV as a VST is a song position pointer or MIDI Time Code.


That’s interesting. First thought is whether anyone has made a Silent Way-like MTC-to-audio VST that could get decoded by a module on the VCV VST side.

Sounds like a great feature request, too. I think if the VST API is going to remain closed, there’s probably a case for a few VCV VST-only modules that handle that kind of thing (rather than only passing ordinary MIDI from the DAW).

1 Like

It would be “easy” for VCV to expose the VST transport stuff to VCV plugins. VCV VST has full access to that, or course, and it could easily provide a way for modules to see that, too. Seems like a good feature request.