A musical game. First steps

I started this research project because I think there is an interesting relationship between game and music, up to the point that I think there are several dimensions of music that have some kind of playful facet, from creation to audition, including interpretation. Play refers in English and many other languages the performance of music and the act of participate in a game. In this post I will talk about how I created the first musical game, using Max MSP.

There is a gradation between disorganised play to a more organised game. Music can easily have both components: timbral exploration and free improvisation can make us feel as if we were playing, while competitive play has similarities with our will to excel in improving our technique or the performance of a score.

My first goal is to create a small instrument that can apply these game concepts to some extent. I’m developing this work under the supervision of my teacher Rui Penha. For that matter, I started putting together some pieces, which are the following:

  • A set of rules to play a competitive game.
  • A sound synthesis engine (the instrument).
  • An interface to explore the timbral and performing characteristics of the instrument.

I started by investigating how to create an instrument whose timbre could be manipulated while playing, so that it would seem more like a casual interaction than a dedicated one, that is, one that would be performed more playfully than as an actual interpretation. Following my teacher’s advice, I started to investigate the physical modeling, with a relatively simple model to implement: creating a Fender Rhodes emulation. For that, I decided to follow Mike‘s Moreno tutorial, adapting his Rhodes model from Pure Data to Max MSP.

From casual to serious play

After creating a satisfactory prototype Rhodes, and having gone through the rite of playing with it, improvising and playing some solos, it’s time to create a simple game. I tried to make this game work simple and make it possible to create in Max. The game is currently under development, but I have a first working version, which lacks a name, but which is a kind of note hunting.

In note hunting, the player starts by playing a series of notes. The computer registers the intervals that the player touches in his interpretation in a 1st degree Markov chain, with indication of sign (ascending or descending). For each note starting from the 5th, the computer plays another note, following this Markov chain. Every time the player manages to catch the computer, that is, play exactly the same note that the computer chose, the player scores a point.

The game is endless, i.e., it continues indefinitely with the objective of getting a maximum score, like Tetris. So there are no winning conditions, only losing conditions. These conditions are:

  • The player must guide the computer, through his influence, so as not to go beyond certain limits, which are currently notes C1 to C6 (C3 is center C), inclusive (midi notes 36 to 96).
  • The player has a life bar or health points (HP), which represents the time the player has until the game ends. The health bar starts at 2 seconds, has a maximum of 5, and it fills half a second with each note played.

When the game ends, a game over sign lights up and a high score ranking is shown (the player may choose his name at the beginning of the game).

A preliminary version of the game

The sounds used at this point are simple: for the player, a sampled piano; and for the computer, the Fender Rhodes I created, with some basic settings.

What’s next?

From now on, there are several ways to go: improve the game, improve the instrument and transform this instrument into a toy.

For the game to improve, I have several ideas:

  • Allow the player to change difficulty.
  • Create a competitive multiplayer mode, with the possibility to play online.
  • Create some kind of Artificial Intelligence to be the computer player.