Skip to content

A real-time music collaboration experiment with the Web MIDI API and WebSockets

License

Notifications You must be signed in to change notification settings

vine77/midisocket

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

midisocket

This project is an experiment in real-time music collaboration, leveraging the Web MIDI API and Web Audio API.

The stack uses WebSockets via Node.js to stream data from client to client. However, a faster P2P connection via WebRTC may be necessary (and is feasible now that Firefox and Chrome 31+ support SCTP-based reliable DataChannels[1]). The goal would be to reach a latency of less than 30ms, the bound of human perception.[2] Initial informal tests with WebSockets and Heroku do not meet this requirement due to latency and jitter, so stricter requirements may be necessary, e.g. WebRTC, low latency connections, P2P within a metropolitan area network or Internet2, etc.

  +---------------------------+    +--------------+    +---------------------------+
  |         Client 1          |    |    Server    |    |          Client 2         |
  |---------------------------|    |--------------|    |---------------------------|
  |  +-------------+          |    |              |    |  +--------+    +-------+  |
  |  | Web MIDI IN |------------------------------------->|  Soft  |--->|  DAC  |  |
  |  | Drum machine|   |      |    |              |    |  | synths |    |  OUT  |  |
  |  +-------------+   |      |    |              |    |  +--------+    +------ +  |
  |                    v      |    |  WebSockets  |    |      ^                    |
  |  +-------+    +--------+  |    |              |    |      |   +-------------+  |
  |  |  DAC  |<---|  Soft  |  |    |              |    |      |   | Web MIDI IN |  |
  |  |  OUT  |    | synths |<-------------------------------------|   Keyboard  |  |
  |  +-------+    +--------+  |    |              |    |          +-------------+  |
  +---------------------------+    +--------------+    +---------------------------+

Getting started

  1. Clone repository: git clone https://github.com/vine77/midisocket.git; cd midisocket;
  2. Install dependencies: npm install
  3. Start server: node server
  4. Plug in a MIDI controller
  5. Browse to http://localhost:5000 with Google Chrome

About

A real-time music collaboration experiment with the Web MIDI API and WebSockets

Resources

License

Stars

Watchers

Forks