A processing sketch of a galaxy visualising the music I listened to
- Each star is a song
- The glow colour represents the genre of the song
- Pop: Purple
- Rock: Red
- Indie: Yellow
- Electronic: Teal
- The nebula colour represents the time of day I listened to the song
- Morning: Pink
- Afternoon: Orange
- Evening: Green
- Night: Blue
- Song I listened to
- Genre of the song
- Date and time I listened to it
I collected my data using lastFM to track the songs I listened to and what time I listened to them
I wrote a small python script to grab the song title, artist, and time listened, and put the data into a csv
There were a lot of songs so I put the songs and artists into chat GPT to get the genre for each one - This is the only place I used AI
Then I updated the csv manually
- Loads data
- Calls visualise data, create nebula, and nebula texture
- Generates constant random positions for for the decorative stars
- Displays the galaxy
- Draws each nebula using a series of quads
- Adds a verticle wobble to each quad within the nebulas
- Rotates the nebulas around the the z axis at their centre
- Changes the quad size to make them appear to move forwards/backwards
- Creates a colour gradient from front to back for each nebula
- Uses NebulaTexture to texture each quad
- Uses billboarding to make sure the nebulas always face the camera as the camera rotates to avoid weird visuals
- Creates a PGraphics texture for the nebulas
- Uses perlin noise to make a cloudy texture
- Uses a mask to fade out the edges
- Positions song's stars within the nebula corresponding to the time of day I listened to the song
- Colours the song's star based on genre
- Draws the stars as diamond shapes
- Shrinks and expands each star to make it look like it's twinkling
- Uses billboarding again to make sure the stars always face the camera since they're 2D shapes
Some of the procedural techniques in this project were inspired by Daniel Shiffman’s Coding Train videos, especially the explanations of Perlin noise. I used these concepts as a foundation, then adapted them into a 3D galaxy system with my own:
- nebula texture generator
- layered quad rendering
- spherical star distribution
- time-of-day clustering
- genre-based colouring
- camera-aligned billboards