Hello. I have audio toolbox and I am trying to cause my Yamaha P120 digital piano to produce the sound of a key strike by sending a message from my laptop to the piano. My code, derived from the Matlab documentation, is:
%===get device information
%===choose the device
device=mididevice('USB Midi ')
%===choose the channel, note and velocity & make message
channel = 2;
note = 60;
velocity = 64;
msg = midimsg('NoteOn',channel,note,velocity)
%===send the message
%===turn note on
OnMsg = midimsg('NoteOn',channel,note,velocity);
OffMsg = midimsg('NoteOn',channel,note,0);
OnMsg.Timestamp = 1;
OffMsg.Timestamp = 1;
The response is:
MIDI devices available:
ID Direction Interface Name
0 output MMSystem 'Microsoft MIDI Mapper'
1 input MMSystem 'USB Midi '
2 output MMSystem 'Microsoft GS Wavetable Synth'
3 output MMSystem 'USB Midi '
mididevice connected to
Input: 'USB Midi ' (1)
Output: 'USB Midi ' (3)
NoteOn Channel: 2 Note: 60 Velocity: 64 Timestamp: 0 [ 91 3C 40 ]
I do not get a response from my piano. I may have problems setting up the piano but in the meantime, can you explain what the "channel" is? I have tried 1,2,3 but get nothing.
Also, I assume that "note" refers to the key number so that 49 would refer to A4.