Inspiration
Music Companion (音乐伴侣) started with a simple idea: I like having something to watch while I listen to music. For Kiroween, I imagined a record turning in the moonlight while a quiet waltz played. That image became the project.
What it does
Press Play to hear Midnight Waltz, an original 24-second instrumental. A moonlit record spins while the melody plays. You can stop the piece at any time or let it finish and play it again.
How it was built
The page uses HTML, CSS, and JavaScript. The Web Audio API plays the melody one note at a time over a soft bass line. The browser creates both sounds directly, so there is no audio file to download. CSS draws the record and animates its rotation.
Challenges
The trickiest part was making the experience feel like one player. The music can end in two ways: the listener presses Stop, or the waltz reaches its last note. Both paths reset the record, button, and timer so the next listen starts cleanly.
What I learned
I learned why the audio clock matters. Scheduling notes against the browser’s audio clock keeps the waltz steady, while a separate timer updates the countdown. I also learned that a single visual can be enough: the moving record tells the listener at a glance that the music is playing.
Built With
- aiderss
- music