[HN Gopher] Show HN: Fourhands is a P2P MIDI jam room for pianists
       ___________________________________________________________________
        
       Show HN: Fourhands is a P2P MIDI jam room for pianists
        
       Author : jm_l
       Score  : 45 points
       Date   : 2021-01-08 15:56 UTC (7 hours ago)
        
 (HTM) web link (fourhands.jminjie.com)
 (TXT) w3m dump (fourhands.jminjie.com)
        
       | tyingq wrote:
       | Very cool! Maybe add some blank space at the bottom of the page
       | so the "Buy me a coffee" graphic doesn't obscure the page text.
        
         | jm_l wrote:
         | Done, good catch.
        
       | arrakeen wrote:
       | neat idea-- i had never considered MIDI as a low-data
       | transmission method for live jamming
        
       | tekstar wrote:
       | I'm working in the same space, but it's a sequencer so only notes
       | entered into the DAW are shared amongst participants, and the
       | playhead isn't synced.
       | 
       | Still very early days but you can try it out at
       | https://sequencer.party - you can share session URLs with friends
       | and jam.
        
         | nwsm wrote:
         | Awesome. I've been thinking a lot about a full DAW in this
         | manner recently.
        
       | DoofusOfDeath wrote:
       | Very cool! Any idea what the impact of network latencies and
       | jitter is on the overall experience?
        
         | jm_l wrote:
         | Since webrtc uses UDP jitter is occasionally an issue. If you
         | monitor the ping on the site you'll likely see occasional jumps
         | to 100-200ms every once in a while. These can cause
         | irregularities in the rhythms but for the most part you can
         | still make out the phrase even when there's jitter. (I think
         | this is kind of like how we can read those scrambled word
         | sentences because we read not letter-by-letter, but word-by-
         | word.)
         | 
         | For a jitterlesss demo you can also check out piano.jminjie.com
         | (central server, not p2p), where I've introduced an artificial
         | delay so that the notes can be snet with timing info, and
         | scheduled ahead of time to avoid jitter.
         | 
         | Latency can also impede a smooth jamming experience, but seems
         | to be manageable in general when it's under 20ms one-way delay
         | (I have been able to achieve this on a wired connection at 50
         | miles distance in the middle of the day). There's also
         | relationship between bpm of the song and acceptable latency
         | similar to the concept behind sampling frequencies
         | (https://en.wikipedia.org/wiki/Sampling_(signal_processing)).
         | The faster you're playing, the more latency matters.
        
           | radiowave wrote:
           | Given that MIDI expects 100% reliable delivery, I'm curious
           | to know if there's any special technique used here to prevent
           | (e.g.) intermittent packet loss causing stuck notes.
        
             | jm_l wrote:
             | I'm not sending all the MIDI data, just a simple 3-integer
             | representation:
             | 
             | 1. command 2. note (or byte1) 3. velocity (or byte2)
             | 
             | From testing you don't tend to get stuck notes (though in
             | theory this could happen if a note-up command was lost
             | forever and never sent), though you do see some jitter.
        
       | ktzar wrote:
       | https://www.multiplayerpiano.com/ is a similar one
        
         | jm_l wrote:
         | This seems to be using a central server as a relay (which is
         | why they can have n participants). It works pretty well but the
         | latency tends to be too high to actually jam. (Similar to my
         | toy example at piano.jminjie.com)
        
       | onlinejk wrote:
       | Typo at the bottom: _achieved_ vice acheived.
       | 
       | (Feels petty, but was encouraged by your positive response to the
       | coffee icon recommendation.)
       | 
       | Sending this to my music buddy!
        
         | jm_l wrote:
         | Thanks for the share, have fixed.
        
       | quxpar wrote:
       | This is an exciting idea!
       | 
       | I seem to get a 'room is full' error when I try to connect
       | between my macbook and imac. Any tips?
        
         | jm_l wrote:
         | Try making a new room, and also make sure there's only two
         | clients in the room.
        
       | nikhilunni wrote:
       | This is awesome!
        
       | gnulinux wrote:
       | Doesn't work on Firefox, says:
       | 
       | > No browser support for MIDI. Consider trying Chrome or Edge
        
         | jm_l wrote:
         | Unfortunately Firefox does not support MIDI access
         | 
         | https://developer.mozilla.org/en-US/docs/Web/API/MIDIAccess
         | 
         | But you can try it out on Firefox using computer keyboard input
         | (letter keys ASDFGHJK)
        
       | jm_l wrote:
       | Hey all, I put this together over the holidays after initial
       | tests showed that delay around 10-20ms was achievable with
       | WebRTC. The jams are only 2 person and only MIDI, but for that
       | reason it's also fairly flexible and requires little set up
       | compared to other options (see
       | https://github.com/jminjie/fourhands for discussion on prior art)
        
       | yingw787 wrote:
       | After months of really bad audio in teleconferencing calls,
       | hearing crisp keyboard playback was a refreshing experience.
       | Highly recommend to check out the demo!
        
         | tsukurimashou wrote:
         | Where is the demo please
        
       | corytheboyd wrote:
       | Nice! Really similar to something I'm working on, though I am
       | targeting music lessons instead of jam sessions. I decided to add
       | delay to schedule note rendering as you mentioned you do for
       | another project of yours, since "near real time" has proven
       | useful enough for quick communication during lessons.
       | 
       | I think it's cool we had the same idea, very validating and p2p
       | is such an interesting technology to me!
        
       | vg2642119 wrote:
       | Awsome
        
       ___________________________________________________________________
       (page generated 2021-01-08 23:01 UTC)