How to properly release a MIDI device object?

3 vues (au cours des 30 derniers jours)
Jonathan Sahar
Jonathan Sahar le 9 Nov 2022
Hi!
I'm using an external MIDI keyboard, which I'm accessing through
device = mididevice('Teensy MIDI');
after running my code, I can't rerun it without Matlab hanging, and I can't close Matlab since it hangs all the same, and I end up killing it.
I'm pretty sure it's due to the MIDI device not being properly released, combined with the code starting by calling
clear all
when I try to manually 'clear device' I get the same behavior.
I've tried 'release' as well, but to no avail...
Thanks!

Réponses (1)

Brandon Stevens
Brandon Stevens le 11 Nov 2022
There are a few ways you can 'release' a MIDI device depending on how you are using it in your code.
If you also use an audio device writer object when accesing your keyboard, you can use 'release' on that system object. For an example, check out the one on this page:
I would not expect just having a mididevice interface to cause MATLAB to hang.
If you have any follow-up questions, please reach out to MathWorks Technical Support

Catégories

En savoir plus sur Musical Instrument Digital Interface (MIDI) dans Help Center et File Exchange

Produits


Version

R2021b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by