Record MIDI from HostedDevice on track

I am running Tracktion inside of a plugin built as a standalone, I initialize the interface with the getHostedAudioDeviceInterface().

When I select the HostedMidiInput onto a track I can hear the notes I play live through the instrument plugin I load on the track. However, if I arm the track and press record there are no notes recorded inside the midi clip.

While debugging I realized the HostedMidiInputDeviceInstance overrides the startRecording() method to always return false. I guess there is a reason behind this but I am not quite sure how to achieve what I want to do.

I would like to use the physical MIDI device selected in my standalone wrapper and route it onto a track via the virtual midi device created by Tracktion. This works fine for live playback but the recording seems disabled.

If you just comment out that

bool startRecording() override              { return false; }

line, does recording work as expected? It seems like an error that was left in.

If I comment it out, it canā€™t build because of an ā€œabstract classā€ error.

I tried to copy the logic of the startRecording function from the ā€œVirtualMidiInputDeviceInstanceā€ class into the ā€œHostedMidiInputDeviceInstanceā€ it does now record some MIDI notes, but somehow record wrong data.

If I play a single short note multiple times it does record multiple notes lasting the whole duration of the clip and sometimes playing a chord will record only a single note in the clip.

So it is a bit better and very much looks like the default override is wrong, but I am not sure why the timing/content of the recorded data is wrong.

It sounds like the timestamps of the messages are incorrect.
Iā€™ll have to dig in to this a bit more but Iā€™m afraid Iā€™m tied up with some other Engine fixes at the moment. Iā€™ll get to it as soon as I can though.

1 Like