PortMidi.GetDeviceID
--------------------

Queries the ID of the device the stream is connected to.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [PortMidi](component_PortMidi.md) | [7.0](newinversion70.md) | ✅ Yes | ✅ Yes | ❌ No | ❌ No | ❌ No |

MBS( "PortMidi.GetDeviceID"; StreamRef ) 

**MBS**( **"PortMidi.GetDeviceID";** /\* Queries the ID of the device the stream is connected to. \*/  
**$StreamRef**) /\* The reference to the midi stream. You create those with [PortMidi.OpenInput](PortMidiOpenInput.md) or [PortMidi.OpenOutput](PortMidiOpenOutput.md) and finally close them with [PortMidi.Close](PortMidiClose.md).e.g. $stream \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| StreamRef | The reference to the midi stream. You create those with [PortMidi.OpenInput](PortMidiOpenInput.md) or [PortMidi.OpenOutput](PortMidiOpenOutput.md) and finally close them with [PortMidi.Close](PortMidiClose.md). | $stream |

### Result

Returns number or error.

### Description

Queries the ID of the device the stream is connected to.  
### See also

- [PortMidi.Close](PortMidiClose.md)
- [PortMidi.GetDeviceInfo](PortMidiGetDeviceInfo.md)
- [PortMidi.GetDeviceName](PortMidiGetDeviceName.md)
- [PortMidi.OpenInput](PortMidiOpenInput.md)
- [PortMidi.OpenOutput](PortMidiOpenOutput.md)

### Release notes

- **Version 7.0**
    - Added [PortMidi.TimeStamp](http://www.mbsplugins.eu/PortMidiTimeStamp.shtml), [PortMidi.GetDeviceID](http://www.mbsplugins.eu/PortMidiGetDeviceID.shtml) and [PortMidi.GetDeviceName](http://www.mbsplugins.eu/PortMidiGetDeviceName.shtml) functions.

### Blog Entries

- [MBS FileMaker Plugin, version 7.0pr1](https://www.mbsplugins.de/archive/2017-01-02/MBS_FileMaker_Plugin_version_7/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 29th December 2016 , last changed 2nd January 2017

  
[PortMidi.GetDefaultOutputDeviceID](PortMidiGetDefaultOutputDeviceID.md) - [PortMidi.GetDeviceInfo](PortMidiGetDeviceInfo.md)

[HTML Version](PortMidiGetDeviceID.shtml)