User:Swivelbar/sandbox

FarPlay is peer-to-peer networked music performance software that enables live rehearsing, jamming, performing, and teaching with musicians over the internet as though in the same room. FarPlay is written by Anton Runov, Dan Tepfer, and contributors using C++. The Software is based on the Qt framework and uses the UDP protocol to send uncompressed PCM audio and compressed video.

FarPlay is available free and with paid subscriptions. Free mode can be used without an account. A subscription is required to create sessions of unlimited length without limits on the numbers of participants.

Latency
The time between the moment one musician makes a sound and the moment another hears it is called latency. It’s been established that musicians start to notice latency when it exceeds 20 ms one-way, equivalent to playing about 20 ft (6 m) apart in a room. Latencies provided by popular video conferencing software such as Zoom or Webex can be much higher and unusable for networked music performance.

Sources of latency when using FarPlay
The latency achieved when using FarPlay is limited by the following factors, which limit the latency for real-time networked music performance software in general.
 * networking conditions - Wi-Fi adds variable latency that can be high, so networked music performances typically require using Ethernet instead. Fiber-optic internet service adds less network delay than cable internet service.
 * physical distance - information can’t travel faster than the speed of light, so each 200 km of distance between two players adds about 1 ms of one-way latency between them.
 * audio hardware and drivers -
 * sound cards add latency when converting the analog signal from the microphone to digital audio and when converting digital audio to the analog signal for the headphones
 * the operating system and drivers, which transfer data between the sound card and networked music performance software, add latency.

Sources of latency FarPlay avoids
Some networked music performance applications have additional sources of latency:


 * compression - converting between uncompressed and compressed audio formats adds processing delays. FarPlay uses uncompressed audio to avoid these delays, but this also means that FarPlay requires more bandwidth than networked music performance software that can use compressed audio, like Jamulus and SonoBus.
 * client-server model - with some networked music performance software (Jamulus and JackTrip, for example), participants send audio to each other indirectly, through a mixing server. FarPlay participants, instead, send audio/video directly to each other using a peer-to-peer model, which is usually fastest. This comes with a trade-off: the peer-to-peer model increases the bandwidth and computer processor requirements of each participant as the number of participants in the session grows, so for sessions of more than around 8, a client-server model may provide better performance.

Buffering
As with other networked music performance software, FarPlay uses jitter buffers to help prevent audio dropouts that can result from fluctuations in network delay.

In FarPlay, a latency slider is used to adjust the amount of jitter buffering to obtain audio with less latency (but with more noise) or audio that's clearer (but with higher latency).

File recording and broadcast output are separately buffered for higher quality.

Usage
For International Make Music Day 2022, Dan Tepfer used FarPlay in Paris to play live with musicians in Australia, the US, Japan, and Europe.

ABC Academy of Music of Toronto switched to using FarPlay, instead of Zoom, as their primary online lesson platform in the spring of 2023. FarPlay is also used extensively by individual private music teachers.