- MATLAB can send (and receive) MIDI messages. A good starting point is the documentation page MIDI Device Interface, which includes examples on how to use functions such as mididevice or midimsg.
- In general, MATLAB can host VST plugins directly via the function loadAudioPlugin. Subsequent calls to the process method of the returned externalAudioPlugin or externalAudioPluginSource object return buffers (aka frames, blocks) of output samples directly as MATLAB arrays. The page Host External Audio Plugins includes a lot more details and code examples.
- If the plugin is running in an DAW or other application external to MATLAB, the output is routed to the audio output of the application. An easy way to route that signal back into MATLAB is to install a virtual audio channel (e.g. this application - just an example, not an endorsement). That will create in your OS at least:
- A virtual audio output - use this to playback from your plugin-hosting application
- A virtual audio input (connected to the virtual output above) - read from this in MATLAB using an audioDeviceReader object using a simple for or while loop as described in this example and many others.