async close() {

    // We close the port. This triggers a 'statechange' event which we listen to to re-trigger the
    // 'closed' event.
    if (this._midiOutput) {
      await this._midiOutput.close();
    } else {
      await Promise.resolve();
    }

  }
Closes the output connection. When an output is closed, it cannot be used to send MIDI messages
until the output is opened again by calling [`open()`]{@link #open}. You can check
the connection status by looking at the [`connection`]{@link #connection} property.

@returns {Promise<void>}