Synchronizing Karaoke Songs: The Story Behind USDXFixGap
Karaoke nights with friends are always nice. However, it can be very frustrating when a song is out of sync. One main reason was very often that the start time of the lyrics was not well defined. This was the motivation behind my project, USDXFixGap.
The Problem: Out-of-Sync Songs from USDB
The UltraStar Deluxe community is amazing, and one of the best resources for karaoke songs is USDB, a massive database of karaoke files contributed by the community. With tools like USDBSyncer, you can easily download a large number of karaoke songs by combining lyrics from USDB with YouTube videos.
However, there’s a common issue: the GAP value, which defines the delay between the start of the video and the lyrics, is often incorrect. This happens because audio files are created from YouTube videos, and the community may not always update or set the correct GAP value. Fixing this manually for a large collection of songs is tedious and time-consuming.
The Idea: Automating the Fix
Last year, I decided to tackle this problem head-on. The idea was simple: create a tool that could automatically detect and fix timing gaps in USDX songs. I started experimenting with Python, even though I had never implemented anything in Python before.
One of the key breakthroughs was discovering Spleeter, an open-source audio separation library. It allowed me to isolate vocals and music tracks, making it easier to detect timing issues.
Initially, I built a command-line tool to process the songs. While it worked, I quickly realized that a fully automatic solution wasn’t practical. Some manual intervention was necessary to ensure accuracy. This led me to develop a semi-automatic approach, combining automation with user input.
As the project grew, I had to process massive amounts of files and data. This forced me to learn advanced concepts like threading and runners to handle multiple tasks simultaneously. To improve performance, I implemented caching using a database.
The Result: USDXFixGap
The result is USDXFixGap, a tool that works for me and, hopefully, for others in the USDX community. It’s more than just a script; it’s a solution born out of necessity, curiosity, and a lot of learning. The project is hosted on GitHub, and you can check it out here.

Features
- Standalone Executables: Download and run the tool on Windows or Linux without needing Python. Releases are available for easy setup.
- Python Support: For developers, the tool can be run in a Python environment. Follow the installation instructions to set it up.
- Semi-Automatic Workflow: Combines automation with user input for precise gap fixing.
- Multi-Threading: Processes multiple files simultaneously for efficiency.
- Caching: Uses a database to store intermediate results and speed up processing.
- Normalization: Ensures consistent playback levels for audio files.
Built with GenAI Assistance
One of the most fascinating aspects of this project is that it was largely implemented with the help of generative AI tools. As someone new to Python, I relied heavily on AI to guide me through coding challenges, debug issues, and optimize the tool.
Conclusion: For the Community, By the Community
USDXFixGap is a project born out of my love for karaoke and the USDX community. It’s not perfect, but it works for me and might work for you too. If you’re tired of out-of-sync songs, give it a try. Contributions and feedback are always welcome!
Check out the project on GitHub: USDXFixGap. Let’s make karaoke nights even better!