tf = hasdata(device)
returns logical 1 (true) if there is data
available to read from the mididevice specified by
device. Otherwise, it returns logical 0
(false).
Create a mididevice object to interface with your MIDI device. Query your system for available MIDI devices.
mididevinfo
MIDI devices available:
ID Direction Interface Name
0 output MMSystem 'Microsoft MIDI Mapper'
1 input MMSystem 'nanoKONTROL2'
2 input MMSystem 'USB Uno MIDI Interface'
3 output MMSystem 'Microsoft GS Wavetable Synth'
4 output MMSystem 'nanoKONTROL2'
5 output MMSystem 'USB Uno MIDI Interface'
device = mididevice('USB Uno MIDI Interface')
device =
mididevice connected to
Input: 'USB Uno MIDI Interface' (2)
Output: 'USB Uno MIDI Interface' (5)
As soon as your mididevice object is created, it begins listening for MIDI messages and storing them in a buffer. When you call midireceive, MIDI messages are retrieved from the buffer and returned. You can use hasdata to query whether your mididevice object buffer contains unread MIDI messages.
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window.
Web browsers do not support MATLAB commands.
Website auswählen
Wählen Sie eine Website aus, um übersetzte Inhalte (sofern verfügbar) sowie lokale Veranstaltungen und Angebote anzuzeigen. Auf der Grundlage Ihres Standorts empfehlen wir Ihnen die folgende Auswahl: .
Sie können auch eine Website aus der folgenden Liste auswählen:
So erhalten Sie die bestmögliche Leistung auf der Website
Wählen Sie für die bestmögliche Website-Leistung die Website für China (auf Chinesisch oder Englisch). Andere landesspezifische Websites von MathWorks sind für Besuche von Ihrem Standort aus nicht optimiert.