A problem we've seen many beginner music students have constantly is finding the motivation to dive into the nitty-gritty details of music. Many of these students find topics such as intervals, chords and progressions a bore compared to the myriad of distractions online (Yes, Facebook. That's you!), and so we thought: Why not stop trying to fight these distractions and try to integrate with them instead? Wouldn't it be great to have a musical companion bot which music students (and anyone who's interested) could ask their questions and even get a dose of inspiration to love music? Thus, Music.ally Trained was born --- and the rest is history :)
What it does
Music.ally Trained is a bot which provides a quick and user-friendly way to get started with the basics of music theory and to discover new music! Here's what it can do currently:
- Return an interval given 2 notes
- Return the notes in a chord given the chord's name
- Return songs which include a specified chord progression
- Return a musical joke
- Return information about a composer
- Return information about an instrument
- Jukebox - helps you pick a random song for your next karaoke session!
How we built it
Music.ally Trained is built in Python, using a Bottle app deployed on Heroku. To help our bot achieve musical intelligence, we employed the use of the Mingus library and integrated the Spotify and Hooktheory APIs into our app.
Challenges we ran into
The main challenges we faced stemmed from being new to Wit.ai and Facebook's ecosystem, as well as a tight timeline given that we started the project with a week left to the submission deadline.
As we only had 1 Developer account and so many features we wanted to implement, it was a challenge for us to find a workflow which would allow us to build, test and refine our work smoothly. Moreover, with strict social-distancing measures in place, we found ourselves spending more time and effort trying to find an efficient way to collaborate rather than focusing on the features of our bot.
With regards to Wit.ai, it was a challenge determining which labels to give to our intents and entities as the lines between them got blurred the more we ventured. As for Messenger, it was difficult to test our bot as it required the creation of a Developer account and it would also be a tedious process to make our app live to the public.
Accomplishments that we're proud of
Firstly, we are proud to have completed this project with only 1 Developer account despite having 2 team members as we had to think of innovative ways to ensure both members could test our bot after making changes to the code. Thus, we decided to take advantage of technology, utilising a combination of communication platforms from Skype's screen share to VS Code's Live Share and to traditional Whatsapp messaging, such that we were able to keep making progress towards the finish line.
Additionally, we are proud that we managed to integrate as many APIs and libraries as we have! Initially, we didn't believe we would need to use many third party tools but by the end of the project, we are proud to say that we have integrated the Spotify and Hooktheory APIs as well as the music theory library Mingus into our project, and have experimented with many others as well!
All in all, we're proud to have accomplished this many features given the short amount of time and how little prior experience we had. Though we ran into many errors along the way, we're glad we were able to press on and crush all (or most) of the bugs!
What we learned
On the technical front, we learned how to create an intelligent bot using Wit.ai and integrate it with Facebook's Messenger, but beyond that we also learned about various deployment methods (such as Glitch and Heroku), a bunch of music APIs and libraries, and Python, our choice of programming language.
Furthermore, we learned about collaboration in the context of software development projects through experiencing challenges such as managing different versions of our app, dealing with merge conflicts due to code changes, and the endless Googling in order to fix our bugs. With regards to our technical challenges, we must definitely mentioned how helpful the Facebook hackathon community has been, providing us with timely support and advice whenever we felt like we were really stuck. As such, we are thankful to have learned from the experiences of other developers and looking back, we can now definitely see the importance of not being afraid to ask others for help when we are stuck and hopefully we ourselves can provide the same help and guidance to others in future.
Lastly, looking at the amount of time and effort we put in for this hackathon, we can now better appreciate the amount of planning, communication and focus required to deliver a project by a given deadline. Perhaps, it is the immense satisfaction we get when we finally achieve a final product which drives most, if not all, of us to do what we do.
What's next for Music.ally Trained
We would definitely love to expand on the functionality provided by Music.ally Trained as we do have many ideas for further improvements.
For instance, we would like to implement Messenger's Private Replies function to allow users to receive links to useful musical resources so that they can further expand their knowledge given that there are limitations to almost any bot's capabilities. However, since our Facebook page is new and has neither any useful posts nor users, we decided to leave this feature as an option for future work instead.
Moreover, we also have plans to broaden the range of music theory questions users may ask and we believe this would be relatively easy to accomplish as the library we chose, Mingus, offers many useful functions for learning about music. Hence, our project would be easily extensible using it and is rather flexible in this sense.
Additionally, we are also planning to tap on Natural Language Processing, to improve our bot's persona to be even more light-hearted and engaging, so that we can sustain the attention of our users.
Lastly, we hope to further improve our bot's intelligence through more rigorous training such that it will better handle misspellings and provide users a better experience overall.