TwitchPlayMusic

Inspiration

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

When starting this hackathon, we were set on a vehicle sharing mobile application using AWS Amplify, SmartCar, and the Google Maps platform, using ReactJS for development. However, since we were all new to React, we met an abundance of challenges, such as using Amplify's database and incorporating Google Maps through React. Halfway through Saturday, we realized that it would be nigh impossible to build a solid project by the end of the hackathon. Cutting our losses, we chose a completely new direction in the field of our specialization: entertainment. In developing our Twitch application, our first main challenge was finding a way to play the notes. Since we wrote our script in Node, we initially only focused on looking at APIs that used JavaScript. However, by expanding our search to other languages, we easily found a working interface in Python. Our next challenge was figuring out what and how to display our visual output, as a Twitch stream that was just audio would be extremely dull and commonplace. There would be no innovation. By combining our efforts of entrepreneurship and ingenuity, we built the product TwitchPlayMusic.

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.

Share this project:
×

Updates