public void SendNoteOn(Channel channel, Pitch pitch, int velocity) { var cmd = (int)ShortMsg.EncodeNoteOn(channel, pitch, velocity); Debug.LogFormat("SendNoteOn:{0},{1},{2}={3}", channel, pitch, velocity, cmd); m_jc.CallStatic("SendMsg", cmd); }
/// <summary> /// Send a MIDI note-on message. /// </summary> /// <param name="channel">MIDI channel.</param> /// <param name="noteId">Note ID / pitch.</param> /// <param name="velocity">Note velocity.</param> /// <exception cref="ArgumentOutOfRangeException">Channel, pitch, or velocity is out-of-range.</exception> /// <exception cref="InvalidOperationException">The device is not open.</exception> /// <exception cref="DeviceException">The message cannot be sent.</exception> public void SendNoteOn(Channel channel, int noteId, int velocity) { lock (_lockObj) { CheckOpen(); CheckReturnCode(Win32API.midiOutShortMsg(_handle, ShortMsg.EncodeNoteOn(channel, noteId, velocity))); } }