Connecting via WebSockets

This mode is hidden by default in TouchDAW 1.6 and larger. If you do want to use it, go to Setup / Global / MIDI System, touch the 'Optional Transports' menu and check the box behind 'WebSockets'

WebSockets are a new feature in TouchDAW 1.5.1. At the time being it is best described as "experimental". The mnet driver provides a native implementation and WebSockets can be used to make a regular Android to PC MIDI connection, but the concept is probably more interesting for those interested in HTML5 / javascript and things like the WebMIDI and -Audio APIs.

WebSockets for normal TouchDAW use

Much like RTP channels, WebSocket channels primarily work over WIFI and can either be local servers or clients to remote servers. Equally they make themselves known to other peers via DNS. TouchDAW is preconfigured with two device local WebSocket sessions. If WebSocket servers are enabled in mnet / MIDIHub the Android device will pick them up and let you connect to them.

Connecting from PC to Android device
  1. To enable the app's local server channels, change TouchDAW's MIDI connection(s) to WIFI / WebSockets / Local Server.
  2. You should then see new channels appear in MIDIHub, following the same naming scheme used with RTP, namely: "tdaw (and_XX) WS 1 & 2". The XX will again be replaced with the last octet of the device's IP address.
  3. Drag a patchline to the MIDI port you want to receive MIDI on and the connection will be made.

The upper patched channel in the following screenshot shows such a channel. It represents TouchDAW's ("tdaw") first MIDI connection running on WebSockets ("WS 1") on an Android device with an IP address ending in .29 ("and_29").

Connecting from Android device to PC

The second patched channel in the above screenshot is the result of TouchDAW connecting to a WebSocket server run by the PC. To learn how to enable servers in mnet / MIDIHub see the mnet documentation. Same as with PC-side RTP sessions TouchDAW will detect such servers and let you select them for connection. On the right is a TouchDAW MIDI connection dialog showing a MIDIHub ("mhb") WebSocket session linked to port 3 ("WS 3") on a PC of mine. The computer's IP address is ending in .21 ("nilsi7_21"). After selecting it and confirming the selection the channel with the green name string will pop up in MIDIHub, readily linked to the MIDI port associated with the server (ie: 3).