🏆 JamHacks 2025 Solo Hack Winning Project
Lofied is a Python-based application that allows users to convert their Spotify playlists into lo-fi versions. The application downloads songs from Spotify playlists, processes them through a music separation pipeline, and creates lo-fi versions of the tracks. It can also convert songs into sheet music format for musical analysis and learning.
- Create and manage Spotify playlists
- Download songs from Spotify playlists
- Convert songs to lo-fi versions
- Convert songs to sheet music format
- Edit and update existing playlists
- Sync playlists with Spotify
- Programming Language: Python 3.x
- Key Libraries and Tools:
- spotdl: For downloading Spotify tracks
- torchaudio music separation pipeline
- Pedal Board (Spotify) audio transformation
- Basic Pitch: For sheet music conversion
- MySQL: For database management
- Virtual Environment (venv) for dependency management
Lofied/
├── src/
│ ├── main.py # Main application entry point
│ ├── playlist.py # Playlist management functionality
│ ├── spotdl.py # Spotify download integration
│ ├── mySQL.py # Database operations
│ ├── setup.py # Environment setup
│ └── pipelines/
│ ├── musicSeperation.py # Music processing pipeline
│ ├── audioTransformation.py # Audio transformations
│ └── convertToSheet.py # Sheet music conversion
├── playlists/ # Storage for downloaded and processed playlists
│ └── [playlist_name]/
│ ├── notlofied/ # Original downloaded tracks
│ ├── lofied/ # Processed lo-fi versions
│ └── sheets/ # Generated sheet music files
└── venv/ # Python virtual environment
- Clone the repository
- Navigate to the project directory
- Create playlist folder in root of project
- Run the application:
The setup script will automatically:
docker compose up --build -d docker run -it -v "$(pwd)/playlists:/app/playlists" jam-hacks-2025-server
The application provides a menu-driven interface with the following options:
- Create new playlist
- Sync existing playlist
- Delete playlist
- Download playlist
- Convert playlist to lo-fi
- Convert to music sheet
- Select option 1 from the main menu
- Enter a name for your playlist
- Input Spotify URLs for the songs (enter 'x' when finished)
- The application will download the songs and prepare them for processing
- Select option 5 from the main menu
- Enter the name of the playlist to convert
- The application will process each song through the music separation pipeline
- Converted lo-fi versions will be stored in the playlist's 'lofied' directory
- Select option 6 from the main menu
- Enter the name of the playlist to convert
- The application will:
- Separate vocals and other instruments
- Merge them with optimal balance
- Convert the audio to MIDI format
- Save the sheet music in the playlist's 'sheets' directory
The project was developed in several phases:
- Initial setup and environment configuration
- Spotify integration using spotdl
- Implementation of playlist management features
- Development of the music separation pipeline
- Integration of all components
- Testing and refinement
- Addition of sheet music conversion feature
- Optimization of audio processing pipeline
-
Music Processing Pipeline
- Challenge: Implementing efficient music separation
- Solution: Developed a custom pipeline using advanced audio processing techniques
- Recent Improvement: Optimized pipeline to process audio in memory without intermediate file storage
-
Spotify Integration
- Challenge: Handling various Spotify URL formats and track metadata
- Solution: Utilized spotdl library with custom wrappers for better control
-
File Management
- Challenge: Organizing downloaded and processed files
- Solution: Implemented a structured directory system with clear separation between original and processed tracks
-
Persistent Docker Data Storage
- Challenge: Playlists created in container needs to sync with host data
- Solution: Implemented bind mounts (shared volume)
- Need to run
docker run -it -v "$(pwd)/playlists:/app/playlists" lofied-serverwhere$(pwd)/playlistsis the host directory and/app/playlistsis the contianer directory and-vbinds them together
-
Sheet Music Conversion
- Challenge: Accurate conversion of audio to sheet music
- Solution: Implemented a two-step process using music separation and Basic Pitch
- Recent Improvement: Optimized audio processing to maintain quality while reducing file operations
- Advanced audio processing techniques
- Spotify API integration
- Python project structure and organization
- Virtual environment management
- File system operations in Python
- Command-line interface design
- Music theory and sheet music generation
- Audio-to-MIDI conversion techniques
- Add support for more music platforms
- Implement batch processing for large playlists
- Add user authentication
- Create a web interface
- Add more audio processing options
- Implement progress tracking for long operations
- Add support for different sheet music formats
- Implement real-time audio processing
- Add support for custom audio effects
- Develop a mobile application