Midi inputs and channels vs tracks

I’m a bit struggling to understand how midi inputs work in relation with tracks in tracktion engine.

Based on the midi recording example and EngineHelpers.h it seems that each midi input is assigned to one track.
When we press record, it is the midi input that is armed, not the track itself.
So it seems each midi input is exclusive to one track, correct?
And in assigning the track, we don’t specify a midi channel.

However, I would like multiple tracks to monitor/record the same midi device but on different midi channels.
How would I go about this?

Aditionally to the input from the physical midi device, i would like to send notes from a juce::MidiKeyboardComponent to the currently selected track.

void InputDeviceInstance::setTargetTrack (AudioTrack&, int index, bool moveToTrack);

The track is what track you want the input to be on
Index is 0 - 3, each track has several input slots, so you can have multiple inputs to one track
If moveToTrack is true, then it clears the input on it’s current track and moves to new track, you should set to false to duplicate the input to several tracks
The midi filter is a property of the midi input. You would probably need to create several VirtualMidiInputDeviceInstance each on a different channel and then feed your one PhysicalMidiInputDeviceInstance into those virtuals.

You can call MidiInputDevice::handleIncomingMidiMessage from your GUI component.

Thanks for the fast response and I think I understand the basics now.

One more question, how do i connect a physical midi device to a virtual one ?
I’ve seen you mention it on the forum before but I don’t find a method on either to connect the two.