I went to Hacking Arts, and built a version of Tetris Attack that plays its own music!  This post is a quick discussion of how the music system works, and how it could be improved.


There are five tracks, one for each color, and a 32-beat loop.  When you clear N blocks of a given color, N beats are added to the loop.  The beat index increases from left to right, and bottom to top.  Once the loop is full, the beats get replaced from the beginning.  This works pretty well!   The music is by SND, which matches the minimal aesthetic really well, and is glitchy enough to not feel weird when it is sequenced in blocks of three.

I borrowed the Tetris Attack code from Lawrence Wo.  The audio code is all driven by The Echo Nest’s remix.js.  I had to add looping functionality, as the main loop changes in length during playback.  Another problem is that loading five tracks take a long, long time.

Musically, the main issue is that Tetris Attack is match 3, and most music is in 4.  I debated having three blocks equal one bar, but eventually decided to keep the meters shifting.

As a soundtrack, this is fun.  However, it fails to actually match the game state.  A simple increase in tempo could help this out, as is traditional in Tetris games – or an increase in volume or filter, and so on.  Trivially interactive music like that has been a thing in video games for the past forever, but it works well for unambiguous puzzle games like this.