How can I SEND midi commands from within Simulink?
Show older comments
Hi, how can I send MIDI commands from simulink simulation to a MIDI device?
I have no problem doing this in matlab to the target device but I can't seem to figure out how to properly call the commands for midisend, midimsg, etc. from simulink at all.
I basically want functionality that is reverse of the simulink block called "Midi Control" (this existing block reads in signals from external midi devices into Simulink. I want to SEND midi messages based on what happens in a simulink simulation).
Thanks,
Joel
Accepted Answer
More Answers (1)
Mark McBroom
on 4 Jan 2020
0 votes
The audio toolbox comes with Simulink blocks for midi send/receive.
Otherwise you will have to create custom block via:
- custom s-function
- MATLAB Function Block with coder.extrinsic() for midi functions
- MATLAB Function block with coder.ceval() to external midi APIs
3 Comments
Joel Gouker
on 5 Jan 2020
Mark McBroom
on 6 Jan 2020
Hi Joel,
The MIDI Controls block can be used to send initial values to the MIDI device by setting "MIDI Controls" to "Respond to specified controls" and then checking the "Send initial values to device at start" box. Are there scenarios other than start-up where you need to send MIDI commands?
Joel Gouker
on 6 Jan 2020
Categories
Find more on Simulation, Tuning, and Visualization in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!