Sync with DAW


I’ve made a midi player inside my plugin. It plays loops and plays fine for me.
But I have a problem with projects which have a tempo track.
Now I use timeInSeconds of AudioPlayHead::CurrentPositionInfo. But it works only with constant bpm.

Could you give me an idea of how can I sync it if the project has some tempo changes (tempo track)?

Thank you

This is a friendly reply (I am not snipping at you).

You need to provide more information as to exactly what it is you are doing in order to get anyone here to respond to your query.

First and foremost, what exactly is it that you are doing?

‘I’ve made a midi player inside my plugin’ is not very descriptive as there are many ways one can do this.

What are your ‘loops’? Are you playing a Midi file? Are you providing your own Midi?

I am not sure why Bpm is bothering you. If you are using juce::MidiMessage() and juce::MidiBuffer() then I would think your only concern would be the SampleNUmber (see juce::MidiBuffer::addEvent())

A better description of what you are doing would be most advantages for you,

1 Like

First thought that comes in mind is if the project has a midi tempo track/file, you could copy that to the track of your plugin. Then you can decode the incoming midi tempo changes and let those control your loops.