Inspiration
Research has demonstrated that music when synchronized with a person's running cadence can provide enhanced psychological and psychophysical benefits during running. As a group of runners, we thought it would be very useful to have an app that would pick up music that matched the current pace of our strides, in order to motivate us to push through our runs. We took this hackathon as an opportunity to explore this interesting idea!
What it does
Our system leverages the smart devices that people wear/possess while running to measure their running cadence. Once we process and clean these metrics, we wire them to a mobile application. This app links the user's Spotify account with our system and allows the user to pick between their various playlists (ideally with songs that vary in tempo!) that they want to listen to on their run. Then, once the user starts running, the application plays songs that matches the user's running tempo in real time.
How we built it
We decided to leverage the IMU sensor on the iPhone to measure the user's cadence. We leverage the fact that many people run with either their phone or their Apple Watch to track their workouts, and both of these devices have IMU sensors that we can access. Although the current system is built for the iPhone, adding watch support should be relatively straightforward. We use a python backend server to process the raw signal data received from the IMU and compute the user's running cadence using Fourier transforms. On the mobile app, we use the Spotify API to access the user's playlists, find the tempo of the songs, and play songs that match the user's running pace in real time. Our app frontend is developed using UIKit. We also leveraged the Cerebras AI API to allow users the option to play music via an unstructured chat request (i.e. "I want to feel positive on this run!"), rather than select playlists on their own.
Challenges we ran into
As all of us were beginner iOS Developers, we faced several blockers initially while getting accustomed with the XCode IDE, Swift, version control, as well as UIKit (the Swift framework used to structure the application).
This project dealt with several complex technologies/methods, ranging from OAuthentication via Spotify's iOS SDK, Fourier Transforms calculation to determine real-time cadence calculation from accelerometer data, alongside generative AI prompting for further music personalization. Understanding how to incorporate each of these elements into the chassis of our project required deep research documentation and practiced methods.
Accomplishments that we're proud of
- Applying knowledge from multiple disciplines (sensor technology, data science, AI, and music theory) to create a cohesive product,
- Using Apple's CoreMotion library capture real-time movement data from iPhone's IMU sensors,
- Processing raw sensor data to accurately determine user's steps per minute,
- Leveraging Spotify's iOS SDK and Web APIs to fetch music data, then song to match running cadence,
- Building the entire application in the legacy UIKit framework, which was necessary as the Spotify iOS SDK was not compatible with SwiftUI,
- Experimenting with GenAI to curate playlists based on the user's mood,
- Hopefully paving the way for people to get into running and improving their physical health!
What we learned
We learned how to develop apps in UIKit - this was the first time coding in IOS for most of us. We grew a much deeper understanding of the Model-View-Controller architecture, alongside Spotify's API (iOS SDK & Web API). Of course, we also learned of the merits of working towards an idea that we were all deeply connected to and passionate about!
What's next for Stryde
Here are a few things that we would have liked to seen implemented in the future when we are not under a time constraint:
User defined cadence duration Give users an option to select their target cadence and how long they want to run at for each pace. The system then plays music at that tempo for the given time periods. This way, users have an easy way to determine how fast they should be going and to stay on track with their goals instead of having to estimate their pace.
More educational options We hope to expand this system to be educational and encourage more new runners to get into the activity. This could include system optimizations to recommend different running cadences that users may want to aim for if they do not have a great sense of how fast they should be going. We could also track user's running cadence progression - along with other metrics obtained from various health sensors available on smart devices - and act as a coach or guide.

Log in or sign up for Devpost to join the conversation.