protected override bool SendInternal(byte[] buffer, int count) { if (!IsConnected) { return(false); } if (!_outBuffer.Prepare(buffer, buffer.Length)) { return(false); } try { if (NativeMethods.midiOutLongMsg(_outDeviceHandle, _outBuffer.Ptr, MIDIHDR.Size) >= 0) { return(true); } } finally { _outBuffer.Unprepare(); } return(false); }