How do I receive and use NoteOn messages from a midi device in MATLAB?
古いコメントを表示
I've been using MATLAB and Audio Toolbox to implement a program that reads notes in from 2 midi keyboards and loops a respective audio file of the note being played.
I'm using a seperate mididevice object for each keyboard and I'm able to see the midi messages being sent from both of these using midireceive(device).
I want to have a loop that receives midi messages continuously and when there's a NoteOn message (i.e. a key is pressed), I want a sound file to repeat until the NoteOff message (i.e. the note is released). I was thinking something along the lines of if message == noteOn and note == 60 then loop the note.
How do I take the NoteOn and NoteOff messages and the note value into variables to be used with an if statement like above? Thanks in advance and please don't hesitate to ask if you have any questions.
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Simulation, Tuning, and Visualization についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!