bg
Blog

Simplifying Sheet Music with Machine Learning

Michael Schwartz
  • Machine Learning
  • Music Theory
  • Sheet Music
Published
Last updated October 19, 2022

Setting the scene!

You’ve learned a few notes on your instrument, and it’s finally time to play your favorite songs and impress your friends!

You find a piece of sheet music online. Your heart sinks. This song looks really difficult!

You consult your teacher or musician friend. They say, “if you want to play that song, you need more practice.”

“How much more practice?” you ask.

“Maybe a few years,” they respond.

“A few years?!” you exclaim. Just to play a single song?

“Just be patient, you’ll get there,” they say.

You sit there, a bit defeated. A few years of patience and practice is a long way off when all you wanted to do was play your favorite song. This is where a huge fraction of musicians I know have called it quits–the payoff is just too far away! In principle, even beginner musicians deserve to play the music they enjoy.

So what do you do? You try to look for an easier version of the song online. However, you can’t find any easier version online, and asking another musician to rearrange a piece of music is expensive. I guess we’re stuck…

Or are we?

Using a mix of machine learning and music theory, it’s possible to create an easier version of your song that you can play with ease! The best part is that this method is quick, easy, free, and available on Kena right now!

These simplified Kena sheets take the most important features of the song you upload and create several simplified versions of this sheet music, from very beginner difficulty to the maximum sheet music difficulty, and everything in between! Suddenly, years become only months, weeks, days, hours, or even minutes!

In this blog, we would like to talk about how we at Kena created a tool that makes simplified versions of sheet music and helps musicians play their favorite songs soon. We’ll go over some underlying music theory that makes a song difficult, and then show how we use objective functions and statistics to create an easier piece of sheet music. 

If you would like to access the tool right now, then visit Kena. To learn more about how we make our simplified sheets, please read on!

What makes a music sheet hard?

This is a difficult question because there are so many answers to it! We present a simplified answer for now.

A huge amount of a song’s difficulty is attributed to rhythms and, for chordal instruments, the number of notes in each of its chords. Let’s break this down a bit.

Rhythms

It’s no secret that faster music is often harder to play. Take everybody’s favorite Dragonforce song, “Through the Fire and Flames” as an example–there’s a reason it’s infamously the most difficult song in Guitar Hero 3: Legends of Rock! Faster notes mean more places to place your fingers or changes to your mouth when playing wind instruments.

Notes:

It’s hard enough to play a song one note at a time. Throw more simultaneous notes in, and it’s a frenzy of multitasking amongst different fingers, keys, and strings. Furthermore, there is an expectation that certain notes are more important than others. Sometimes, if a piece of music has a lot of extra notes for fluff or decoration, they get in the way of the musician focusing on the most important notes in the song.

We can get even more complicated here, but this simple reminder that more complicated notes and rhythms drive a lot of the reasons why musicians look at a piece of sheet music and say, “Oh my gosh, this looks too hard for me!”

So how do we transform some of these realizations that music is hard into a music simplification system?

Let’s talk about our pipeline for a moment. We wish to take passages of music, recognize what is hard about them, and then remake each passage as a simplified version of the music. 

When making this more simplified passage of music, we want the song to abide by two criteria:

  1. The piece of music must be easier (to some specified level).

  2. The simplified piece of music must bear as much resemblance to the original difficult piece of music as possible.

Our job of creating a simpler piece of music seems to be to find an optimal mixture of these two criteria. Sometimes, we may want the new piece to be easier, meaning we have to change more of the original song to make it easier. Sometimes, we may allow the new piece to be harder, meaning it can bear more resemblance to the original song.

Luckily, there is an entire field of mathematics dedicated to fulfilling a mixture of objectives and goals (trading off between complexity and original resemblance) that we can leverage to make our simpler piece. 

Objective Functions for Simplification

We want to find a tradeoff between simplifying our music and making the new music resemble the old music as much as possible. 

