Unity
1 week
Solo project
Spring 2022
Tic-Tac-Tone is a musical variation on the classic game Tic-Tac-Toe. Each player controls an instrument which produces a note when placed.
After each round, the produced winning chord is calculated and can be replayed, allowing the players to learn a bit of musical theory on the way.
ASSIGNMENT
The assignment was to simply follow a tutorial for making a tic-tac-toe game, and then to replace the graphic elements and make it juicy.
CONCEPT
Since music is close to my heart I knew I wanted to make that the core element in this version of the classic game. "Three in a row, three notes in a chord", I thought to myself and that was the starting point. Whilst making it I realised a potential for using it to learn the players a bit of music theory as well.
STARTING OUT
Nine notes is quite restricting, especially since you can only win in eight positions in tic-tac-toe. The risk of being awfully repetitive was obvious. A solution was to give the player a choice to alter every the note of every placed marker, and with that my first concept was born:
I began working on the main functionality, and was able to calculate the chord if modulations wasn't allowed. At this point there were basically only eight possible chords, so that wasn't much of a challenge. I also included the possibility to replay the chord that won.
Replaying the chord sounded too robotic, since it was played... well by a machine. There were no dynamics in the chord at all. Therefore I added a small random delay for each note played, more closely simulating the fingers of a human and reducing repetitiveness.
GRAPHICS
The next step was to make the game look more interesting. At first I wanted to try out how everything was implemented, so I made a version without any particular vision. I also added a button to replay the losing chord, effectively doubling the post-game fun with very little work.
However, I wasn't satisfied with this bland version and instead wanted to make a background and graphics by myself. The idea of making the board a stage and where the markers could be spotlights came, and this version was created:
Yet again I was disappointed. It didn't really translate, unless you knew it was supposed to be a stage. I thought of the game itself, tic-tac-toe, and how it is usually played spontaneously on a piece of paper. Maybe a couple of students in a music class took a note sheet, or a post-it, and played upon it? That also allowed me to choose a font and design the rest of the elements as if they were hand drawn with a marker. The X's and O's I drew by hand in Photoshop, using an eraser to get those lines nice and natural.
CALCULATING CHORDS
This project was more of a coding exercise than anything else. If I wanted to show the notes only belonging to the winning chord and didn't allow modulation of the tones, that would only be eight possible chords. Not that hard. Allowing modulation means that each tone suddenly can be in three different states, giving us hundreds of combinations. Too much to hard code. For anyone who has studied a little music theory, you also realize that is impossible. There isn't that many chords with only three notes. So how do you narrow it down and calculate the actual chord?
With the time given and, to be frank, my skill level at the time, I had to make some sacrifices. I'd only allow three notes. The first note had to be the base note, skipping calculating the most "sensical" chord out of the notes chosen. However, I did include some special cases to handle chord inversions (a musical term, just a fancy word for playing the same chord in different ways).
So what I did was to compare the interval between the first and the second note, and then the first and the third note. Putting a name to these intervals, I then compared them to a list of possible interval combinations, and displayed their corresponding chord name, giving us i.e. "sus2". After that I simply compared the base tones integer to a list of notes, giving us i.e. "G". Combining these resulted in "Gsus2", a chord!
I later fleshed out the GetChordName method to handle special cases:
FINAL THOUGHTS
This is a project that I have thought about returning to. There are things I want to implement, but didn't have the time or skill for at the time. In my opinion, it could actually be of value to learn about chords. One of the important parts for this to actually happen is that for each marker placed, a note is drawn on the note sheet in the background. Then you could learn to visually recognise the chords and connect them with the sound they produce.
With some further polishing, and perhaps a rework of the chord calculations to make it even more accurate, this would be a fun little game. Maybe choosing between more instruments?
Comments