The Daily Pennsylvanian is a student-run nonprofit.

Please support us by disabling your ad blocker on our site.

Got a tune you can’t get out of your head? Three computer science seniors designed an algorithm that will replace that melody with a better one.

The creators of the User Input Based Algorithmic Music Platform project are developing algorithms that take a melody and create supplemental tunes to form a distinct harmony.

The algorithm created by Engineering seniors Jiten Suthar, Israel Geselowitz and David Cerny is for their senior design project — which Engineering students must complete before graduation. The three seniors were tasked with developing a creative product while applying the various skills and knowledge they had learned in class.

“We thought it would be cool to intersect music with what we’re learning in computer science,” Suthar said.

All three seniors have a background in music, playing either the piano, harmonica or guitar. Suthar also composes his own music. “It’s the one hobby that I’m most passionate about,” he said.

The algorithm determines what music to add to the original harmony by searching a database of 400 Bach Chorales, a type of German Lutheran hymn-tune, and comparing previously entered chords to to the chord patterns of the Bach Chorales.

Once the user gives input in the form of MIDI files, a type of file that carries notation, pitch and other sound-related information, the algorithm decides which chord should come next by comparing recent chords with the Bach Chorales. The newly-generated melody is random, so the algorithm produces a different outcome for each trial.

Bach Chorales currently define the music produced by the algorithm, but the team would like to “extend [it] to feature more genres from different musicians,” Geselowitz said.

The algorithm uses machine learning, a type of artificial intelligence that constructs categories from the data, to come up with a new melody. Their machine learning program is similar to the spam filter email servers employ. Through these filters, computers analyze words that are frequently used in previous spam emails to predict whether or not a new email is spam.

The music algorithm divides the Bach Chorales groups into many more categories than an email server would, though. Since the Bach Chorales do not contain every possible chord, the algorithm also uses probability to produce a chord most similar to one contained in the Bach Chorales.

This is not the first time computer science seniors tried to incorporate music into their project. One senior design project team last year developed an app that translates pictures into music. However, this year’s team members said their project is different because it creates new chords that sound good with the previous ones rather than analyzing certain images.

“We’re the only group in CIS that is doing something music-based this year,” Cerny said.

The team’s current algorithm can currently only create one supplemental melody given an original set of notes. However, Suthar said that the group’s next step is to add capabilities to create a third and fourth additional melody through machine learning.

“It will be written left to right, all three at the same time,” Cerny said, indicating that the chord generation of several melodies takes place at the same time.

As the algorithm continues to generate new chords, the accuracy will increase accordingly.

“With each new note, we have more and more data to refer to,” Geselowitz said .

Twinkle (original)

Twinkle (supplemented)

Little Lamb (original)

Little Lamb (supplemented)

Comments powered by Disqus

Please note All comments are eligible for publication in The Daily Pennsylvanian.