Let’s say that two pieces of music are represented as mathematical variables, call them x, y. Let’s define a function that determines if two pieces of music are similar, call it f(x, y), and then let’s define a function that determines if one piece of music is easier than another, and how much easier it is, call it g(x, y).

Our new simple objective function can be modeled as follows:

h(x, y) = f(x, y) + g(x, y)

where h(x, y) tries to get the best piece of music possible at the end given that we want to make the music both simpler as well as similar to the original. If x is our original piece of sheet music, we want to create a piece of sheet music y that gets us the best result possible from h(x, y) and choose to publish that simpler version of music y.

This is the underlying mathematics behind Kena’s music simplification systems to make easier versions of songs!

Let’s get specific: what notes and rhythms do we focus on to get the best simple piece of sheet music?

We don’t have some magical function that says “give me an easier piece of sheet music, and give me a similar piece of sheet music.” So what do we have?

Using some music theory, we can make mathematical functions that pay attention to certain notes in our original piece of sheet music and say, 

“hey, these notes are important! But these other notes are less important.” 

From there, we can use math to create a piece of music that chooses only the most important notes while throwing away the less important notes, overall making an easier piece of music for you to play.

What are these functions, and what are the most important notes?

Making our piece of music simpler, and choosing the most important notes

Some common sense rules in music theory exist:

  • Certain notes make a song’s scales and chords sound more apparent.

  • If a musical melody is ascending, then we want our simpler musical melody to also follow the original melody and ascend. If a musical melody is descending, we want our simpler musical melody to also follow the original music and descend. We want our new simple melody to follow the ascending/descending pattern of the original melody.

  • If we are playing the piano, lower notes on the left hand are often more important than higher notes for our chord structure.

  • If we are playing the piano, higher notes are often more important than lower notes for our melody.

We can keep making more rules about which notes are more important for our music, or add complications to cover more obscure cases, but these rules are true more often than not and end up making very nice-sounding pieces of music when we integrate them into our sheet music-simplifying AI tool!

Let’s follow the procedure we had before: taking each of the rules we came up with above about what notes are more important, we create functions for each of them, perhaps functions a(x, y)b(x, y)c(x, y)d(x, y), etc. and combine them, just as we did before. Our objective h(x, y) is to make the best sheet music possible that is also easier, given our original piece of sheet music x. This new function h(x, y) looks like

h(x, y) = a(x, y) + b(x, y) + c(x, y) + d(x, y) + …

Huzzah! We’ve modeled our objective for creating a simple piece of sheet music! If we want the objective for the melody to be most important in our overall objective, we multiply that function by a higher number, and it becomes more important. If we want our objective for certain notes to follow the chord structure to be lower, then we multiply that function by a lower number, and it becomes less important.

I still don’t get it. How do you go from this math into a simple piece of sheet music?

Let’s look at a specific example.

Claire De Lune.png

A passage from Claude Debussy’s “Clair de Lune”

Above, we have a couple of measures from a piece of sheet music (in D flat major). It looks very complicated, and it often takes years of practice before a musician will be ready to play it. However, we can apply many of the rules of music theory we listed before to see what notes are the most important, and what we can cut out to make a simpler piece of music.

For example, the melody of the sheet is clearly at the top of the measures, e.g. those F natural and A flat dotted-half notes are part of the melody of the music, as is the A flat and C flat a bit later on in the measure. These melody notes are crucial to keep in the new song. 

Using more of our rules, we can determine which notes are important to our sheet music and keep them around for longer the more we simplify our sheet music and throw the other ones away.

Using some statistics to determine what chords are being played

With a bit of proprietary technology, we can create a statistical system that receives some notes and tells you “this is the chord and scale that is currently in the sheet music.” Above, the system would receive all the notes in the first measure and tell you that the chords in the first measure are D flat major, F minor, and E major over A flat.

Knowing that the chord tones in a chord are the most important notes, we are able to immediately tell that, where D flat major is being played, the notes D flat, F, and A flat are the most important notes to keep around in our new simple piece of sheet music.

