sending MIDI data from VST to VST. Timing problem

Author
hq9000
Max Output Level: -90 dBFS
  • Total Posts : 20
  • Joined: 2008/04/08 02:02:36
  • Status: offline
2008/09/19 15:16:28 (permalink)

sending MIDI data from VST to VST. Timing problem

Hi all!

Really hope to get some assistance from you guys.
The thing is that I'm trying to program VST midi loopback plugin.
It is VST 2.4-based VSTi with 1 midi input and 1 midi output.
Essentially what it does is just duplicationg everything came from input into the output. Such a VST has very usefull (from my point) practical implication enabling you to easily control MORE THAN one softsynth by a single MIDI-track. It is very easy to echieve in Cubase that has MIDI send feature, but I see no way of doing this in Sonar (in a gracefull and convinient manner).

Basically, I have written it and it even seems to work, BUT i've discovered some timing-related problem. It is related to audio latency. I have a midi track which sends data to this loobback VST device. I also have one more MIDI track which has its input set to this VST and its output routed to some another softsynth.

The problem is that in this case I see delay between midi-notes and actual sound heard from this syntheser. The bigger audio latency of the project, the bigger delay is. I even suspect that this delay is equal to the latency setting.

I can understand why it is like this. In VST i send MIDI data back within processReplacing method. I can guess that for all the audio plugins this method is invoked in sone predefined sequence reflecting the current routing. So if I send some control data from one VSTi within this method - how can I rely on some other VSTi to react on it in the case this VSTi has already been given its CPU time chunk for this cycle (hope I explain clearly). So It looks pretty much the same as using some external midi-loopback device. What I want is to make this vstsynth react imidiately to the midi data, exactly like it is controlled directly from the midi track in a usual way.

So my quiestions to you guys are:
Is there any ways to avoid this delay?Maybe running this sendVstDataToHost(); from some another method (ProcessEvents()?)
#1

0 Replies Related Threads

    Jump to:
    © 2024 APG vNext Commercial Version 5.1