I have been trying to trigger midi samples through a VirtualMidiDevice, and everything seems to be working fine and I can hear and record the midi notes, but the problem is that even though the midi notes are being recorded I cannot hear them while recording (I can hear them before and after recording). I am using Tracktion version 2.0. What am I doing wrong? I need to hear the midi notes being played back while recording.
engine->getDeviceManager().createVirtualMidiDevice ("Virtual");
for (auto mi : engine->getDeviceManager().midiInputs) {
if (mi->getDeviceType() == tracktion::MidiInputDevice::virtualMidiDevice) {
virtualMidiInput = mi;
virtualMidiInput->setEndToEndEnabled(true);
}
}
And when I create a track I do:
edit->getCurrentPlaybackContext()->getInputFor(virtualMidiInput)->setTargetTrack(*track, 0, true);
edit->getCurrentPlaybackContext()->getInputFor(virtualMidiInput)->setRecordingEnabled(*track, true);
And then I trigger midi messages like this:
virtualMidiInput->handleIncomingMidiMessage(noteOn);
In my recording function I do:
if (virtualMidiInput)
{
virtualMidiInput->setEndToEndEnabled(true);
}
edit->getTransport().record(true);
