Code of Music A21: Harmony Project – Alex Wang

Task:

Harmony Project: Design and implement an exploration of harmony using code. This could be an interactive piece or a fixed composition. Record a 20-second snippet of the piece in action*. Collaborations between two students are encouraged.

P5 Editor Link:

https://editor.p5js.org/alexwang/present/3iZ2RjcdR

Final Product:

Inspiration and concept:

Interest in music is becoming more and more common and people can still enjoy playing music without a solid understanding of music theory. A quick google search will tell you the chords to your favorite song and what individual notes and voicing are suitable for playing the chord. However, it does not go the other way. When people are experimenting with harmony themselves it is harder to go the other way and have someone tell you which chord you are playing. I find this personally finds this frustrating, not being able to tell the name of a chord I landed on. This is why I wanted to create an interface where the program will tell you which chord you are playing, regardless of voicing.

A description of your main music and design decisions:

I did not include any music in this project, mainly because I wanted this project to be something more useful as opposed to something more artistic, I also made the overall visual design simple because of this. Playing a note changes the color of the corresponding block on the keyboard, also displaying the pitch of the note above it. Playing 3 or more notes will display the name of the chord you are playing, if it is a non-ambiguous chord.

An overview of how it works:

The way this program works is by storing all triads and seven chords in an array. Then I use another array full of boolean values to check what notes are currently being played. After sorting all the notes being played in order(solves the voicing issue) and eliminating any duplicates when playing octaves of the same note, I will compare that set of notes with the library of known triads and seven chords to see if anything matches.

Challenges:

This project is definitely way more complex than I thought it would be. A lot of the chords did not exactly have a specific name and many chords shares the same exact notes. For example, A sus4 (A, D, E ) and Dsus 2 (D, E, A) has identical notes. Some chords doesn’t even have names, chords like D A C can be interpreted differently depending the context of the music. It could either be a Dm7 by adding a F, or it could be a D7 chord by adding a Gb, it could even be a C6/9 chord by adding E and G. Chords like this can only be identified with the full context of music, information such as chords played before and after this chord in the progression, as well as key of the song, and the notes played by other instruments(bass usually indicates root).

Future Work:

With these challenges in mind, I would like to explore more with harmony in potential future work. Perhaps using algorithms to analyze the most possible chord that these harmonies are trying to suggest, maybe even utilize machine learning to train the perception of harmony according to the context of the music. These could all be interesting things to explore in future versions of chord analyzing software.

Leave a Reply