Show HN: Fourhands is a P2P MIDI jam room for pianists
fourhands.jminjie.comHey 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)
Would this be feasible as an instruction tool?
You might be interested in this YouTube channel https://youtube.com/c/paulwwells. The last series of videos is someone who created a remote piano teaching aid/device that does midi over ip https://plugandplink.com/.
There’s also a few YouTube content producers you could reach out to who might be interested as jamming in lockdown.
https://youtube.com/c/ColeLam, very talented young kid.
https://youtube.com/c/BrendanKavanaghDrK and https://youtube.com/user/pianoboogieking are two others.
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.
Awesome. I've been thinking a lot about a full DAW in this manner recently.
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!
https://www.multiplayerpiano.com/ is a similar one
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)
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?
Try making a new room, and also make sure there's only two clients in the room.
After months of really bad audio in teleconferencing calls, hearing crisp keyboard playback was a refreshing experience. Highly recommend to check out the demo!
Where is the demo please
Very cool! Any idea what the impact of network latencies and jitter is on the overall experience?
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.
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.
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.
neat idea-- i had never considered MIDI as a low-data transmission method for live jamming
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.
Done, good catch.
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!
Thanks for the share, have fixed.
Doesn't work on Firefox, says:
> No browser support for MIDI. Consider trying Chrome or Edge
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)
Awsome
This is awesome!