8

I have to write an application (like a step sequencer or arpeggiator) that sends MIDI note to a generic DAW , so I think that only way to implement such thing is to create a virtual MIDI device that should be recognised as a MIDI input/output interface by the OS.

I was wondering if this could be developed using Portmidi or if I need something more complicated.

OS X support is a must, Linux and Windows support is a nice to have.

CL.
  • 173,858
  • 17
  • 217
  • 259
Kill KRT
  • 1,101
  • 2
  • 17
  • 37
  • 1
    [Mido (in Python) can do this](https://mido.readthedocs.io/en/latest/intro.html#virtual-ports). It uses RtMidi. – Gallifreyan Mar 12 '18 at 20:46

2 Answers2

5

Portmidi's design is based on the Windows MIDI API, which does not allow applications to create virtual ports (without installing a separate driver).

On OS X, you can create a virtual port with MIDISourceCreate; on Linux, by creating a port with the (SUBS_)READ/WRITE flags.

If you want to use a portable library, try RtMidi, which supports virtual ports on all platforms that have them.

CL.
  • 173,858
  • 17
  • 217
  • 259
  • 3
    in case somebody doesn't know it, it's not possible to use rtMidi on windows to create virtual ports ( I didn't ) – laggyluk Jan 09 '17 at 17:34
0

For Windows, check out the virtual MIDI driver written by Tobias Erichsen. While he hasn't published the API, if you e-mail him he will work something out with you. It's very simple to work with and allows creation of MIDI ports directly from your application.

Brad
  • 159,648
  • 54
  • 349
  • 530