# Bucket Brigade Singing

For the past several months, some friends and I have been working on a project for singing together over the internet ( [previously](https://www.jefftk.com/p/effect-of-numpy), [previously](https://www.jefftk.com/p/evaluating-opus), [originally](https://www.jefftk.com/p/series-singing)). It's still not done, but this weekend a friend hosted a singing party on it and it went well. If you're interested in playing with it, you're welcome to [try it out](https://echo.jefftk.com). There's only one shared instance, and if you want to host something you can book time on it by sending a calendar invitation to `gsc268k1lu78lbvfbhphdr0cs4@group.calendar.google.com`. If you run into any problems, please [file a bug](https://github.com/gwillen/solstice-audio-test/issues/new).

Unfortunately it currently only works in the Blink-based browsers: Chrome, new Edge, Brave, Opera, etc. It depends on two new browser features that other browser engines are [working](https://bugzilla.mozilla.org/show_bug.cgi?id=1540913) on [adding](https://bugs.webkit.org/show_bug.cgi?id=182506) but haven't added yet.

When you first visit the page it will as permission to use your microphone: [![](https://www.jefftk.com/echo-demo-1-mic-request.png)](https://www.jefftk.com/echo-demo-1-mic-request-big.png)

If there is currently an event scheduled, it will tell you. Everything is honor system right now; please don't mess up anyone else's events.

[![](https://www.jefftk.com/echo-demo-1-initial-view.png)](https://www.jefftk.com/echo-demo-1-initial-view-big.png)

It will ask some clarifying questions, and encourage you to use wired headphones. Wireless has inconsistent latency, and the system is dependent on latency staying absolutely constant, while when you don't use headphones feedback (though not the squealy kind) can be a problem.

[![](https://www.jefftk.com/echo-demo-3-asks-about-headphones.png)](https://www.jefftk.com/echo-demo-3-asks-about-headphones-big.png)

It asks you for your name; this is honor system as well. No accounts yet:

[![](https://www.jefftk.com/echo-demo-4-asks-for-name.png)](https://www.jefftk.com/echo-demo-4-asks-for-name-big.png)

It also asks you to choose your input device. Typically starting with the default is a good approach, and then only coming back here if there's a problem.

[![](https://www.jefftk.com/echo-demo-5-choose-input-device.png)](https://www.jefftk.com/echo-demo-5-choose-input-device-big.png)

In order to perfectly line up everybody's voice with everyone else, it needs to know how much time there is from (a) when it asks the browser to send audio out to your speakers or headphones until (b) when it receives audio back in from your microphone. The time from (a) to (b) depends on your audio hardware, your computer, and isn't even always consistent if you refresh the page. Worse, we can't just ask the browser how long this latency is, all we can do is measure it. We send a series of beeps out the speaker/headphones and time how long it takes until they come back in the microphone.

[![](https://www.jefftk.com/echo-demo-6-calibrate-latency.png)](https://www.jefftk.com/echo-demo-6-calibrate-latency-big.png)

There's also the problem that not everyone has a setup where their computer will detect them as singing at the same volume. Some people have a microphone right up by their face, other people have won several feet away. In a video call it typically sets your volume automatically, but if we use that algorithm, built into the browser, it will do things like slowly turn your volume down as you hold a long loud note. Instead, we ask everyone to sing a little bit so we can set a level for them.

[![](https://www.jefftk.com/echo-demo-7-calibrate-volume.png)](https://www.jefftk.com/echo-demo-7-calibrate-volume-big.png)

Once you're fully calibrated, you can see who else is on the system and choose to lead a song or sing along. There's also a rudimentary chat system so you can coordinate with others.

[![](https://www.jefftk.com/echo-demo-8-loaded.png)](https://www.jefftk.com/echo-demo-8-loaded-big.png)

Glenn, Taymon, and I have worked hard on this, and [feedback](https://github.com/gwillen/solstice-audio-test/issues/new) is most welcome! It's also open source, if you'd like to [look at the code](https://github.com/gwillen/solstice-audio-test).