Lance’s Status Report for Feb 18th

Over the past week I’ve been reevaluating how I want to handle music generation.

Previously, I had planned on having multiple different solutions to different problems, but have come to the conclusion that it would be best to focus on one functional approach.

I’ve approached the problem with the idea of the user playing single notes. This slightly simplifies the problem while also leaving room for algorithmic improvisation. With the user playing single notes, we can use software to analyze what notes they’ve played, and create a chord progression from that.

Chord progressions are cyclical (generally), so we can assume that it should repeat every 4 to 8 bars with little variation. This can be seen below:

Here you can see that- although not in the key of C- chord progressions can be simple, even for popular songs.

The way a chord progression will be assumed is through Bayesian Updating. The cyclic nature of progressions allows us to examine bars individually. Through this, we can measure the frequency of notes played and create a probability measure for what chord is being played during the measure.
As a simple example, say we play the note D five times, F six times, A 3 times, and B twice. If we were to make an assumption about what chord was being played  over(triads only), we could assume that either D minor or B minor were being played. A was played more than B, so we know that there’s a higher chance that the chord is D minor (the triad being D, F, A).

This does involve some assumptions, and could require us to examine surrounding measures to ensure aforementioned assumptions make sense. However, with this approach, the algorithm is free to comp the user with chords and rhythms that can make the piece more interesting (we can also use a similar approach to decide rhythm!).

I’ve been testing algorithms by hand, and overall they seem to work well enough. I’ve also managed to send regular signals through an Arduino, now I just need to make a specific parser for translating to different tempos. I would say that overall, I am on track with our current schedule. During this upcoming week, I plan on writing the Bayesian Update algorithm and ensuring it works.

Lance’s Status Report for Feb. 11th

Over the past week I’ve been weighing options for melody generation. There are a plethora of options because of the nature of music as an artform.

If we choose to let the user directly control the notes they play, then the form is simple. Given some input (grid coordinates for now), we can tell the hardware to press a specific note on a keyboard. The question then becomes, how do we make it interesting? If you’re stuck always playing exactly the note you’re at, it’s not going to sound like music. Well, it will, but it could always be more interesting. Then, let’s say that the other axis of your grid determines how fast the notes are playing, their subdivision. This is fine- and it definitely adds more spice- but there are still some key elements missing. What if we want to “play” a musical rest? What if we want to jump over some number of notes, say, an octave? There are definitely options for this, for example, in the case that we have colored gloves, we could use the absence of color to indicate a rest, which can then be used to make note jumps. This solution should be incredibly intuitive, but difficult to play skillfully at first, which could be discouraging.

If we want to procedurally generate melodies based on two notes at some point, we have a few options. The simplest is to say, “What is the subdivision? If you give me that, I’ll create a string of notes that run up (or down) from the first to the second note, in the amount of time you give me. If there are too many intervals between the two notes to be played, I’ll skip over some of the boring ones. If there aren’t enough, I’ll make some longer.” This works, and we can even add random variations. For example, we could randomly choose to generate a “harmonic enclosure,” which is when you land on a note after playing the notes above and below it in a sequence. We can add plenty of other flairs to our melodies like this. This solution is very versatile, but may be difficult to create a smooth user experience for.

The last solution is something I need to further consider, but it involves generating a melody based on “mood” determined from gestures. We could possibly do this by parameterizing certain musical intervals with various emotions, and then selecting notes based on that. This gives the user a lot of leeway, but also greatly increases the amount of effort needed to create something musically coherent and satisfying to play/listen to. Sure, moving from the 7th to the 1st interval is satisfying, as is a ii-V-I progression, but everything can be used in so many different ways that it’s hard to say what the best outcome would be. This solution, if implemented properly, would be extremely fun to use, but definitely sacrifices some of the user’s autonomy.

As it stands, I am on track to start with pitch selection algorithms and continue with musical progression generation.

Introducing Keynetic

Welcome to Carnegie Mellon University: ECE Capstone Projects.

We plan to create a mechanically actuated keyboard that is managed by a microcontroller. The use of a software controller will allow us to actuate a variable number of keys—more than a human could, if necessary. The user would be able to play simple notes and chords on the piano, but not an intricate or high-level song due to limitations in how fast someone would be able to signal the camera. We are limiting our scope by bounding the playing range to two octaves on a piano keyboard, white keys only, and mitigating as many unexpected real-life problems as possible when analyzing camera input. For instance, we are hoping to create an environment where the user can be distinctly recognized by the camera by using CV. Currently, there are no intuitive and widespread solutions for playing the piano without pressing keys or generating sound directly from a computer. Our solution would allow users to play without having to physically touch the piano and indeed, without even sitting down at the bench.