We follow this procedure over and over again: for each measure, we determine what the chords are in our song. We then take a look at which notes were played in each measure of the original sheet music and determine that certain notes must stay around, and certain notes can be removed.

We know which notes are most important. Where do we go from here?

We mentioned that removing notes and making simpler rhythms is what we will primarily focus on when making our simpler piece of sheet music. That’s precisely what we will do!

If we play fast sixteenth notes in our original sheet music, let’s find a simpler rhythm to play in our easier sheet music. Perhaps for a slightly simpler piece of sheet music, we replace the sixteenth notes with eighth notes. Even simpler, let’s replace them with quarter notes. Even simpler, let’s replace them with half notes or whole notes, and so on.

Whenever we cut down the number of notes we play by half, we have to decide: “which half of the notes in the original sheet music are most important to keep around, and which notes can we throw out?”

Using the objective functions and harmony classifiers mentioned above, we can answer that question easily and immediately.

We can also go chord-by-chord and take away the less important notes. A musical chord played by a piano or guitar could contain three, four, five, or more notes sometimes! We can use our objective functions to take a look at that chord and say, “hey, only two of these notes are important right now! Let’s get rid of the other ones and leave only a couple for the musician to play in their simple sheet music.”

Then, for every level of difficulty, we do the following:

Step 1: Determine how difficult we want our new piece of music to be, and what the hardest rhythm or number of notes we want to choose is.

Step 2: In simple terms, try a bunch of different note combinations to determine what the most important note combinations in our sheet music are.

Step 3: Given that we can only choose so many notes, let’s say five, use our mathematical objective functions to choose the five most important notes and throw the rest away.

Step 4: Replace the current sheet music with that many notes at slower/easier rhythms. Those notes will be the most important notes, and they will sound the best if left in our simpler sheet music. The other ones that are left out are not as important.

Step 5: Repeat in small increments along the song, replacing original notes with new simpler notes, depending on how easy you want the song to be.

What are the results?

For such a simple process, the results look astonishingly good! Remember that song “Clair de Lune” from before? Here is the original.

Untitled.png

The same passage from Claude Debussy’s “Clair de Lune”

And here is a simplified version:

Untitled.png

The passage from Claude Debussy’s “Clair de Lune,” simplified “two levels down.”

On the top, we have removed a lot of the fluff and just left in the melody, what we defined in our objective functions to be very important. On the bottom, we have replaced a lot of the fast 16th notes with much simpler eighth notes, and these eighth notes really still outline the chords that the original “Clair de Lune” plays.

Untitled.png

The passage from Claude Debussy’s “Clair de Lune,” simplified “three levels down.”

Check out this example of “Clair de Lune.” Looks much simpler and easy to play than the original, right?

The simpler our song gets, the more will be taken out. Take the above example. This is the same song at an even simpler level. We have fewer notes, where most of the notes have been replaced with quarter notes. However, paying attention to our objective functions, we still made it so that the melody at the top of the sheet music was the most important. 

This is the power of these objective functions! We can explicitly control in our data pipeline what is most important to us, and what is not very important for us. In our case, our objective was to keep the most important notes, rhythms, and melodies of our original song, constrained to us forcing the song to get easier and easier. 

Closing it out

There were a lot of details we skimmed through. This blog would get even longer if we had to talk about every detail of our pipeline, like how we determine which rhythms are truly simpler rhythms, or how behind the curtains the output of our statistical music model looks really messy, and we have to work to clean it up and make it more readable. 

However, we hope that the point that a challenge in music such as sheet music simplification can be approached using mathematics, statistics, and AI.

While music is an intensely creative and abstract process, we at Kena hope we can continue to use a mixture of music theory, mathematical and statistical theory, and artificial intelligence to continue to make the music-learning process easier for students and practitioners around the world!

Cool! Where can I check out this sheet music simplification tool?

This AI tool is currently available for everybody to use! Create an account by downloading our app from Kena and by visiting our sheet music library. When you upload a song to the sheet music library, it will upload your original sheet music and automatically simplify it by several levels, giving you a fighting chance to play the music you’ve been dreaming to play!