Author: Shresht Bhowmick
Date: November 2024
demo.mp4
SHFLA (Shoegaze Hierarchical Fractal Language Architecture) takes my obsessions with music and fractal geometry and mashes them into a wild audiovisual playground. It’s a system that maps musical elements to dynamic Julia set fractals, producing visuals that adapt to the mood and energy of the song. Designed to be Turing-complete, SHFLA made its debut at the MIT Media Lab Unconventional Computing Hackathon and snagged first place for turning audio into stunning real-time fractal art.
The example video above demonstrates SHFLA with My Bloody Valentine’s Only Shallow (heavily compressed, but you get the vibe). Locally, it’s sharper, punchier, and absolutely mesmerizing.
- Real-Time Visuals: Synchronizes Julia set fractals with the audio playback.
- Dynamic Parameter Mapping:
- Brightness: Mapped to the spectral centroid (perceived brightness).
- Color: Directly tied to the musical key via chroma analysis.
- Complexity: Influenced by the spectral centroid, scaling fractal intricacy.
- Interactive Inputs: Accepts song names or YouTube links.
- Optimized Performance: GPU acceleration via Numba and CUDA ensures buttery-smooth visuals.
- Enter a song name or a YouTube link.
- Audio is fetched using
yt-dlp
.
- Pitch (Fundamental Frequency): Sets the complex parameter
c
for the Julia set. - Spectral Centroid: Adjusts fractal complexity, e.g.,
max_iter
. - Chroma Features: Maps pitch classes to the fractal’s color palette.
- GPU-accelerated Julia set rendering in real-time.
- Dynamic parameter updates ensure seamless synchronization with music.
- Pygame handles rendering and real-time interaction.
- Python 3.9+
- pip
- ffmpeg in system PATH
Install via requirements.txt
:
git clone https://github.com/Tetraslam/SHFLA.git
cd SHFLA
pip install -r requirements.txt
Or install manually:
pip install numpy pygame librosa numba yt-dlp rich
- Windows: ffmpeg.org
- macOS:
brew install ffmpeg
- Linux:
sudo apt-get install ffmpeg
Ensure ffmpeg is added to your PATH.
-
Run SHFLA:
python main.py
-
Provide Input: Enter a song name or YouTube link when prompted.
-
Adjust Resolution (Optional): Specify a resolution or press Enter for default (1920x1080).
-
Enjoy the Show: Watch as SHFLA transforms music into fractals in real time.
Fractal changes driven by audio brightness.
Fractal detail scaling with spectral richness.
- OS: Windows/macOS/Linux
- Python: 3.9+
- Hardware:
- CUDA-enabled GPU (recommended)
- 8GB+ RAM
Pull requests are welcome!
- Fork the Repo
- Create a Feature Branch:
git checkout -b feature/new-feature
- Push Changes:
git push origin feature/new-feature
- Submit a Pull Request
MIT License. Feel free to modify and distribute.
Special thanks to the Python community and everyone who’s ever stared too long at a fractal. Extra shoutout to Numba, CUDA, and the shoegaze genre for inspiration.
Questions or ideas? Hit me up:
- Email: [email protected]
- GitHub: Tetraslam
- Website: tetraslam.world