public void Close() { if (is_port_open) { is_port_open = false; RtMidi.rtmidi_close_port(handle); } ReleaseDevice(); }