Since generations, singing and speech have been mainly transmitted orally. How does oral transmission shape the evolution of music? Here, we developed a method for conducting online transmission experiments, in which sung melodies are passed from one singer to the next. We show that cognitive and motor constraints play a profound role in the emergence of melodic structure. Specifically, initially random tones develop into more structured systems that increasingly reuse and combine fewer elements, making melodies easier to learn and transmit over time. We discuss how our findings are compatible with melodic universals found in most human cultures and culturally specific characteristics of participants' previous musical exposure. Overall, our method efficiently automates online singing experiments while enabling large-scale data collection using standard computers available to everyone. We see great potential in further extending this work to increase the efficiency, scalability, and diversity of research on cultural evolution and cognitive science.