In the modern world, it is frequent that people go without communication for copious amounts of time due to overbooked schedules and work. We believe in community-based lifestyles that promote sociability and communication. We accomplish that through making communication easier and more enjoyable for the masses. That is why we came up with our product TwitchPlayMusic, a script that may be added on to the currently overwhelmingly popular Twitch.Tv and allows users to communicate with the TwitchPlaysMusic bot to create their own music and socialize. Each user may enter commands to play a single note of music, which when done by the Twitch community, creates a completely unique song. We can proudly say that the high standards of user experience and interface are the highlighting accomplishments of our project. While building this project, we always kept the community in mind and better learned how to cater to our audience. TwitchPlayMusic is a great product that encourages community interaction online and has the potential to become a large community hub for socialization.
How It Works
Utilizing Twitch's API, we are able to obtain and analyze the stream chat in real time by using a script written in Node. By parsing the inputs through various verification and validation methods, we established the note frequency and duration of what each user wants the Twitch stream to play. To play the note, our Node script calls a python library called PySine and PyAudio, which plays single notes in real time. However, to better combine the contributions of each user, we incorporated multi-threading to ensure multiple sounds may be played simultaneously. In terms of streaming the output, we used Open Broadcaster Software to record the audio and screens of one of our machines. To play the audio output, we researched the mathematics behind sound waves' frequencies, especially in terms of the wave patterns of different musical instruments. Finally, we developed a video output using OpenCV that corresponds to the audio to complete the user experience.
Challenges We Ran Into
Accomplishments We're Proud Of
We invested most of our time into ensuring that each note of music played by users would be met by visually pleasing graphics, allowing for astounding user experience. We can proudly say that the high standards of user experience and interface are the largest accomplishments of our project.
What We Learned
We all learned how to use new APIs and integrate them into our work, especially when looking back at our first hack attempt, where we all gained experience in React and Amplify. Although the hack did not progress perfectly for us, it was a great learning experience with outstanding performance considering that this is the first hackathon for some of our members.
What's Next for TwitchPlayMusic
While building this project we always kept the community in mind and better learned how to cater to our audience. Our next step would be integrating more instruments to create a variety of sounds, creating a community orchestra. We would also like to upload our scripts and programs to an online virtual machine that can continuously run TwitchPlayMusic indefinitely for everyone to enjoy.