Skip to content

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

Notifications You must be signed in to change notification settings

natevw/midisocket

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 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

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 63.8%
  • HTML 30.1%
  • CSS 6.1%