A dynamic, animated lyrics display application that brings songs to life in your terminal with stunning visual effects and synchronized timing.
- Animated Typing Effects: Watch lyrics appear character by character with realistic typing animations
- Glitch Visual Effects: Eye-catching glitch transitions using random symbols before revealing each character
- Color-Coded Lyrics: Intelligent color assignment based on lyrical content and emotional tone
- SRT Subtitle Support: Perfect synchronization using standard .srt subtitle files
- Rich Terminal Output: Beautiful, colorful display powered by the
richPython library
- Python 3.6 or higher
richlibrary for enhanced terminal output
- Clone this repository:
git clone https://github.com/0PKunal/Lyrics-with-Python.git
cd Lyrics-with-Python- Install required dependencies:
pip install richRun the default example with "Washing Machine Heart":
python WashingMachineHeart.pyTo use your own lyrics:
- Create an SRT file with your song lyrics in standard subtitle format:
1
00:00:09,063 --> 00:00:11,924
Your first lyric line
2
00:00:11,923 --> 00:00:16,085
Your second lyric line
- Modify the script to use your SRT file:
if __name__ == "__main__":
play_srt("your_song.srt")The application automatically assigns colors based on lyrical content:
- Red: Emotional or intense phrases (e.g., "why not me")
- Yellow: Intimate or personal terms (e.g., "baby", "I know")
- Cyan: Default color for general lyrics
Customize the visual effects by modifying these parameters in type_effect():
speed: Controls typing animation speed (default: 0.07)glitch_speed: Controls glitch effect duration (default: 0.012)glitch_cycles: Random range for glitch iterations (default: 2-5)
The modular design makes it easy to add new visual effects:
def your_custom_effect(text, **kwargs):
# Your custom animation logic here
passLyrics-with-Python/
├── WashingMachineHeart.py # Main application script
├── WashingMachineHeart.srt # Sample lyrics file
├── README.md # Project documentation
├── requirements.txt # Python dependencies
└── examples/ # Additional example files
type_effect(): Creates the animated typing with glitch effectsparse_srt(): Parses SRT subtitle files into timed entrieschoose_color(): Intelligently assigns colors based on contentplay_srt(): Orchestrates the synchronized playback
- rich: Advanced terminal formatting and colors
- time: Precise timing control for synchronization
- random: Glitch effect generation
Contributions are welcome! Here are some ways you can help:
- Add new songs: Create SRT files for popular songs
- Improve effects: Develop new visual animations
- Enhance colors: Create smarter color-coding algorithms
- Add features: GUI interface, audio synchronization, etc.
- Fork the repository
- Create a feature branch:
git checkout -b feature/your-feature - Make your changes and test thoroughly
- Submit a pull request with a clear description
This project is open source and available under the MIT License.
- Thanks to the
richlibrary developers for excellent terminal formatting - Inspired by terminal-based music visualizers and lyric displays
- Sample song: "Washing Machine Heart" lyrics used for demonstration
- This README.md file is created by AI, it may have some mistakes
- Please contribute to improve it
Turn your terminal into a dynamic lyrics visualizer! ✨
Made with ❤️ by 0PKunal